diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-09-15 16:11:30 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-09-15 16:11:30 +0800 |
commit | 8880b7d63931469c0b7bfb69004f342236ce2811 (patch) | |
tree | b9577858f20755d593ecf08dad5e2cd5e46559db /script/parser/newparser.lua | |
parent | 6fddbbf0b34729327670ac1687d88b38739e12a9 (diff) | |
download | lua-language-server-8880b7d63931469c0b7bfb69004f342236ce2811.zip |
cleanup
Diffstat (limited to 'script/parser/newparser.lua')
-rw-r--r-- | script/parser/newparser.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/script/parser/newparser.lua b/script/parser/newparser.lua index 16bcd6a0..0137397d 100644 --- a/script/parser/newparser.lua +++ b/script/parser/newparser.lua @@ -361,6 +361,7 @@ local function skipNL() Line = Line + 1 LineOffset = Tokens[Index] + #token Index = Index + 2 + State.lines[Line] = LineOffset return true end return false @@ -392,8 +393,11 @@ local function resolveLongString(finishMark) local result, count = stringResult : gsub('\r\n', '\n') : gsub('[\r\n]', '\n') - Line = Line + count LineOffset = lastLN + start + for i = Line + 1, Line + count do + State.lines[i] = LineOffset + end + Line = Line + count stringResult = result end fastForwardToken(finishOffset + #finishMark) @@ -3503,6 +3507,7 @@ local function initState(lua, version, options) errs = {}, diags = {}, comms = {}, + lines = {}, options = options or {}, } if version == 'Lua 5.1' or version == 'LuaJIT' then |