summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/compile.lua6
-rw-r--r--script/parser/guide.lua2
2 files changed, 5 insertions, 3 deletions
diff --git a/script/parser/compile.lua b/script/parser/compile.lua
index 7cc6f36b..917a68a4 100644
--- a/script/parser/compile.lua
+++ b/script/parser/compile.lua
@@ -118,6 +118,7 @@ local Specials = {
['assert'] = true,
['error'] = true,
['type'] = true,
+ ['os.exit'] = true,
}
local UnarySymbol = {
@@ -2899,14 +2900,15 @@ local function compileExpAsAction(exp)
end
if exp.type == 'call' then
- if exp.node.special == 'error' then
+ if exp.node.special == 'error'
+ or exp.node.special == 'os.exit' then
for i = #Chunk, 1, -1 do
local block = Chunk[i]
if block.type == 'ifblock'
or block.type == 'elseifblock'
or block.type == 'elseblock'
or block.type == 'function' then
- block.hasError = true
+ block.hasExit = true
break
end
end
diff --git a/script/parser/guide.lua b/script/parser/guide.lua
index 0b6de77d..ec5746c1 100644
--- a/script/parser/guide.lua
+++ b/script/parser/guide.lua
@@ -72,7 +72,7 @@ local type = type
---@field hasGoTo? true
---@field hasReturn? true
---@field hasBreak? true
----@field hasError? true
+---@field hasExit? true
---@field [integer] parser.object|any
---@field package _root parser.object