VM globals
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user