1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-27 16:49:31 +00:00

Add "function return" and "scoped function return" injections, allow children for return lines

This commit is contained in:
Étienne Fildadut 2022-01-16 15:32:59 +01:00
parent b60f53df01
commit 933e8fb0ee
7 changed files with 131 additions and 72 deletions

View file

@ -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