Allowance for weird case modifier with no zero after period

This commit is contained in:
Paulo Henrique Silva 2015-03-17 18:36:59 -03:00
parent 45372cfff3
commit 820d8aa903

View file

@ -97,6 +97,9 @@ class Scanner:
n = ""
while not self.eof() and (self.peek() in string.digits or self.peek() == "."):
n += self.getc()
# weird case where zero is ommited inthe last modifider, like in ',0.'
if n == ".":
return 0
return float(n)
def readstr(self, end="*"):
@ -112,7 +115,6 @@ def print_instructions(instructions):
def read_macro(macro):
instructions = []
for block in macro.split("*"):