diff options
Diffstat (limited to 'src/MoonP/moon_parser.cpp')
| -rw-r--r-- | src/MoonP/moon_parser.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/MoonP/moon_parser.cpp b/src/MoonP/moon_parser.cpp index a13a779..53a6b8f 100644 --- a/src/MoonP/moon_parser.cpp +++ b/src/MoonP/moon_parser.cpp | |||
| @@ -430,12 +430,14 @@ MoonParser::MoonParser() { | |||
| 430 | Space | 430 | Space |
| 431 | ); | 431 | ); |
| 432 | 432 | ||
| 433 | TableBlockInner = Seperator >> KeyValueLine >> *(+(SpaceBreak) >> KeyValueLine); | 433 | TableBlockInner = Seperator >> KeyValueLine >> *(+SpaceBreak >> KeyValueLine); |
| 434 | TableBlock = +(SpaceBreak) >> Advance >> ensure(TableBlockInner, PopIndent); | 434 | TableBlock = +SpaceBreak >> Advance >> ensure(TableBlockInner, PopIndent); |
| 435 | TableBlockIndent = sym('#') >> Seperator >> KeyValueList >> -sym(',') >> | ||
| 436 | -(+SpaceBreak >> Advance >> ensure(KeyValueList >> -sym(',') >> *(+SpaceBreak >> KeyValueLine), PopIndent)); | ||
| 435 | 437 | ||
| 436 | class_member_list = Seperator >> KeyValue >> *(sym(',') >> KeyValue); | 438 | class_member_list = Seperator >> KeyValue >> *(sym(',') >> KeyValue); |
| 437 | ClassLine = CheckIndent >> (class_member_list | Statement) >> -sym(','); | 439 | ClassLine = CheckIndent >> (class_member_list | Statement) >> -sym(','); |
| 438 | ClassBlock = +(SpaceBreak) >> Advance >>Seperator >> ClassLine >> *(+(SpaceBreak) >> ClassLine) >> PopIndent; | 440 | ClassBlock = +SpaceBreak >> Advance >> Seperator >> ClassLine >> *(+SpaceBreak >> ClassLine) >> PopIndent; |
| 439 | 441 | ||
| 440 | ClassDecl = | 442 | ClassDecl = |
| 441 | key("class") >> not_(expr(':')) >> | 443 | key("class") >> not_(expr(':')) >> |
| @@ -489,7 +491,7 @@ MoonParser::MoonParser() { | |||
| 489 | }); | 491 | }); |
| 490 | 492 | ||
| 491 | KeyValueList = KeyValue >> *(sym(',') >> KeyValue); | 493 | KeyValueList = KeyValue >> *(sym(',') >> KeyValue); |
| 492 | KeyValueLine = CheckIndent >> KeyValueList >> -sym(','); | 494 | KeyValueLine = CheckIndent >> (KeyValueList >> -sym(',') | TableBlockIndent); |
| 493 | 495 | ||
| 494 | FnArgDef = (Variable | SelfName) >> -(sym('=') >> Space >> Exp); | 496 | FnArgDef = (Variable | SelfName) >> -(sym('=') >> Space >> Exp); |
| 495 | 497 | ||
