summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-10-08 18:44:16 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-10-08 18:44:16 +0800
commitaf1bfbd0183106c319758ec540e66c0e7f5c9454 (patch)
tree3c2c3acd3d2c5a70ea192a37dcfc41ed248c9615 /script/parser
parent8bb6567f40799f555a157d5fb9307b8c686a17df (diff)
downloadlua-language-server-af1bfbd0183106c319758ec540e66c0e7f5c9454.zip
fix #709
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/newparser.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/script/parser/newparser.lua b/script/parser/newparser.lua
index 1fd395e5..c110ca2d 100644
--- a/script/parser/newparser.lua
+++ b/script/parser/newparser.lua
@@ -496,7 +496,7 @@ local function skipComment(isAction)
pushCommentHeadError(left)
end
Index = Index + 2
- local longComment = parseLongString()
+ local longComment = start + 2 == Tokens[Index] and parseLongString()
if longComment then
longComment.type = 'comment.long'
longComment.text = longComment[1]
@@ -3640,14 +3640,26 @@ return function (lua, mode, version, options)
State.ast = parseString()
elseif mode == 'Number' then
State.ast = parseNumber()
+ elseif mode == 'Name' then
+ State.ast = parseName()
elseif mode == 'Exp' then
State.ast = parseExp()
elseif mode == 'Action' then
State.ast = parseAction()
end
+
if State.ast then
State.ast.state = State
end
+ while true do
+ if Index <= #Tokens then
+ unknownSymbol()
+ Index = Index + 2
+ else
+ break
+ end
+ end
+
return State
end