diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-12-22 17:30:18 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-12-22 17:30:18 +0800 |
commit | eb3d39eaedce44c8e4e25cf03494b32e874f3ca9 (patch) | |
tree | f299fe01c4eb988d46b79eb63d8c4339bd91a8dd /script/parser | |
parent | a22f5fd46af72f505040cc1422faeb20fce8632d (diff) | |
download | lua-language-server-eb3d39eaedce44c8e4e25cf03494b32e874f3ca9.zip |
close #317 #282
Diffstat (limited to 'script/parser')
-rw-r--r-- | script/parser/ast.lua | 66 |
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 { |