summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-12-22 17:30:18 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-12-22 17:30:18 +0800
commiteb3d39eaedce44c8e4e25cf03494b32e874f3ca9 (patch)
treef299fe01c4eb988d46b79eb63d8c4339bd91a8dd /script/parser
parenta22f5fd46af72f505040cc1422faeb20fce8632d (diff)
downloadlua-language-server-eb3d39eaedce44c8e4e25cf03494b32e874f3ca9.zip
close #317 #282
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/ast.lua66
1 files changed, 36 insertions, 30 deletions
diff --git a/script/parser/ast.lua b/script/parser/ast.lua
index 75cc779a..127bb08c 100644
--- a/script/parser/ast.lua
+++ b/script/parser/ast.lua
@@ -693,23 +693,26 @@ local Defs = {
end,
BinaryOp = function (start, op)
if SymbolAlias[op] then
- PushError {
- type = 'ERR_NONSTANDARD_SYMBOL',
- start = start,
- finish = start + #op - 1,
- info = {
- symbol = SymbolAlias[op],
- },
- fix = {
- title = 'FIX_NONSTANDARD_SYMBOL',
- symbol = SymbolAlias[op],
- {
- start = start,
- finish = start + #op - 1,
- text = SymbolAlias[op],
+ if State.options.nonstandardSymbol and State.options.nonstandardSymbol[op] then
+ else
+ PushError {
+ type = 'ERR_NONSTANDARD_SYMBOL',
+ start = start,
+ finish = start + #op - 1,
+ info = {
+ symbol = SymbolAlias[op],
},
+ fix = {
+ title = 'FIX_NONSTANDARD_SYMBOL',
+ symbol = SymbolAlias[op],
+ {
+ start = start,
+ finish = start + #op - 1,
+ text = SymbolAlias[op],
+ },
+ }
}
- }
+ end
op = SymbolAlias[op]
end
return {
@@ -720,23 +723,26 @@ local Defs = {
end,
UnaryOp = function (start, op)
if SymbolAlias[op] then
- PushError {
- type = 'ERR_NONSTANDARD_SYMBOL',
- start = start,
- finish = start + #op - 1,
- info = {
- symbol = SymbolAlias[op],
- },
- fix = {
- title = 'FIX_NONSTANDARD_SYMBOL',
- symbol = SymbolAlias[op],
- {
- start = start,
- finish = start + #op - 1,
- text = SymbolAlias[op],
+ if State.options.nonstandardSymbol and State.options.nonstandardSymbol[op] then
+ else
+ PushError {
+ type = 'ERR_NONSTANDARD_SYMBOL',
+ start = start,
+ finish = start + #op - 1,
+ info = {
+ symbol = SymbolAlias[op],
},
+ fix = {
+ title = 'FIX_NONSTANDARD_SYMBOL',
+ symbol = SymbolAlias[op],
+ {
+ start = start,
+ finish = start + #op - 1,
+ text = SymbolAlias[op],
+ },
+ }
}
- }
+ end
op = SymbolAlias[op]
end
return {