diff options
Diffstat (limited to 'script')
-rw-r--r-- | script/config/template.lua | 3 | ||||
-rw-r--r-- | script/parser/compile.lua | 9 | ||||
-rw-r--r-- | script/parser/tokens.lua | 12 |
3 files changed, 21 insertions, 3 deletions
diff --git a/script/config/template.lua b/script/config/template.lua index 3d5bad3d..2f5ff005 100644 --- a/script/config/template.lua +++ b/script/config/template.lua @@ -209,7 +209,8 @@ local template = { ['Lua.runtime.nonstandardSymbol'] = Type.Array(Type.String << { '//', '/**/', '`', - '+=', '-=', '*=', '/=', + '+=', '-=', '*=', '/=', '%=', '^=', '//=', + '|=', '&=', '<<=', '>>=', '||', '&&', '!', '!=', 'continue', }), diff --git a/script/parser/compile.lua b/script/parser/compile.lua index ee35a924..1e4165ff 100644 --- a/script/parser/compile.lua +++ b/script/parser/compile.lua @@ -612,7 +612,14 @@ local function expectAssign(isAction) if token == '+=' or token == '-=' or token == '*=' - or token == '/=' then + or token == '/=' + or token == '%=' + or token == '^=' + or token == '//=' + or token == '|=' + or token == '&=' + or token == '>>=' + or token == '<<=' then if not State.options.nonstandardSymbol[token] then unknownSymbol() end diff --git a/script/parser/tokens.lua b/script/parser/tokens.lua index 958f292e..a4de7f88 100644 --- a/script/parser/tokens.lua +++ b/script/parser/tokens.lua @@ -7,6 +7,11 @@ local Word = m.R('AZ', 'az', '__', '\x80\xff') * m.R('AZ', 'az', '09', '__', ' local Symbol = m.P'==' + m.P'~=' + m.P'--' + -- non-standard: + + m.P'<<=' + + m.P'>>=' + + m.P'//=' + -- end non-standard + m.P'<<' + m.P'>>' + m.P'<=' @@ -15,7 +20,7 @@ local Symbol = m.P'==' + m.P'...' + m.P'..' + m.P'::' - -- incorrect + -- non-standard: + m.P'!=' + m.P'&&' + m.P'||' @@ -24,7 +29,12 @@ local Symbol = m.P'==' + m.P'+=' + m.P'-=' + m.P'*=' + + m.P'%=' + + m.P'&=' + + m.P'|=' + + m.P'^=' + m.P'/=' + -- end non-standard -- singles + m.S'+-*/!#%^&()={}[]|\\\'":;<>,.?~`' local Unknown = (1 - Number - Word - Symbol - Sp - Nl)^1 |