summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-12-22 16:55:39 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-12-22 16:55:39 +0800
commita22f5fd46af72f505040cc1422faeb20fce8632d (patch)
treea4f1b1f193d1fe2efb58a7b0591c2a8762d96df2 /script
parent6caedbce008b6e79a1f21ad261dd6329bdb64acb (diff)
downloadlua-language-server-a22f5fd46af72f505040cc1422faeb20fce8632d.zip
#317
Diffstat (limited to 'script')
-rw-r--r--script/parser/ast.lua13
-rw-r--r--script/parser/grammar.lua4
2 files changed, 16 insertions, 1 deletions
diff --git a/script/parser/ast.lua b/script/parser/ast.lua
index 1f697ca4..75cc779a 100644
--- a/script/parser/ast.lua
+++ b/script/parser/ast.lua
@@ -945,6 +945,19 @@ local Defs = {
finish = start,
}
end,
+ ASSIGN = function (start, symbol)
+ if State.options.nonstandardSymbol and State.options.nonstandardSymbol[symbol] then
+ else
+ PushError {
+ type = 'UNSUPPORT_SYMBOL',
+ start = start,
+ finish = start + #symbol - 1,
+ info = {
+ version = 'Lua',
+ }
+ }
+ end
+ end,
DOT = function (start)
return {
type = '.',
diff --git a/script/parser/grammar.lua b/script/parser/grammar.lua
index 1c70dfcd..f222a283 100644
--- a/script/parser/grammar.lua
+++ b/script/parser/grammar.lua
@@ -222,9 +222,11 @@ COLON <- Sp ({} ':' !':')
-> COLON
LABEL <- Sp '::'
ASSIGN <- Sp '=' !'='
+ / Sp ({} {'+=' / '-=' / '*=' / '\='})
+ -> ASSIGN
AssignOrEQ <- Sp ({} '==' {})
-> ErrAssign
- / Sp '='
+ / ASSIGN
DirtyBR <- BR / {} -> MissBR
DirtyTR <- TR / {} -> MissTR