mirror of https://github.com/japl-lang/japl.git
Added bitwise operator tests
Fixed bitwise not crashing compiler when used as a binary op
This commit is contained in:
parent
ded5b91950
commit
2d2ef61fa1
|
@ -1137,7 +1137,7 @@ var rules: array[TokenType, ParseRule] = [
|
|||
makeRule(literal, nil, Precedence.Term), # NAN
|
||||
makeRule(nil, binary, Precedence.Term), # BAND
|
||||
makeRule(nil, binary, Precedence.Term), # BOR
|
||||
makeRule(unary, nil, Precedence.Term), # TILDE
|
||||
makeRule(unary, nil, Precedence.None), # TILDE
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
print(~5 | 5);//output:-1
|
||||
print(1 | 2);//output:3
|
||||
print(1 & 2);//output:0
|
||||
print(~124 & 124);//output:0
|
||||
print(1 | 2 | 4 | 8);//output:15
|
||||
print(32 | 64);//output:96
|
||||
print(96 & 32);//output:32
|
||||
print(~0);//output:-1
|
||||
print(~356);//output:-357
|
Loading…
Reference in New Issue