Files
monkey/vm/frame.go
Chuck Smith ec9a586f7f
Some checks failed
Build / build (push) Failing after 1m42s
Test / build (push) Successful in 2m27s
functions with bindings
2024-03-08 14:19:20 -05:00

21 lines
359 B
Go

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
}