summaryrefslogtreecommitdiff
path: root/script/vm/node.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-03-10 17:12:49 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-03-10 17:12:49 +0800
commit2178706a33e6f15a8cea567c352d9a567c38abb9 (patch)
tree36bad9d0e3f3ff6feb03ca2266060dcd89f94b1e /script/vm/node.lua
parent75df2fd38fe75e951ea80b5f1abae8772437ae04 (diff)
downloadlua-language-server-2178706a33e6f15a8cea567c352d9a567c38abb9.zip
update
Diffstat (limited to 'script/vm/node.lua')
-rw-r--r--script/vm/node.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/script/vm/node.lua b/script/vm/node.lua
index f9dbdf3e..a3cfb819 100644
--- a/script/vm/node.lua
+++ b/script/vm/node.lua
@@ -38,6 +38,15 @@ function m.setNode(source, node)
m.nodeCache[source] = m.mergeNode(me, node)
end
+---@param node vm.node
+---@return vm.node.union
+function m.setFalsy(node)
+ if node.type ~= 'union' then
+ node = union(node)
+ end
+ return node
+end
+
---@return fun():vm.node
function m.eachNode(node)
if not node then