diff options
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 { |