The 'last' variable now also receives the value of the final expression

This commit is contained in:
Celestino Amoroso 2024-05-10 04:41:26 +02:00
parent dce49fd2b7
commit 1f7b9131fc

1
ast.go
View File

@ -128,6 +128,7 @@ func (self *ast) eval(ctx ExprContext, preset bool) (result any, err error) {
} }
if err == nil { if err == nil {
result, err = self.root.compute(ctx) result, err = self.root.compute(ctx)
ctx.setVar(ControlLastResult, result)
} }
// } else { // } else {
// err = errors.New("empty expression") // err = errors.New("empty expression")