mirror of https://github.com/zachjs/sv2v.git
support for binary xnor
This commit is contained in:
parent
2314f97a96
commit
c4f5718f51
|
|
@ -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 }
|
||||
|
|
|
|||
Loading…
Reference in New Issue