diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-02-10 16:01:17 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-02-10 16:01:17 +0800 |
commit | 4b0d634a27ae188c98f839736bad1b8514952467 (patch) | |
tree | 1152d131fe33306b0b753ed20d799119829add53 /script/parser/compile.lua | |
parent | 5e112de9cbf4627038036fdfa41e9cf890d74e1d (diff) | |
download | lua-language-server-4b0d634a27ae188c98f839736bad1b8514952467.zip |
fix #1889
Diffstat (limited to 'script/parser/compile.lua')
-rw-r--r-- | script/parser/compile.lua | 6 |
1 files changed, 4 insertions, 2 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 |