fixed mutability
Some checks failed
Build / build (push) Failing after 1m30s
Test / build (push) Failing after 12m1s

This commit is contained in:
Chuck Smith
2024-03-15 15:50:11 -04:00
parent 80f1a2d78c
commit 7463b3af39
7 changed files with 37 additions and 118 deletions

View File

@@ -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 {