Skip to content

Commit af1bfbd

Browse files
committed
fix #709
1 parent 8bb6567 commit af1bfbd

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# changelog
22

33
## 2.4.2
4+
* `FIX` [#707](https://github.com./sumneko/lua-language-server/issues/707)
45
* `FIX` [#709](https://github.com./sumneko/lua-language-server/issues/709)
56

67
## 2.4.1

script/parser/newparser.lua

+13-1
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ local function skipComment(isAction)
496496
pushCommentHeadError(left)
497497
end
498498
Index = Index + 2
499-
local longComment = parseLongString()
499+
local longComment = start + 2 == Tokens[Index] and parseLongString()
500500
if longComment then
501501
longComment.type = 'comment.long'
502502
longComment.text = longComment[1]
@@ -3640,14 +3640,26 @@ return function (lua, mode, version, options)
36403640
State.ast = parseString()
36413641
elseif mode == 'Number' then
36423642
State.ast = parseNumber()
3643+
elseif mode == 'Name' then
3644+
State.ast = parseName()
36433645
elseif mode == 'Exp' then
36443646
State.ast = parseExp()
36453647
elseif mode == 'Action' then
36463648
State.ast = parseAction()
36473649
end
3650+
36483651
if State.ast then
36493652
State.ast.state = State
36503653
end
36513654

3655+
while true do
3656+
if Index <= #Tokens then
3657+
unknownSymbol()
3658+
Index = Index + 2
3659+
else
3660+
break
3661+
end
3662+
end
3663+
36523664
return State
36533665
end

0 commit comments

Comments
 (0)