diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-05-11 11:32:35 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-05-11 11:32:35 +0800 |
commit | 344309db423700e1c7afd28c0383cc8042aae0ca (patch) | |
tree | 179cb2cca2658e92b4612cc9f5b8f4c03b3ce126 /script/parser | |
parent | acca4a929950cca9a92541733abc4662dc8a3e55 (diff) | |
download | lua-language-server-344309db423700e1c7afd28c0383cc8042aae0ca.zip |
stash
Diffstat (limited to 'script/parser')
-rw-r--r-- | script/parser/guide.lua | 48 |
1 files changed, 4 insertions, 44 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua index f07a966e..048a15bb 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -1,34 +1,8 @@ -local util = require 'utility' local error = error local type = type -local next = next -local tostring = tostring -local print = print -local ipairs = ipairs -local tableInsert = table.insert -local tableUnpack = table.unpack -local tableRemove = table.remove -local tableMove = table.move -local tableSort = table.sort -local tableConcat = table.concat -local mathType = math.type -local pairs = pairs -local setmetatable = setmetatable -local assert = assert -local select = select -local osClock = os.clock -local tonumber = tonumber -local tointeger = math.tointeger -local DEVELOP = _G.DEVELOP -local log = log -local _G = _G ---@class parser.guide.object -local function logWarn(...) - log.warn(...) -end - ---@class guide ---@field debugMode boolean local m = {} @@ -123,20 +97,6 @@ m.actionMap = { ['funcargs'] = {'#'}, } -local TypeSort = { - ['boolean'] = 1, - ['string'] = 2, - ['integer'] = 3, - ['number'] = 4, - ['table'] = 5, - ['function'] = 6, - ['true'] = 101, - ['false'] = 102, - ['nil'] = 999, -} - -local NIL = setmetatable({'<nil>'}, { __tostring = function () return 'nil' end }) - --- 是否是字面量 ---@param obj parser.guide.object ---@return boolean @@ -510,8 +470,8 @@ function m.addChilds(list, obj, map) for i = 1, #keys do local key = keys[i] if key == '#' then - for i = 1, #obj do - list[#list+1] = obj[i] + for j = 1, #obj do + list[#list+1] = obj[j] end elseif obj[key] then list[#list+1] = obj[key] @@ -519,8 +479,8 @@ function m.addChilds(list, obj, map) and key:sub(1, 1) == '#' then key = key:sub(2) if obj[key] then - for i = 1, #obj[key] do - list[#list+1] = obj[key][i] + for j = 1, #obj[key] do + list[#list+1] = obj[key][j] end end end |