summaryrefslogtreecommitdiff
path: root/script/vm/infer.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-03-31 20:17:15 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-03-31 20:17:15 +0800
commit3e516dd717440cad6fce8731a2b627abc6335bbb (patch)
tree39697f19197678af0a8ec6076faa80af01a911f3 /script/vm/infer.lua
parent19e1709f0d53975fa0e752cb64c0c47e3c48bedf (diff)
downloadlua-language-server-3e516dd717440cad6fce8731a2b627abc6335bbb.zip
cleanup
Diffstat (limited to 'script/vm/infer.lua')
-rw-r--r--script/vm/infer.lua7
1 files changed, 2 insertions, 5 deletions
diff --git a/script/vm/infer.lua b/script/vm/infer.lua
index 5ac7d73b..6457696a 100644
--- a/script/vm/infer.lua
+++ b/script/vm/infer.lua
@@ -17,7 +17,7 @@ local inferSorted = {
['nil'] = 100,
}
-local viewNodeMap = util.switch()
+local viewNodeSwitch = util.switch()
: case 'nil'
: case 'boolean'
: case 'string'
@@ -112,14 +112,11 @@ local viewNodeMap = util.switch()
end
return ('fun(%s)%s'):format(argView, regView)
end)
- : getMap()
---@param node vm.node
---@return string?
local function viewNode(node, options)
- if viewNodeMap[node.type] then
- return viewNodeMap[node.type](node, options)
- end
+ return viewNodeSwitch(node.type, node, options)
end
local function eraseAlias(node, viewMap, options)