From 1a9c22d1219eb0239417db16c9fe96eea3ced2fe Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Fri, 14 Nov 2025 13:47:51 +0100 Subject: fix: refactor VM instruction type Use custom types for VM instructions. More idiomatic code for tracing. --- parser/interpreter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'parser/interpreter.go') diff --git a/parser/interpreter.go b/parser/interpreter.go index e6ac95c..6f354d9 100644 --- a/parser/interpreter.go +++ b/parser/interpreter.go @@ -40,9 +40,9 @@ func (i *Interpreter) Eval(src string) (res reflect.Value, err error) { i.Push(i.Data[dataOffset:]...) i.PushCode(i.Code[codeOffset:]...) if s, ok := i.symbols["main"]; ok { - i.PushCode([]int64{0, vm.Calli, i.Data[s.index].Data.Int()}) + i.PushCode(vm.Instruction{Op: vm.Calli, Arg: []int{int(i.Data[s.index].Data.Int())}}) } - i.PushCode([]int64{0, vm.Exit}) + i.PushCode(vm.Instruction{Op: vm.Exit}) i.SetIP(max(codeOffset, i.Entry)) if debug { i.PrintData() -- cgit v1.2.3