diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-07-06 23:34:54 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-07-06 23:34:54 +0800 |
commit | 79cc877095745be377b9dd189ee5e38cf35a3c5e (patch) | |
tree | 9e5f0e07741c8c5022d08672fef2ba137e352703 /script/vm/operator.lua | |
parent | 27dcfa8d1463936d0b2514cd82eebe1910ab3bb7 (diff) | |
download | lua-language-server-79cc877095745be377b9dd189ee5e38cf35a3c5e.zip |
semantic and completion description
Diffstat (limited to 'script/vm/operator.lua')
-rw-r--r-- | script/vm/operator.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/script/vm/operator.lua b/script/vm/operator.lua index 9a8e255d..35910f94 100644 --- a/script/vm/operator.lua +++ b/script/vm/operator.lua @@ -25,6 +25,12 @@ vm.BINARY_OP = { 'concat', } +local unaryMap = { + ['-'] = 'unm', + ['~'] = 'bnot', + ['#'] = 'len', +} + local binaryMap = { ['+'] = 'add', ['-'] = 'sub', @@ -41,6 +47,9 @@ local binaryMap = { ['..'] = 'concat', } +vm.UNARY_MAP = util.revertMap(unaryMap) +vm.BINARY_MAP = util.revertMap(binaryMap) + ---@param operators parser.object[] ---@param op string ---@param value? parser.object |