Raise EParseSyntax on wrong minus sign (not followed by int or float)

While not strictly a bug because it would be caught later in the function (it passes the tests either way), it made me nervous to leave a dangling NextToken().
This commit is contained in:
Sei Lisa 2018-03-31 19:31:07 +02:00
parent dc30d461e2
commit 4ebd84f0ed

View file

@ -832,6 +832,7 @@ class parser(object):
self.NextToken()
return nr(nt=CONST, value=-val,
t='integer' if type(val) == int else 'float')
raise EParseSyntax(self)
if tok0 == 'INTEGER_VALUE':
self.NextToken()
return nr(nt=CONST, t='integer', value=val)