mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-28 00:59:31 +00:00
Add "function return" and "scoped function return" injections, allow children for return lines
This commit is contained in:
parent
b60f53df01
commit
933e8fb0ee
7 changed files with 131 additions and 72 deletions
|
|
@ -92,6 +92,9 @@ run_line = function(state, line)
|
|||
elseif line.type == "return" then
|
||||
local v, e = eval(state, line.expression)
|
||||
if not v then return v, ("%s; at %s"):format(e, line.source) end
|
||||
local cv, ce = run_block(state, line.child)
|
||||
if ce then return cv, ce end
|
||||
if cv then return cv end
|
||||
return v
|
||||
elseif line.type == "text" then
|
||||
local v, e = events:make_space_for(state, "text") -- do this before any evaluation start
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue