Updated exceptions to be more fitting, fixed a parse bug in the tokenizer and added the start of the calc engine.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import token
|
||||
import tokenizer
|
||||
#userInput = input('Enter your formula: ')
|
||||
tokens = tokenizer.get_tokens_from_expression_string("1 + 2 / 3 (3 * 4) 5")
|
||||
tokens = tokenizer.get_tokens_from_expression_string("i + 2 / i (3 * n) 5")
|
||||
|
||||
for t in tokens:
|
||||
print("%s (%s) " %(t.value, token.TokenType.get_operator_name(t.type)), end = "")
|
||||
|
||||
Reference in New Issue
Block a user