diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-05-29 14:39:39 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-05-29 14:39:39 +0800 |
commit | 532e77ce9965c7aebd02c906297990ad48a19449 (patch) | |
tree | 7f3b49431b7d4c6d60f9b7713ce64e5cf289c4ae /script-beta/parser/grammar.lua | |
parent | ed00357938749970aede0161944ce76c1c6bb983 (diff) | |
download | lua-language-server-532e77ce9965c7aebd02c906297990ad48a19449.zip |
更新 parser
Diffstat (limited to 'script-beta/parser/grammar.lua')
-rw-r--r-- | script-beta/parser/grammar.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/script-beta/parser/grammar.lua b/script-beta/parser/grammar.lua index fd699bd4..292f0e52 100644 --- a/script-beta/parser/grammar.lua +++ b/script-beta/parser/grammar.lua @@ -372,14 +372,17 @@ Function <- FunctionBody -> Function FuncArgs <- Sp ({} PL {| FuncArg+ |} DirtyPR {}) -> FuncArgs - / PL DirtyPR %nil - / {} -> MissPL DirtyPR %nil + / PL DirtyPR %nil +FuncArgsMiss<- {} -> MissPL DirtyPR %nil FuncArg <- DOTS / Name / COMMA FunctionBody<- FUNCTION FuncArgs {| (!END Action)* |} NeedEnd + / FUNCTION FuncArgsMiss + {| %nil |} + NeedEnd -- 纯占位,修改了 `relabel.lua` 使重复定义不抛错 Action <- !END . @@ -511,6 +514,9 @@ FunctionNamedBody <- FUNCTION FuncName FuncArgs {| (!END Action)* |} NeedEnd + / FUNCTION FuncName FuncArgsMiss + {| %nil |} + NeedEnd FuncName <- {| Single (Sp SuffixWithoutCall)* |} -> Simple / {} -> MissName %nil |