From dd7317a907b88cb102f45535ef19d67b47564c7f 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, 8 Mar 2022 15:16:47 +0800 Subject: update --- script/parser/guide.lua | 8 ++++---- script/parser/luadoc.lua | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'script/parser') diff --git a/script/parser/guide.lua b/script/parser/guide.lua index 1bda2d32..73857149 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -928,7 +928,7 @@ function m.getKeyName(obj) or tp == 'tableindex' then return m.getKeyNameOfLiteral(obj.index) elseif tp == 'tableexp' then - return tostring(obj.tindex) + return obj.tindex elseif tp == 'field' or tp == 'method' or tp == 'doc.see.field' then @@ -938,11 +938,11 @@ function m.getKeyName(obj) elseif tp == 'doc.alias' then return obj.alias[1] elseif tp == 'doc.field' then - return tostring(obj.field[1]) + return obj.field[1] elseif tp == 'doc.field.name' then - return tostring(obj[1]) + return obj[1] elseif tp == 'doc.type.field' then - return tostring(obj.name[1]) + return obj.name[1] elseif tp == 'dummy' then return obj[1] end diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index 5b9bdfad..9b041870 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -224,6 +224,7 @@ local function parseIndexField(tp, parent) return nil end nextToken() + local start = getFinish() - 1 local indexTP, index = peekToken() if indexTP == 'name' then local field = parseType(parent) @@ -233,7 +234,7 @@ local function parseIndexField(tp, parent) nextToken() local class = { type = tp, - start = getStart(), + start = start, finish = getFinish(), parent = parent, } -- cgit v1.2.3