Changed the token.py to ptoken.py (for Placeholder Token) to avoid naming conflicts with jsonpickle.
This commit is contained in:
+5
-5
@@ -1,4 +1,4 @@
|
||||
import token
|
||||
import ptoken as token
|
||||
import copy
|
||||
|
||||
def calculate_results(tokens):
|
||||
@@ -8,7 +8,7 @@ def calculate_results(tokens):
|
||||
|
||||
def handle_parenthesis(tokens, call_has_priority = False):
|
||||
running_value = 0
|
||||
previous_token = token.CToken("", token.TokenType.unknown)
|
||||
previous_token = token.Token("", token.TokenType.unknown)
|
||||
|
||||
while True:
|
||||
if len(tokens) == 0:
|
||||
@@ -40,7 +40,7 @@ def handle_parenthesis(tokens, call_has_priority = False):
|
||||
if not previous_token.type == token.TokenType.unknown:
|
||||
tokens.append(previous_token)
|
||||
else:
|
||||
tokens.append(token.CToken(running_value, token.TokenType.constant))
|
||||
tokens.append(token.Token(running_value, token.TokenType.constant))
|
||||
|
||||
running_value = handle_add_and_subtract(tokens)
|
||||
#Set the previous_token to an invalid state so its not used by mistake.
|
||||
@@ -103,7 +103,7 @@ def handle_parenthesis(tokens, call_has_priority = False):
|
||||
|
||||
def handle_multiply_and_division(tokens):
|
||||
running_value = 0
|
||||
previous_token = token.CToken("", token.TokenType.unknown)
|
||||
previous_token = token.Token("", token.TokenType.unknown)
|
||||
|
||||
while True:
|
||||
if len(tokens) == 0:
|
||||
@@ -156,7 +156,7 @@ def handle_add_and_subtract(tokens):
|
||||
# need to change for the life of this project.
|
||||
#
|
||||
running_value = 0
|
||||
previous_token = token.CToken("", token.TokenType.unknown)
|
||||
previous_token = token.Token("", token.TokenType.unknown)
|
||||
|
||||
while True:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user