summaryrefslogtreecommitdiff
path: root/server/src/method/workspace/executeCommand.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/method/workspace/executeCommand.lua')
-rw-r--r--server/src/method/workspace/executeCommand.lua17
1 files changed, 16 insertions, 1 deletions
diff --git a/server/src/method/workspace/executeCommand.lua b/server/src/method/workspace/executeCommand.lua
index 9b234fc1..6ae407ae 100644
--- a/server/src/method/workspace/executeCommand.lua
+++ b/server/src/method/workspace/executeCommand.lua
@@ -123,6 +123,21 @@ function command.removeSpace(lsp, data)
})
end
+local opMap = {
+ ['+'] = true,
+ ['-'] = true,
+ ['*'] = true,
+ ['/'] = true,
+ ['//'] = true,
+ ['^'] = true,
+ ['<<'] = true,
+ ['>>'] = true,
+ ['&'] = true,
+ ['|'] = true,
+ ['~'] = true,
+ ['..'] = true,
+}
+
function command.solve(lsp, data)
local uri = data.uri
local vm, lines = lsp:getVM(uri)
@@ -144,7 +159,7 @@ function command.solve(lsp, data)
local y = x % 2 + 1
local exp = source[x]
local other = source[y]
- if exp.op and not other.op then
+ if opMap[exp.op] and not opMap[other.op] then
if x == 1 then
-- (a + b) or c --> a + (b or c)
return {