diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-28 03:08:24 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-28 03:08:24 +0800 |
commit | ae024958da9a14ed837495f79972a85458ee3f0c (patch) | |
tree | 98acf3e1bdfa552ed266a2033e22ead1a9c044bd /script/parser/compile.lua | |
parent | f3019c63409b7bdadb0b7ecedfd3b90a0b29397b (diff) | |
download | lua-language-server-ae024958da9a14ed837495f79972a85458ee3f0c.zip |
fix diags
Diffstat (limited to 'script/parser/compile.lua')
-rw-r--r-- | script/parser/compile.lua | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/script/parser/compile.lua b/script/parser/compile.lua index 9db46241..ac599030 100644 --- a/script/parser/compile.lua +++ b/script/parser/compile.lua @@ -269,14 +269,13 @@ end ---@return string word ---@return parser.position startPosition ---@return parser.position finishPosition ----@return integer newOffset local function peekWord() local word = Tokens[Index + 1] if not word then - return nil + return nil, nil, nil end if not CharMapWord[ssub(word, 1, 1)] then - return nil + return nil, nil, nil end local startPos = getPosition(Tokens[Index] , 'left') local finishPos = getPosition(Tokens[Index] + #word - 1, 'right') @@ -2598,29 +2597,29 @@ local function parseSetValues() skipSpace() local first = parseExp() if not first then - return nil + return nil, nil, nil end skipSpace() if Tokens[Index + 1] ~= ',' then - return first + return first, nil, nil end Index = Index + 2 skipSeps() local second = parseExp() if not second then missExp() - return first + return first, nil, nil end skipSpace() if Tokens[Index + 1] ~= ',' then - return first, second + return first, second, nil end Index = Index + 2 skipSeps() local third = parseExp() if not third then missExp() - return first, second + return first, second, nil end local rest = { third } @@ -2652,14 +2651,14 @@ end ---@return parser.object[] rest local function parseVarTails(parser, isLocal) if Tokens[Index + 1] ~= ',' then - return + return nil, nil end Index = Index + 2 skipSpace() local second = parser(true) if not second then missName() - return + return nil, nil end if isLocal then createLocal(second, parseLocalAttrs()) @@ -2667,14 +2666,14 @@ local function parseVarTails(parser, isLocal) end skipSpace() if Tokens[Index + 1] ~= ',' then - return second + return second, nil end Index = Index + 2 skipSeps() local third = parser(true) if not third then missName() - return second + return second, nil end if isLocal then createLocal(third, parseLocalAttrs()) |