Fix parser a bit
This commit is contained in:
parent
c23a868513
commit
e3335ace69
1 changed files with 5 additions and 5 deletions
|
@ -27,12 +27,10 @@ class PathCommand():
|
|||
self.arg += ch
|
||||
|
||||
def arg_next(self, ch: str):
|
||||
if len(self.arg) == 0:
|
||||
return
|
||||
if len(self.arg) > 0:
|
||||
self.args.append(self.arg)
|
||||
|
||||
self.arg += ch
|
||||
self.args.append(self.arg)
|
||||
self.arg = ''
|
||||
self.arg = ch
|
||||
|
||||
def arg_finish(self):
|
||||
if len(self.arg) > 0:
|
||||
|
@ -115,6 +113,8 @@ class Path():
|
|||
command.set_command(ch)
|
||||
elif Path.is_number(c):
|
||||
command.arg_addch(ch)
|
||||
elif ch == '-':
|
||||
command.arg_next(ch)
|
||||
elif ch == ' ' or ch == ',':
|
||||
state = State.INT
|
||||
command.arg_finish()
|
||||
|
|
Loading…
Add table
Reference in a new issue