diff options
-rw-r--r-- | server/src/core/diagnostics.lua | 2 | ||||
-rw-r--r-- | server/src/parser/ast.lua | 1 | ||||
-rw-r--r-- | server/test/diagnostics/init.lua | 10 |
3 files changed, 13 insertions, 0 deletions
diff --git a/server/src/core/diagnostics.lua b/server/src/core/diagnostics.lua index c99f6e87..3b11b818 100644 --- a/server/src/core/diagnostics.lua +++ b/server/src/core/diagnostics.lua @@ -354,6 +354,7 @@ function mt:searchAmbiguity1(callback) and first.type ~= 'unary' and not second.op and literalMap[second.type] + and not first.brackets then callback(source.start, source.finish, first.start, first.finish) end @@ -364,6 +365,7 @@ function mt:searchAmbiguity1(callback) and second.type ~= 'unary' and not first.op and literalMap[second[1].type] + and not second.brackets then callback(source.start, source.finish, second.start, second.finish) end diff --git a/server/src/parser/ast.lua b/server/src/parser/ast.lua index 0eb17a80..3a91e42a 100644 --- a/server/src/parser/ast.lua +++ b/server/src/parser/ast.lua @@ -627,6 +627,7 @@ local Defs = { return expSplit(list, 1, #list, 1) end, Prefix = function (start, exp, finish) + exp.brackets = true return exp end, Index = function (start, exp, finish) diff --git a/server/test/diagnostics/init.lua b/server/test/diagnostics/init.lua index 666d72dc..ec0b76ba 100644 --- a/server/test/diagnostics/init.lua +++ b/server/test/diagnostics/init.lua @@ -554,6 +554,16 @@ local x x = x or -1 ]] +TEST [[ +local x +x = x or (0 + 1) +]] + +TEST [[ +local x, y +x = (x + y) or 0 +]] + --TEST [[ --local t = {} --function t:<!a!>() |