Files
monkey/vm/frame.go
Chuck Smith 78b560e457
Some checks failed
Build / build (push) Failing after 1m56s
Test / build (push) Failing after 2m33s
Everything is a closure
2024-03-13 17:08:17 -04:00

24 lines
369 B
Go

package vm
import (
"monkey/code"
"monkey/object"
)
type Frame struct {
cl *object.Closure
ip int
basePointer int
}
func NewFrame(cl *object.Closure, basePointer int) *Frame {
return &Frame{
cl: cl,
ip: -1,
basePointer: basePointer}
}
func (f *Frame) Instructions() code.Instructions {
return f.cl.Fn.Instructions
}