summaryrefslogtreecommitdiff
path: root/vm0/func.go
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2023-08-31 17:53:54 +0200
committerMarc Vertes <mvertes@free.fr>2023-08-31 17:53:54 +0200
commit851c793da43be9e4d3319afe440d603c85834045 (patch)
treefd4b3d3812f5743213b5849858c459c8196dbf7f /vm0/func.go
parent0f4bfe6e70263fbeb580014b62632f403b29b414 (diff)
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
Diffstat (limited to 'vm0/func.go')
-rw-r--r--vm0/func.go2
1 files changed, 1 insertions, 1 deletions
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)