diff --git a/pkg/compiler/internal/expr.go b/pkg/compiler/internal/expr.go index a17440e9..e78ca12c 100644 --- a/pkg/compiler/internal/expr.go +++ b/pkg/compiler/internal/expr.go @@ -364,11 +364,12 @@ func (ec *ExprCompiler) CompileMemberExpression(ctx fql.IMemberExpressionContext } func (ec *ExprCompiler) CompileVariable(ctx fql.IVariableContext) vm.Operand { + name := ctx.Identifier().GetText() // Just return the register / constant index - op, _, found := ec.ctx.Symbols.Resolve(ctx.GetText()) + op, _, found := ec.ctx.Symbols.Resolve(name) if !found { - panic(runtime.Error(core.ErrVariableNotFound, ctx.GetText())) + panic(runtime.Error(core.ErrVariableNotFound, name)) } if op.IsRegister() { diff --git a/test/integration/vm/vm_for_in_collect_agg_test.go b/test/integration/vm/vm_for_in_collect_agg_test.go index 1ab6d88f..33109af3 100644 --- a/test/integration/vm/vm_for_in_collect_agg_test.go +++ b/test/integration/vm/vm_for_in_collect_agg_test.go @@ -205,7 +205,7 @@ FOR u IN users "highSalaryCount": 3, }, }, "Should aggregate with conditional expressions"), - SkipCaseArray(` + CaseArray(` LET users = [ { active: true, @@ -247,7 +247,7 @@ FOR u IN users `, []any{map[string]any{"minAge": 25, "maxAge": 69}}, "Should collect and aggregate values without grouping"), - SkipCaseArray(` + CaseArray(` LET users = [] FOR u IN users COLLECT AGGREGATE minAge = MIN(u.age), maxAge = MAX(u.age) @@ -258,7 +258,7 @@ FOR u IN users `, []any{map[string]any{"minAge": nil, "maxAge": nil}}, "Should handle empty arrays gracefully"), - DebugCaseArray(` + CaseArray(` LET users = [ { active: true,