Strings
This commit is contained in:
@@ -190,6 +190,10 @@ func (c *Compiler) Compile(node ast.Node) error {
|
||||
|
||||
c.emit(code.OpGetGlobal, symbol.Index)
|
||||
|
||||
case *ast.StringLiteral:
|
||||
str := &object.String{Value: node.Value}
|
||||
c.emit(code.OpConstant, c.addConstant(str))
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user