diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-07-06 22:59:21 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-07-06 22:59:21 +0800 |
commit | 5ec199aa6c9119cac7a4e53694eaa7f9273bc58a (patch) | |
tree | afbb6ee15cd80370d2640f9917b31dd7396a964a /script/vm | |
parent | 353caabfce0ee23644d3d74cbcbfcce3fbb32b73 (diff) | |
download | lua-language-server-5ec199aa6c9119cac7a4e53694eaa7f9273bc58a.zip |
support filter of binary operator
Diffstat (limited to 'script/vm')
-rw-r--r-- | script/vm/operator.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/script/vm/operator.lua b/script/vm/operator.lua index e71911f9..9a8e255d 100644 --- a/script/vm/operator.lua +++ b/script/vm/operator.lua @@ -52,6 +52,14 @@ local function checkOperators(operators, op, value, result) or not operator.extends then goto CONTINUE end + if value and operator.exp then + local valueNode = vm.compileNode(value) + local expNode = vm.compileNode(operator.exp) + local uri = guide.getUri(operator) + if not vm.isSubType(uri, valueNode, expNode) then + goto CONTINUE + end + end if not result then result = vm.createNode() end |