diff options
Diffstat (limited to 'server-beta/src/parser/compile.lua')
-rw-r--r-- | server-beta/src/parser/compile.lua | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/server-beta/src/parser/compile.lua b/server-beta/src/parser/compile.lua index 2bcb7e46..51803753 100644 --- a/server-beta/src/parser/compile.lua +++ b/server-beta/src/parser/compile.lua @@ -194,6 +194,13 @@ local vmMap = { finish = obj.finish, } end + local func = guide.getParentFunction(obj) + if func then + if not func.returns then + func.returns = {} + end + func.returns[#func.returns+1] = obj + end end, ['label'] = function (obj) local block = guide.getBlock(obj) @@ -281,7 +288,13 @@ local vmMap = { Block = lastBlock end, ['break'] = function (obj) - if not guide.getBreakBlock(obj) then + local block = guide.getBreakBlock(obj) + if block then + if not block.breaks then + block.breaks = {} + end + block.breaks[#block.breaks+1] = obj + else pushError { type = 'BREAK_OUTSIDE', start = obj.start, |