mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-06-02 09:31:12 +00:00
Get map parsing pretty much working.
No geometry is created yet. Both id and quest formats are supported. e1m1.map parses in less than two seconds on my system.
This commit is contained in:
parent
97c99de581
commit
15a906aadb
5 changed files with 417 additions and 5 deletions
|
@ -12,7 +12,7 @@ class Script:
|
|||
if self.unget:
|
||||
return True
|
||||
while self.pos < len(self.text):
|
||||
while self.text[self.pos].isspace():
|
||||
while self.pos < len(self.text) and self.text[self.pos].isspace():
|
||||
if self.text[self.pos] == "\n":
|
||||
if not crossline:
|
||||
return False
|
||||
|
@ -41,16 +41,16 @@ class Script:
|
|||
return self.token
|
||||
if not self.tokenAvailable(crossline):
|
||||
if not crossline:
|
||||
self.error("line is incomplete")
|
||||
self.error(self, "line is incomplete")
|
||||
return None
|
||||
if self.text[self.pos] == "\"":
|
||||
self.pos += 1
|
||||
start = self.pos
|
||||
if self.text[self.pos] == len(self.text):
|
||||
self.error("EOF inside quoted string")
|
||||
self.error(self, "EOF inside quoted string")
|
||||
while self.text[self.pos] != "\"":
|
||||
if self.pos == len(self.text):
|
||||
self.error("EOF inside quoted string")
|
||||
self.error(self, "EOF inside quoted string")
|
||||
return None
|
||||
if self.text[self.pos] == "\n":
|
||||
self.line += 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue