From c226b214cbbf23a39ec3a065c9cadc5e17acd883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 10 Nov 2020 18:12:16 +0800 Subject: =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-beta/parser/luadoc.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'script-beta/parser') 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 { -- cgit v1.2.3