Improved negative variable handling in the tokenizer. Updated the tolerance checking in the main program.
This commit is contained in:
@@ -44,6 +44,12 @@ def get_tokens_from_expression_string(expression_string):
|
||||
#Must be a variable.
|
||||
if tokens[-1].type == token.TokenType.exp_start:
|
||||
variable_is_negative = True
|
||||
elif token.TokenType.get_operator(tokens[-1].value) != token.TokenType.unknown:
|
||||
variable_is_negative = True
|
||||
elif tokens[-1].type == token.TokenType.exp_end:
|
||||
tokens.append(token.Token(c, token.TokenType.get_operator(c)))
|
||||
parsing_number = False
|
||||
tmp = ""
|
||||
else:
|
||||
tokens.append(token.Token(c, token.TokenType.get_operator(c)))
|
||||
parsing_number = False
|
||||
|
||||
Reference in New Issue
Block a user