diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-10-08 18:45:40 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-10-08 18:45:40 +0800 |
commit | 896e4b9796ab5c9d3943640f02114dccc48ba3dd (patch) | |
tree | 3c2c3acd3d2c5a70ea192a37dcfc41ed248c9615 /script/parser | |
parent | fd14f3bcd8534f937f2149dacc8712d5669812a0 (diff) | |
download | lua-language-server-896e4b9796ab5c9d3943640f02114dccc48ba3dd.zip |
fix #707
Diffstat (limited to 'script/parser')
-rw-r--r-- | script/parser/newparser.lua | 14 |
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 |