Add null literal
This commit is contained in:
@@ -155,6 +155,9 @@ func (c *Compiler) Compile(node ast.Node) error {
|
||||
integer := &object.Integer{Value: node.Value}
|
||||
c.emit(code.OpConstant, c.addConstant(integer))
|
||||
|
||||
case *ast.Null:
|
||||
c.emit(code.OpNull)
|
||||
|
||||
case *ast.Boolean:
|
||||
if node.Value {
|
||||
c.emit(code.OpTrue)
|
||||
|
||||
Reference in New Issue
Block a user