summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rw-r--r--script/parser/guide.lua1
-rw-r--r--script/parser/newparser.lua11
-rw-r--r--script/vm/runner.lua1
3 files changed, 13 insertions, 0 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua
index 83321bac..2894f673 100644
--- a/script/parser/guide.lua
+++ b/script/parser/guide.lua
@@ -65,6 +65,7 @@ local type = type
---@field hasGoTo? true
---@field hasReturn? true
---@field hasBreak? true
+---@field hasError? true
---@field _root parser.object
---@class guide
diff --git a/script/parser/newparser.lua b/script/parser/newparser.lua
index fa728c8b..c7e9256a 100644
--- a/script/parser/newparser.lua
+++ b/script/parser/newparser.lua
@@ -2818,6 +2818,17 @@ local function compileExpAsAction(exp)
end
if exp.type == 'call' then
+ if exp.node.special == 'error' then
+ for i = #Chunk, 1, -1 do
+ local block = Chunk[i]
+ if block.type == 'ifblock'
+ or block.type == 'elseifblock'
+ or block.type == 'else' then
+ block.hasError = true
+ break
+ end
+ end
+ end
return exp
end
diff --git a/script/vm/runner.lua b/script/vm/runner.lua
index e7851b49..5d561677 100644
--- a/script/vm/runner.lua
+++ b/script/vm/runner.lua
@@ -153,6 +153,7 @@ function mt:_lookInto(action, topNode, outNode)
local neverReturn = subBlock.hasReturn
or subBlock.hasGoTo
or subBlock.hasBreak
+ or subBlock.hasError
if not neverReturn then
blockNodes[#blockNodes+1] = blockNode
end