diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-07-29 16:35:51 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-07-29 16:35:51 +0800 |
commit | 5f17d7f521273a1d085ba025071f6687056e3660 (patch) | |
tree | cbb290fb79de95358fc6ec41be0c43d76b4acb78 | |
parent | efb8e40a5dcad11c80a2573a52032b8f64ab2580 (diff) | |
download | lua-language-server-5f17d7f521273a1d085ba025071f6687056e3660.zip |
fix #68 优化大table的解析
-rw-r--r-- | server/main.lua | 2 | ||||
-rw-r--r-- | server/src/parser/ast.lua | 4 | ||||
-rw-r--r-- | server/src/parser/grammar.lua | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/server/main.lua b/server/main.lua index 9ba8fc92..61f17f2f 100644 --- a/server/main.lua +++ b/server/main.lua @@ -22,7 +22,7 @@ log.info('Lua Lsp startup, root: ', ROOT) log.debug('ROOT:', ROOT:string()) ac = {} -xpcall(dofile, log.debug, rootPath .. 'debugger.lua') +--xpcall(dofile, log.debug, rootPath .. 'debugger.lua') require 'utility' require 'global_protect' local service = require 'service' diff --git a/server/src/parser/ast.lua b/server/src/parser/ast.lua index 019cbb5c..a83f5abf 100644 --- a/server/src/parser/ast.lua +++ b/server/src/parser/ast.lua @@ -751,7 +751,7 @@ local Defs = { checkMissEnd(start) return obj end, - Table = function (start, ...) + RTTable = function (_, _, start, ...) local args = {...} local max = #args local finish = args[max] - 1 @@ -790,7 +790,7 @@ local Defs = { start = arg end end - return table + return true, table end, NewField = function (key, value) return { diff --git a/server/src/parser/grammar.lua b/server/src/parser/grammar.lua index 4b12c81c..a923e5eb 100644 --- a/server/src/parser/grammar.lua +++ b/server/src/parser/grammar.lua @@ -346,7 +346,7 @@ ArgList <- (DOTS -> DotsAsArg / Name / Sp {} COMMA)* -> ArgList Table <- Sp ({} TL TableFields? DirtyTR) - -> Table + => RTTable TableFields <- (Emmy / TableSep {} / TableField)+ TableSep <- COMMA / SEMICOLON TableField <- NewIndex / NewField / Exp |