Commit c4f5718f by Zachary Snow

support for binary xnor

parent 2314f97a
......@@ -41,6 +41,7 @@ data BinOp
| LogOr
| BitAnd
| BitXor
| BitXnor
| BitOr
| Mul
| Div
......@@ -69,6 +70,7 @@ instance Show BinOp where
show LogOr = "||"
show BitAnd = "&"
show BitXor = "^"
show BitXnor = "~^"
show BitOr = "|"
show Mul = "*"
show Div = "/"
......
......@@ -221,7 +221,7 @@ directive { Token Spe_Directive _ _ }
%left "||"
%left "&&"
%left "|" "~|"
%left "^" "^~"
%left "^" "^~" "~^"
%left "&" "~&"
%left "==" "!=" "===" "!==" "==?" "!=?"
%left "<" "<=" ">" ">="
......@@ -781,6 +781,8 @@ Expr :: { Expr }
| Expr "|" Expr { BinOp BitOr $1 $3 }
| Expr "^" Expr { BinOp BitXor $1 $3 }
| Expr "&" Expr { BinOp BitAnd $1 $3 }
| Expr "~^" Expr { BinOp BitXnor $1 $3 }
| Expr "^~" Expr { BinOp BitXnor $1 $3 }
| Expr "+" Expr { BinOp Add $1 $3 }
| Expr "-" Expr { BinOp Sub $1 $3 }
| Expr "*" Expr { BinOp Mul $1 $3 }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment