optimizations
Some checks failed
Build / build (push) Successful in 9m47s
Publish Image / publish (push) Failing after 49s
Test / build (push) Failing after 6m19s

This commit is contained in:
Chuck Smith
2024-04-02 14:32:03 -04:00
parent 07fd82b261
commit 88e3330856
18 changed files with 510 additions and 31 deletions

View File

@@ -173,8 +173,12 @@ func (c *Compiler) Compile(node ast.Node) error {
}
case *ast.IntegerLiteral:
integer := object.Integer{Value: node.Value}
c.emit(code.OpConstant, c.addConstant(integer))
i := object.Integer{Value: node.Value}
c.emit(code.OpConstant, c.addConstant(i))
case *ast.FloatLiteral:
f := object.Float{Value: node.Value}
c.emit(code.OpConstant, c.addConstant(f))
case *ast.Null:
c.emit(code.OpNull)