Fix parser a bit

This commit is contained in:
XANTRONIX Development 2024-01-01 23:18:45 -05:00
parent c23a868513
commit e3335ace69

View file

@ -27,12 +27,10 @@ class PathCommand():
self.arg += ch
def arg_next(self, ch: str):
if len(self.arg) == 0:
return
self.arg += ch
if len(self.arg) > 0:
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()