diff options
Diffstat (limited to 'script/parser')
-rw-r--r-- | script/parser/guide.lua | 1 | ||||
-rw-r--r-- | script/parser/newparser.lua | 16 |
2 files changed, 9 insertions, 8 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua index cea56be8..28a275cf 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -54,6 +54,7 @@ local type = type ---@field ref parser.guide.object[] ---@field returnIndex integer ---@field docs parser.guide.object[] +---@field state table ---@field _root parser.guide.object ---@field _noders noders ---@field _mnode parser.guide.object diff --git a/script/parser/newparser.lua b/script/parser/newparser.lua index ba91cd10..957d98e8 100644 --- a/script/parser/newparser.lua +++ b/script/parser/newparser.lua @@ -416,11 +416,11 @@ local function parseLongString() fastForwardToken(finish + 1) local startPos = getPosition(start, 'left') local finishMark = sgsub(mark, '%[', ']') - local stringResult, finishOffset = resolveLongString(finishMark) + local stringResult, finishPos = resolveLongString(finishMark) return { type = 'string', start = startPos, - finish = getPosition(finishOffset, 'right'), + finish = finishPos, [1] = stringResult, [2] = mark, } @@ -1430,14 +1430,14 @@ local function parseExpList(mini) end local function parseIndex() - local bstart = getPosition(Tokens[Index], 'left') + local start = getPosition(Tokens[Index], 'left') Index = Index + 2 skipSpace() local exp = parseExp() local index = { type = 'index', - start = bstart, - finish = exp and exp.finish or (bstart + 1), + start = start, + finish = exp and exp.finish or (start + 1), index = exp } if exp then @@ -1764,9 +1764,9 @@ local function parseSimple(node, funcName) node.parent = call node = call else - local index = parseIndex() + local index = parseIndex() + local bstart = index.start index.type = 'getindex' - index.bstart = index.start index.start = node.start index.node = node node.next = index @@ -1775,7 +1775,7 @@ local function parseSimple(node, funcName) if funcName then pushError { type = 'INDEX_IN_FUNC_NAME', - start = index.bstart, + start = bstart, finish = index.finish, } end |