@@ -885,20 +885,24 @@ def exitValueExpression(self, ctx: ExpressionParser.ValueExpressionContext):
885885 bitwise_operator : ExpressionParser .BitwiseOperatorContext = ctx .bitwiseOperator ()
886886
887887 if bitwise_operator is not None :
888- operatorsymbol = bitwise_operator .getText ()
889-
890- if operatorsymbol == "&" :
891- operatortype = ExpressionOperatorType .BITWISEAND
892- elif operatorsymbol == "|" :
893- operatortype = ExpressionOperatorType .BITWISEOR
894- elif operatorsymbol == "^" :
895- operatortype = ExpressionOperatorType .BITWISEXOR
896- elif operatorsymbol == "<<" :
897- operatortype = ExpressionOperatorType .BITSHIFTLEFT
898- elif operatorsymbol == ">>" :
899- operatortype = ExpressionOperatorType .BITSHIFTRIGHT
888+ # Check for bitwise operators
889+ if bitwise_operator .K_XOR () is None :
890+ operatorsymbol = bitwise_operator .getText ()
891+
892+ if operatorsymbol == "&" :
893+ operatortype = ExpressionOperatorType .BITWISEAND
894+ elif operatorsymbol == "|" :
895+ operatortype = ExpressionOperatorType .BITWISEOR
896+ elif operatorsymbol == "^" :
897+ operatortype = ExpressionOperatorType .BITWISEXOR
898+ elif operatorsymbol == "<<" :
899+ operatortype = ExpressionOperatorType .BITSHIFTLEFT
900+ elif operatorsymbol == ">>" :
901+ operatortype = ExpressionOperatorType .BITSHIFTRIGHT
902+ else :
903+ raise EvaluateError (f"unexpected bitwise operator \" { operatorsymbol } \" " )
900904 else :
901- raise EvaluateError ( f"unexpected bitwise operator \" { operatorsymbol } \" " )
905+ operatortype = ExpressionOperatorType . BITWISEXOR
902906
903907 self ._add_expr (ctx , OperatorExpression (operatortype , left , right ))
904908 return
0 commit comments