functions with bindings
This commit is contained in:
20
vm/frame.go
Normal file
20
vm/frame.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user