diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-10 18:12:16 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-10 18:12:16 +0800 |
commit | c226b214cbbf23a39ec3a065c9cadc5e17acd883 (patch) | |
tree | 61928d7d14eb8cb50cf04498df5865a023052357 /script-beta/parser | |
parent | b1f2b789ac1271f2a270253a086bae377bbb14cb (diff) | |
download | lua-language-server-c226b214cbbf23a39ec3a065c9cadc5e17acd883.zip |
暂存
Diffstat (limited to 'script-beta/parser')
-rw-r--r-- | script-beta/parser/luadoc.lua | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/script-beta/parser/luadoc.lua b/script-beta/parser/luadoc.lua index 05dfcbe6..6cdd7491 100644 --- a/script-beta/parser/luadoc.lua +++ b/script-beta/parser/luadoc.lua @@ -4,7 +4,7 @@ local lines = require 'parser.lines' local guide = require 'parser.guide' local TokenTypes, TokenStarts, TokenFinishs, TokenContents -local Ci, Offset, pushError +local Ci, Offset, pushError, Ct local parseType local Parser = re.compile([[ Main <- (Token / Sp)* @@ -111,7 +111,12 @@ Symbol <- ({} { end, }) +local function trim(str) + return str:match '^%s*(%S+)%s*$' +end + local function parseTokens(text, offset) + Ct = offset Ci = 0 Offset = offset TokenTypes = {} @@ -629,6 +634,12 @@ local function parseResume() local result = { type = 'doc.resume' } + + if checkToken('symbol', '>', 1) then + nextToken() + result.default = true + end + local tp = peekToken() if tp ~= 'string' then pushError { |