From 851c793da43be9e4d3319afe440d603c85834045 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Thu, 31 Aug 2023 17:53:54 +0200 Subject: codegen: fix interpreter re-entrance So multiple successive incremental Evals function correctly. Also improve the following: - Apply the same Eval API to vm0 and vm1 - parser: dot diagram display is now synchronous - codegen: outsource complex code generation for readability - vm1: Pop take the number of values to pop as operand --- vm0/func.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vm0/func.go') diff --git a/vm0/func.go b/vm0/func.go index 6976530..ee503bc 100644 --- a/vm0/func.go +++ b/vm0/func.go @@ -60,7 +60,7 @@ func (i *Interp) declareFunc(r *parser.Node, scope string) { for _, arg := range args { i.push(arg.Interface()) } - if _, err := i.Run(r.Child[len(r.Child)-1], fscope); err != nil { + if err := i.Run(r.Child[len(r.Child)-1], fscope); err != nil { panic(err) } b := len(i.stack) - len(out) -- cgit v1.2.3