diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-03-05 12:03:07 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-03-05 12:03:07 +0800 |
commit | 45cd0bfd3f5bad6aba13297e6558783356486ec4 (patch) | |
tree | 208d57899fe7fab9158df8281337c082567cfcd7 /script | |
parent | 4afa5143c629ae37cb64742b4c55e88feaadafb9 (diff) | |
download | lua-language-server-45cd0bfd3f5bad6aba13297e6558783356486ec4.zip |
missed syntax error `local a <const>= 1`
Diffstat (limited to 'script')
-rw-r--r-- | script/parser/ast.lua | 15 | ||||
-rw-r--r-- | script/parser/grammar.lua | 4 |
2 files changed, 18 insertions, 1 deletions
diff --git a/script/parser/ast.lua b/script/parser/ast.lua index 13e95606..07169a9a 100644 --- a/script/parser/ast.lua +++ b/script/parser/ast.lua @@ -1889,6 +1889,21 @@ local Defs = { } return start, finish end, + MissSpaceBetween = function (start) + PushError { + type = 'MISS_SPACE_BETWEEN', + start = start, + finish = start + 1, + fix = { + title = 'FIX_INSERT_SPACE', + { + start = start + 1, + finish = start, + text = ' ', + } + } + } + end } local function init(state) diff --git a/script/parser/grammar.lua b/script/parser/grammar.lua index 48a28ac0..c7ae13c0 100644 --- a/script/parser/grammar.lua +++ b/script/parser/grammar.lua @@ -505,7 +505,9 @@ RepeatBody <- REPEAT LocalAttr <- {| (Sp '<' Sp MustName Sp LocalAttrEnd)+ |} -> LocalAttr -LocalAttrEnd<- '>' / {} -> MissGT +LocalAttrEnd<- ({} '>' &'=') -> MissSpaceBetween + / '>' + / {} -> MissGT Local <- Sp ({} LOCAL LocalNameList ((AssignOrEQ ExpList) / %nil) {}) -> Local Set <- Sp ({} SimpleList AssignOrEQ {} ExpList {}) |