diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-07-23 17:05:01 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-07-23 17:05:01 +0800 |
commit | 9dbf2222483d4039c2a0d6efdff3cbdbded79698 (patch) | |
tree | 52fbe39e8529f3a17c0851f64a9ffc02cbf2bd34 /server | |
parent | e026dd59a58f89ec26c1723098b64cf81a537a6f (diff) | |
download | lua-language-server-9dbf2222483d4039c2a0d6efdff3cbdbded79698.zip |
修正语法解析错误
Diffstat (limited to 'server')
-rw-r--r-- | server/src/parser/grammar.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/server/src/parser/grammar.lua b/server/src/parser/grammar.lua index 5a1541ea..4b12c81c 100644 --- a/server/src/parser/grammar.lua +++ b/server/src/parser/grammar.lua @@ -215,7 +215,8 @@ DOTS <- Sp ({} '...') -> DOTS DOT <- Sp ({} '.' !'.') -> DOT COLON <- Sp ({} ':' !':') -> COLON LABEL <- Sp '::' -ASSIGN <- Sp ({} '==' {}) -> ErrAssign +ASSIGN <- Sp '=' !'=' +AssignOrEQ <- Sp ({} '==' {}) -> ErrAssign / Sp '=' Nothing <- {} -> Nothing @@ -457,7 +458,7 @@ LoopBody <- FOR LoopStart LoopFinish LoopStep NeedDo (Emmy / !END Action)* BreakEnd NeedEnd -LoopStart <- MustName ASSIGN DirtyExp +LoopStart <- MustName AssignOrEQ DirtyExp LoopFinish <- NeedComma DirtyExp LoopStep <- COMMA DirtyExp / NeedComma Exp @@ -492,9 +493,9 @@ RepeatBody <- REPEAT LocalTag <- (Sp '<' Sp MustName Sp LocalTagEnd)* -> LocalTag LocalTagEnd <- '>' / {} -> MissGT -Local <- (LOCAL LocalTag NameList (ASSIGN ExpList)?) +Local <- (LOCAL LocalTag NameList (AssignOrEQ ExpList)?) -> Local -Set <- (SimpleList ASSIGN ExpList?) +Set <- (SimpleList AssignOrEQ ExpList?) -> Set Call <- Simple |