aboutsummaryrefslogtreecommitdiff
path: root/src/yuescript/yue_parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsrc/yuescript/yue_parser.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/yuescript/yue_parser.cpp b/src/yuescript/yue_parser.cpp
index 0c08d4f..1f1b57c 100755
--- a/src/yuescript/yue_parser.cpp
+++ b/src/yuescript/yue_parser.cpp
@@ -28,9 +28,8 @@ std::unordered_set<std::string> Keywords = {
28 "or", "repeat", "return", "then", "true", 28 "or", "repeat", "return", "then", "true",
29 "until", "while", // Lua keywords 29 "until", "while", // Lua keywords
30 "as", "class", "continue", "export", "extends", 30 "as", "class", "continue", "export", "extends",
31 "from", "global", "import", "is", "macro", 31 "from", "global", "import", "macro", "switch",
32 "switch", "try", "unless", "using", "when", 32 "try", "unless", "using", "when", "with" // Yue keywords
33 "with" // Yue keywords
34}; 33};
35 34
36YueParser::YueParser() { 35YueParser::YueParser() {
@@ -219,7 +218,7 @@ YueParser::YueParser() {
219 218
220 BreakLoop = (expr("break") | expr("continue")) >> not_(AlphaNum); 219 BreakLoop = (expr("break") | expr("continue")) >> not_(AlphaNum);
221 220
222 Return = key("return") >> -ExpListLow; 221 Return = key("return") >> -(TableBlock | ExpListLow);
223 222
224 WithExp = ExpList >> -Assign; 223 WithExp = ExpList >> -Assign;
225 224
@@ -556,7 +555,7 @@ YueParser::YueParser() {
556 555
557 KeyValue = variable_pair | normal_pair | meta_variable_pair | meta_normal_pair; 556 KeyValue = variable_pair | normal_pair | meta_variable_pair | meta_normal_pair;
558 KeyValueList = KeyValue >> *(sym(',') >> KeyValue); 557 KeyValueList = KeyValue >> *(sym(',') >> KeyValue);
559 KeyValueLine = CheckIndent >> (KeyValueList >> -sym(',') | TableBlockIndent | Space >> expr('*') >> (Exp | TableBlock)); 558 KeyValueLine = CheckIndent >> (KeyValueList >> -sym(',') | TableBlockIndent | Space >> expr('*') >> (SpreadExp | Exp | TableBlock));
560 559
561 FnArgDef = (Variable | SelfName >> -existential_op) >> -(sym('=') >> Space >> Exp); 560 FnArgDef = (Variable | SelfName >> -existential_op) >> -(sym('=') >> Space >> Exp);
562 561