summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/en-us/config.md7
-rw-r--r--doc/pt-br/config.md7
-rw-r--r--doc/zh-cn/config.md7
-rw-r--r--doc/zh-tw/config.md7
-rw-r--r--script/config/template.lua3
-rw-r--r--script/parser/compile.lua9
-rw-r--r--script/parser/tokens.lua12
7 files changed, 49 insertions, 3 deletions
diff --git a/doc/en-us/config.md b/doc/en-us/config.md
index 7317271d..6ab5a012 100644
--- a/doc/en-us/config.md
+++ b/doc/en-us/config.md
@@ -1216,6 +1216,13 @@ Array<string>
* ``"-="``
* ``"*="``
* ``"/="``
+* ``"%="``
+* ``"^="``
+* ``"//="``
+* ``"|="``
+* ``"&="``
+* ``"<<="``
+* ``">>="``
* ``"||"``
* ``"&&"``
* ``"!"``
diff --git a/doc/pt-br/config.md b/doc/pt-br/config.md
index 9cbefc2b..dfe69559 100644
--- a/doc/pt-br/config.md
+++ b/doc/pt-br/config.md
@@ -1216,6 +1216,13 @@ Array<string>
* ``"-="``
* ``"*="``
* ``"/="``
+* ``"%="``
+* ``"^="``
+* ``"//="``
+* ``"|="``
+* ``"&="``
+* ``"<<="``
+* ``">>="``
* ``"||"``
* ``"&&"``
* ``"!"``
diff --git a/doc/zh-cn/config.md b/doc/zh-cn/config.md
index cbf12bb1..d66bc17d 100644
--- a/doc/zh-cn/config.md
+++ b/doc/zh-cn/config.md
@@ -1215,6 +1215,13 @@ Array<string>
* ``"-="``
* ``"*="``
* ``"/="``
+* ``"%="``
+* ``"^="``
+* ``"//="``
+* ``"|="``
+* ``"&="``
+* ``"<<="``
+* ``">>="``
* ``"||"``
* ``"&&"``
* ``"!"``
diff --git a/doc/zh-tw/config.md b/doc/zh-tw/config.md
index 6d0325b9..bd2dc4fb 100644
--- a/doc/zh-tw/config.md
+++ b/doc/zh-tw/config.md
@@ -1215,6 +1215,13 @@ Array<string>
* ``"-="``
* ``"*="``
* ``"/="``
+* ``"%="``
+* ``"^="``
+* ``"//="``
+* ``"|="``
+* ``"&="``
+* ``"<<="``
+* ``">>="``
* ``"||"``
* ``"&&"``
* ``"!"``
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