VM globals
Some checks failed
Build / build (push) Failing after 1m50s
Test / build (push) Failing after 1m25s

This commit is contained in:
Chuck Smith
2024-02-20 16:24:59 -05:00
parent e8254fc996
commit 8caeaca559
4 changed files with 54 additions and 2 deletions

View File

@@ -32,6 +32,13 @@ func New() *Compiler {
}
}
func NewWithState(s *SymbolTable, constants []object.Object) *Compiler {
compiler := New()
compiler.symbolTable = s
compiler.constants = constants
return compiler
}
func (c *Compiler) Compile(node ast.Node) error {
switch node := node.(type) {
case *ast.Program: