@@ -715,8 +715,8 @@ def type_mismatch(v: BinaryOperation) -> str:
715715 self .operation = operations .get (self .operation , self .operation )
716716 assert left_type in ("INTEGER" , "REAL" ), type_mismatch (self )
717717
718- elif self .operation in ("<" , "<=" , ">" , ">=" , "=" , "<>" , "|" , "XOR" ):
719- operations = {"=" : "==" , "<>" : "!=" , "|" : "||" , "XOR" : "^" }
718+ elif self .operation in ("<" , "<=" , ">" , ">=" , "=" , "<>" , "&" , " |" , "XOR" ):
719+ operations = {"=" : "==" , "<>" : "!=" , "&" : "&&" , " |" : "||" , "XOR" : "^" }
720720 self .operation = operations .get (self .operation , self .operation )
721721 assert left_type in ("BOOLEAN" , "INTEGER" , "REAL" ), type_mismatch (self )
722722
@@ -729,7 +729,7 @@ def type_mismatch(v: BinaryOperation) -> str:
729729 return f"({ self .left .c ()} { self .operation } { self .right .c ()} )"
730730
731731 def py (self ) -> str :
732- operations = {"AND" : "and" , "OR" : "or" , "=" : "==" , "<>" : "!=" , "||" : "or" , "XOR" : "^" }
732+ operations = {"AND" : "and" , "OR" : "or" , "=" : "==" , "<>" : "!=" , "&&" : "and" , " ||" : "or" , "XOR" : "^" }
733733 operation = operations .get (self .operation , self .operation )
734734 rhs = self .right .py ()
735735 if operation == "==" and rhs == "True" :
0 commit comments