change priority of "/" to have the priority over "*" and ":"

This commit is contained in:
lafrite 2014-01-19 18:44:16 +01:00
parent 852c67b22a
commit 5e6cec5f58

View File

@ -10,7 +10,7 @@ from formal import FormalExp
class Expression(object): class Expression(object):
"""A calculus expression. Today it can andle only expression with numbers later it will be able to manipulate unknown""" """A calculus expression. Today it can andle only expression with numbers later it will be able to manipulate unknown"""
PRIORITY = {"*" : 3, "/": 3, ":": 3, "+": 2, "-":2, "(": 1} PRIORITY = {"*" : 3, "/": 4, ":": 3, "+": 2, "-":2, "(": 1}
def __init__(self, exp): def __init__(self, exp):
""" Initiate the expression """ Initiate the expression