functions with bindings
Some checks failed
Build / build (push) Failing after 1m42s
Test / build (push) Successful in 2m27s

This commit is contained in:
Chuck Smith
2024-03-08 14:19:20 -05:00
parent 9d06c90e41
commit ec9a586f7f
10 changed files with 350 additions and 30 deletions

20
vm/frame.go Normal file
View File

@@ -0,0 +1,20 @@
package vm
import (
"monkey/code"
"monkey/object"
)
type Frame struct {
fn *object.CompiledFunction
ip int
basePointer int
}
func NewFrame(fn *object.CompiledFunction, basePointer int) *Frame {
return &Frame{fn: fn, ip: -1, basePointer: basePointer}
}
func (f *Frame) Instructions() code.Instructions {
return f.fn.Instructions
}