diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-10-11 13:46:55 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-10-11 13:46:55 +0800 |
commit | 16af212c379e9927143b37bedebcf884445bfdbd (patch) | |
tree | 14d3081d3c719b63a750d283738a3ec1e5b3085e /src/parser | |
parent | 6ca08827d3e4e509841ffad2a57f179348ef65c6 (diff) | |
download | lua-language-server-16af212c379e9927143b37bedebcf884445bfdbd.zip |
until
Diffstat (limited to 'src/parser')
-rw-r--r-- | src/parser/grammar.lua | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/parser/grammar.lua b/src/parser/grammar.lua index e95d2d7f..a4240df2 100644 --- a/src/parser/grammar.lua +++ b/src/parser/grammar.lua @@ -251,6 +251,8 @@ grammar 'Action' [[ Action <- SEMICOLON / Do / Break / Return / Label / GoTo / If / For / While / Repeat / Set / Local / Function / Call ExpList <- Exp (COMMA Exp)* +NameList <- (Name (COMMA Name)*) -> NameList +SimpleList <- (Simple (COMMA Simple)*) -> SimpleList Do <- DO -> DoDef (!END Action)* -> Do @@ -284,26 +286,25 @@ LoopStart <- (Name ASSIGN Exp) -> LoopStart LoopFinish <- COMMA Exp LoopStep <- COMMA Exp -In <- (FOR InList IN ExpList DO) -> InDef - (!END Action)* -> In +In <- (FOR NameList IN ExpList DO) -> InDef + (!END Action)* -> In END -InList <- (Name (COMMA Name)*) -> InList -While <- WHILE Exp DO - (!END Action)* +While <- (WHILE Exp DO) -> WhileDef + (!END Action)* -> While END -Repeat <- REPEAT - (!UNTIL Action)* - UNTIL Exp +Repeat <- REPEAT -> RepeatDef + (!UNTIL Action)* -> Repeat + (UNTIL Exp) -> Until -Set <- (LOCAL !FUNCTION Name ASSIGN Exp) +Set <- (LOCAL !FUNCTION NameList ASSIGN ExpList) -> LocalSet - / Simple ASSIGN Exp + / SimpleList ASSIGN ExpList Local <- LOCAL Function -> LocalFunction - / LOCAL Name + / LOCAL NameList -> LocalVar Call <- Prefix (Suffix)* |