Globals to compiler

This commit is contained in:
Chuck Smith
2024-02-20 16:07:01 -05:00
parent 6ba2d3abe4
commit e8254fc996
7 changed files with 213 additions and 0 deletions

View File

@@ -27,6 +27,8 @@ const (
OpJumpNotTruthy
OpJump
OpNull
OpGetGlobal
OpSetGlobal
)
type Definition struct {
@@ -51,6 +53,8 @@ var definitions = map[Opcode]*Definition{
OpJumpNotTruthy: {"OpJumpNotTruthy", []int{2}},
OpJump: {"OpJump", []int{2}},
OpNull: {"OpNull", []int{}},
OpGetGlobal: {"OpGetGlobal", []int{2}},
OpSetGlobal: {"OpSetGlobal", []int{2}},
}
func Lookup(op byte) (*Definition, error) {