Precedence fix.
This commit is contained in:
parent
98da65f8cc
commit
20d850d21f
|
@ -1326,7 +1326,9 @@ class Interpreter():
|
||||||
val2 = v2
|
val2 = v2
|
||||||
else:
|
else:
|
||||||
val2 = v2.get_value()
|
val2 = v2.get_value()
|
||||||
assert(type(val1) == type(val2))
|
if type(val1) != type(val2):
|
||||||
|
raise InterpreterException('Comparison of different types %s and %s.' %
|
||||||
|
(str(type(val1)), str(type(val2))))
|
||||||
if node.get_ctype() == '==':
|
if node.get_ctype() == '==':
|
||||||
return val1 == val2
|
return val1 == val2
|
||||||
elif node.get_ctype() == '!=':
|
elif node.get_ctype() == '!=':
|
||||||
|
|
|
@ -69,10 +69,10 @@ t_ignore = ' \t'
|
||||||
precedence = (
|
precedence = (
|
||||||
('left', 'COMMA'),
|
('left', 'COMMA'),
|
||||||
('left', 'ASSIGN'),
|
('left', 'ASSIGN'),
|
||||||
('nonassoc', 'EQUALS', 'NEQUALS'),
|
|
||||||
('left', 'OR'),
|
('left', 'OR'),
|
||||||
('left', 'AND'),
|
('left', 'AND'),
|
||||||
('right', 'NOT'),
|
('right', 'NOT'),
|
||||||
|
('nonassoc', 'EQUALS', 'NEQUALS'),
|
||||||
('nonassoc', 'COLON'),
|
('nonassoc', 'COLON'),
|
||||||
('left', 'DOT'),
|
('left', 'DOT'),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue