diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-04-07 02:38:16 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-04-07 02:38:16 +0800 |
commit | e9975c2081dfe2f42392a7612b2a3862e513e45e (patch) | |
tree | 630e9e8ae9fb085e46771f807bcaa41ae038004b /script/parser/luadoc.lua | |
parent | 3e2948e1480659d7c29f9d701e378330c08b238f (diff) | |
download | lua-language-server-e9975c2081dfe2f42392a7612b2a3862e513e45e.zip |
doc.type.boolean
Diffstat (limited to 'script/parser/luadoc.lua')
-rw-r--r-- | script/parser/luadoc.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index 4dbece5a..4d9de5be 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -578,11 +578,31 @@ local function parseInteger(parent) return integer end +local function parseBoolean(parent) + local tp, content = peekToken() + if not tp + or tp ~= 'name' + or (content ~= 'true' and content ~= 'false') then + return nil + end + + nextToken() + local boolean = { + type = 'doc.type.boolean', + start = getStart(), + finish = getFinish(), + parent = parent, + [1] = content == 'true' and true or false, + } + return boolean +end + function parseTypeUnit(parent) local result = parseFunction(parent) or parseTable(parent) or parseString(parent) or parseInteger(parent) + or parseBoolean(parent) or parseDots('doc.type.name', parent) if not result then local literal = checkToken('symbol', '`', 1) |