mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-28 00:59:31 +00:00
Add anonymous functions
This commit is contained in:
parent
2c6d66c222
commit
5e441886c0
15 changed files with 352 additions and 110 deletions
|
|
@ -495,7 +495,7 @@ local function eval(state, exp)
|
|||
ret, e = run(state, fn.child)
|
||||
-- resume at last checkpoint
|
||||
else
|
||||
local expr, err = expression(checkpoint.value[1], state, fn.namespace)
|
||||
local expr, err = expression(checkpoint.value[1], state, fn.namespace, "resume from checkpoint")
|
||||
if not expr then return nil, err end
|
||||
ret, e = eval(state, expr)
|
||||
end
|
||||
|
|
@ -567,6 +567,11 @@ local function eval(state, exp)
|
|||
type = "event buffer",
|
||||
value = l
|
||||
}
|
||||
elseif exp.type == "nonpersistent" then
|
||||
local v, e = eval(state, exp.expression)
|
||||
if not v then return nil, e end
|
||||
v.nonpersistent = true
|
||||
return v
|
||||
-- pass the value along (internal type, used for variable reference implicit calls)
|
||||
elseif exp.type == "value passthrough" then
|
||||
return exp.value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue