Skip to content

Commit

Permalink
check if macro language numeric variables are of correct type (fix is…
Browse files Browse the repository at this point in the history
…sue #208)
  • Loading branch information
robhagemans committed Aug 14, 2022
1 parent 523753f commit bb2af3b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pcbasic/basic/mlparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ def parse_number(self, default=None):
if len(c) == 0:
raise error.BASICError(error.IFC)
elif ord(c) > 8:
step = self._parse_variable().to_int()
stepval = self._parse_variable()
step = values.pass_number(stepval).to_int()
self.require_read((b';',), err=error.IFC)
else:
# varptr$
step = self.memory.get_value_for_varptrstr(self.read(3)).to_int()
stepval = self.memory.get_value_for_varptrstr(self.read(3))
step = values.pass_number(stepval).to_int()
elif c and c in DIGITS:
step = self._parse_const()
elif default is not None:
Expand Down

0 comments on commit bb2af3b

Please sign in to comment.