fixed mutability
This commit is contained in:
@@ -210,13 +210,11 @@ func (c *Compiler) Compile(node ast.Node) error {
|
||||
}
|
||||
|
||||
if symbol.Scope == GlobalScope {
|
||||
c.emit(code.OpGetGlobal, symbol.Index)
|
||||
c.emit(code.OpAssignGlobal, symbol.Index)
|
||||
} else {
|
||||
c.emit(code.OpGetLocal, symbol.Index)
|
||||
c.emit(code.OpAssignLocal, symbol.Index)
|
||||
}
|
||||
|
||||
c.emit(code.OpAssign)
|
||||
|
||||
case *ast.LetStatement:
|
||||
symbol, ok := c.symbolTable.Resolve(node.Name.Value)
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user