digest operator assigns the special variable 'last' for each iteration

This commit is contained in:
2026-07-21 09:09:32 +02:00
parent 2f616f349b
commit 07aecfc4e7
+2 -1
View File
@@ -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("#")