diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-07-06 23:49:28 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-07-06 23:49:28 +0800 |
commit | a19a1f4f077830014dd2d2c378988e7770be2be1 (patch) | |
tree | 137f0455d0648c425b96004a236c074f30ad1340 /script/vm/operator.lua | |
parent | 79cc877095745be377b9dd189ee5e38cf35a3c5e (diff) | |
download | lua-language-server-a19a1f4f077830014dd2d2c378988e7770be2be1.zip |
support `call`
Diffstat (limited to 'script/vm/operator.lua')
-rw-r--r-- | script/vm/operator.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/script/vm/operator.lua b/script/vm/operator.lua index 35910f94..69340648 100644 --- a/script/vm/operator.lua +++ b/script/vm/operator.lua @@ -24,6 +24,9 @@ vm.BINARY_OP = { 'shr', 'concat', } +vm.OTHER_OP = { + 'call', +} local unaryMap = { ['-'] = 'unm', @@ -47,8 +50,13 @@ local binaryMap = { ['..'] = 'concat', } -vm.UNARY_MAP = util.revertMap(unaryMap) -vm.BINARY_MAP = util.revertMap(binaryMap) +local otherMap = { + ['()'] = 'call', +} + +vm.OP_UNARY_MAP = util.revertMap(unaryMap) +vm.OP_BINARY_MAP = util.revertMap(binaryMap) +vm.OP_OTHER_MAP = util.revertMap(otherMap) ---@param operators parser.object[] ---@param op string |