diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-09-22 16:37:54 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-09-22 16:37:54 +0800 |
commit | b66a9c9340d63e1a22ba7d5ccad8d9df244240d1 (patch) | |
tree | eb9e132b273e4bd093af132bffa76e046f247ba4 /script | |
parent | b7f7789e46ab8c67d25704be696a1523762b1d80 (diff) | |
download | lua-language-server-b66a9c9340d63e1a22ba7d5ccad8d9df244240d1.zip |
update
Diffstat (limited to 'script')
-rw-r--r-- | script/parser/luadoc.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index 0463d7d2..4a431e68 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -1,7 +1,7 @@ local m = require 'lpeglabel' local re = require 'parser.relabel' local guide = require 'parser.guide' -local grammar = require 'parser.grammar' +local parser = require 'parser.newparser' local TokenTypes, TokenStarts, TokenFinishs, TokenContents local Ci, Offset, pushError, NextComment, Lines @@ -1121,9 +1121,9 @@ local function trimTailComment(text) comment = text:sub(3) end if comment:find '^%s*[\'"[]' then - local result = grammar(nil, comment:gsub('^%s+', ''), 'string') - if result and result[1] then - comment = result[1][1] + local state = parser(comment:gsub('^%s+', ''), 'String') + if state and state.ast then + comment = state.ast[1] end end return comment @@ -1148,7 +1148,7 @@ local function buildLuaDoc(comment) local result = convertTokens() if result then result.range = comment.finish - local cstart = text:find('%S', (result.firstFinish or result.finish) - comment.start + 2) + local cstart = text:find('%S', (result.firstFinish or result.finish) - comment.start) if cstart and cstart < comment.finish then result.comment = { type = 'doc.tailcomment', |