From cdbe3dfc22de60b0345024049c3ab3a33a363da6 Mon Sep 17 00:00:00 2001 From: Celestino Amoroso Date: Wed, 1 May 2024 05:57:08 +0200 Subject: [PATCH] commented tracing code --- context-helpers.go | 2 ++ operand-func.go | 1 + operand-iterator.go | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/context-helpers.go b/context-helpers.go index fcafe4a..46b3fee 100644 --- a/context-helpers.go +++ b/context-helpers.go @@ -27,8 +27,10 @@ func exportFunc(ctx ExprContext, name string, info ExprFunc) { func exportObjects(destCtx, sourceCtx ExprContext) { exportAll := isEnabled(sourceCtx, control_export_all) + // fmt.Printf("Exporting from sourceCtx [%p] to destCtx [%p] -- exportAll=%t\n", sourceCtx, destCtx, exportAll) // Export variables for _, refName := range sourceCtx.EnumVars(func(name string) bool { return exportAll || name[0] == '@' }) { + // fmt.Printf("\tExporting %q\n", refName) refValue, _ := sourceCtx.GetVar(refName) exportVar(destCtx, refName, refValue) } diff --git a/operand-func.go b/operand-func.go index ce86862..b0eba53 100644 --- a/operand-func.go +++ b/operand-func.go @@ -24,6 +24,7 @@ func newFuncCallTerm(tk *Token, args []*term) *term { func evalFuncCall(parentCtx ExprContext, self *term) (v any, err error) { ctx := cloneContext(parentCtx) name, _ := self.tk.Value.(string) + // fmt.Printf("Call %s(), context: %p\n", name, ctx) params := make([]any, len(self.children)) for i, tree := range self.children { var param any diff --git a/operand-iterator.go b/operand-iterator.go index 3ed0013..e075200 100644 --- a/operand-iterator.go +++ b/operand-iterator.go @@ -131,7 +131,8 @@ func evalIterator(ctx ExprContext, self *term) (v any, err error) { } dc := newDataCursor(ctx, ds) - + // var it Iterator = dc + // fmt.Println(it) if initFunc, exists := ds[initName]; exists && initFunc != nil { var args []any if len(self.children) > 1 {