From 07aecfc4e712cd42e57f8be04452d1a6f82bba39 Mon Sep 17 00:00:00 2001 From: Celestino Amoroso Date: Tue, 21 Jul 2026 09:09:32 +0200 Subject: [PATCH] digest operator assigns the special variable 'last' for each iteration --- operator-digest.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/operator-digest.go b/operator-digest.go index 64a8230..8772021 100644 --- a/operator-digest.go +++ b/operator-digest.go @@ -48,9 +48,10 @@ func evalDigest(ctx kern.ExprContext, opTerm *scan.Term) (v any, err error) { ctx.SetVar("#", it.Count()) if rightValue, err = opTerm.Children[1].Compute(ctx); err == nil { if rightValue == nil { - break + err = io.EOF } else { lastValue = rightValue + ctx.SetVar(kern.ControlLastResult, lastValue) } } ctx.DeleteVar("#")