diff options
Diffstat (limited to 'script/parser')
-rw-r--r-- | script/parser/compile.lua | 2 | ||||
-rw-r--r-- | script/parser/guide.lua | 2 | ||||
-rw-r--r-- | script/parser/luadoc.lua | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/script/parser/compile.lua b/script/parser/compile.lua index 20546e4a..cc142dfa 100644 --- a/script/parser/compile.lua +++ b/script/parser/compile.lua @@ -1024,7 +1024,7 @@ local function parseShortString() fastForwardToken(currentOffset) local right = getPosition(currentOffset - 1, 'right') local byte = tointeger(numbers) - if byte <= 255 then + if byte and byte <= 255 then stringIndex = stringIndex + 1 stringPool[stringIndex] = schar(byte) else diff --git a/script/parser/guide.lua b/script/parser/guide.lua index 969eb386..56239fb1 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -240,7 +240,7 @@ local function formatNumber(n) end --- 是否是字面量 ----@param obj parser.object +---@param obj table ---@return boolean function m.isLiteral(obj) local tp = obj.type diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index 847b7d37..fdf7718c 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -1273,8 +1273,7 @@ local docSwitch = util.switch() if checkToken('symbol', '?', 1) then block.optional = true nextToken() - block.start = block.start or getStart() - block.finish = block.finish + block.finish = getFinish() else block.extends = parseType(block) if block.extends then @@ -1286,6 +1285,7 @@ local docSwitch = util.switch() if block.optional or block.extends then result.casts[#result.casts+1] = block end + result.finish = block.finish if checkToken('symbol', ',', 1) then nextToken() |