bitwise operators and boolean operators
Some checks failed
Test / build (push) Waiting to run
Build / build (push) Has been cancelled

This commit is contained in:
Chuck Smith
2024-03-23 10:00:02 -04:00
parent cbb430b47d
commit ef8c8f8f04
13 changed files with 427 additions and 188 deletions

View File

@@ -141,6 +141,16 @@ func (c *Compiler) Compile(node ast.Node) error {
c.emit(code.OpDiv)
case "%":
c.emit(code.OpMod)
case "|":
c.emit(code.OpBitwiseOR)
case "^":
c.emit(code.OpBitwiseXOR)
case "&":
c.emit(code.OpBitwiseAND)
case "||":
c.emit(code.OpOr)
case "&&":
c.emit(code.OpAnd)
case ">":
c.emit(code.OpGreaterThan)
case ">=":
@@ -177,7 +187,9 @@ func (c *Compiler) Compile(node ast.Node) error {
switch node.Operator {
case "!":
c.emit(code.OpBang)
c.emit(code.OpNot)
case "~":
c.emit(code.OpBitwiseNOT)
case "-":
c.emit(code.OpMinus)
default: