diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/MoonP/moon_compiler.cpp | 2 | ||||
-rw-r--r-- | src/MoonP/moon_parser.cpp | 11 | ||||
-rw-r--r-- | src/MoonP/moon_parser.h | 1 |
3 files changed, 8 insertions, 6 deletions
diff --git a/src/MoonP/moon_compiler.cpp b/src/MoonP/moon_compiler.cpp index 6d07e9e..36b6b11 100644 --- a/src/MoonP/moon_compiler.cpp +++ b/src/MoonP/moon_compiler.cpp | |||
@@ -43,7 +43,7 @@ inline std::string s(std::string_view sv) { | |||
43 | } | 43 | } |
44 | 44 | ||
45 | const std::string_view version() { | 45 | const std::string_view version() { |
46 | return "0.3.12"sv; | 46 | return "0.3.13"sv; |
47 | } | 47 | } |
48 | 48 | ||
49 | // name of table stored in lua registry | 49 | // name of table stored in lua registry |
diff --git a/src/MoonP/moon_parser.cpp b/src/MoonP/moon_parser.cpp index 5b537a1..2d71567 100644 --- a/src/MoonP/moon_parser.cpp +++ b/src/MoonP/moon_parser.cpp | |||
@@ -44,7 +44,8 @@ MoonParser::MoonParser() { | |||
44 | multi_line_content = *(not_(multi_line_close) >> Any); | 44 | multi_line_content = *(not_(multi_line_close) >> Any); |
45 | MultiLineComment = multi_line_open >> multi_line_content >> multi_line_close; | 45 | MultiLineComment = multi_line_open >> multi_line_content >> multi_line_close; |
46 | EscapeNewLine = expr('\\') >> *(set(" \t") | MultiLineComment) >> -Comment >> Break; | 46 | EscapeNewLine = expr('\\') >> *(set(" \t") | MultiLineComment) >> -Comment >> Break; |
47 | Space = *(set(" \t") | and_(set("-\\")) >> (MultiLineComment | EscapeNewLine)) >> -Comment; | 47 | space_one = set(" \t") | and_(set("-\\")) >> (MultiLineComment | EscapeNewLine); |
48 | Space = *space_one >> -Comment; | ||
48 | SpaceBreak = Space >> Break; | 49 | SpaceBreak = Space >> Break; |
49 | White = Space >> *(Break >> Space); | 50 | White = Space >> *(Break >> Space); |
50 | EmptyLine = SpaceBreak; | 51 | EmptyLine = SpaceBreak; |
@@ -303,7 +304,7 @@ MoonParser::MoonParser() { | |||
303 | expr("<<") | | 304 | expr("<<") | |
304 | expr(">>") | | 305 | expr(">>") | |
305 | expr("//") | | 306 | expr("//") | |
306 | set("+-*/%^><|&"); | 307 | set("+-*/%^><|&~"); |
307 | 308 | ||
308 | BackcallOperator = expr("|>"); | 309 | BackcallOperator = expr("|>"); |
309 | 310 | ||
@@ -512,16 +513,16 @@ MoonParser::MoonParser() { | |||
512 | ); | 513 | ); |
513 | 514 | ||
514 | InvokeArgs = | 515 | InvokeArgs = |
515 | not_(expr('-')) >> Seperator >> | 516 | not_(set("-~")) >> Seperator >> |
516 | ( | 517 | ( |
517 | Exp >> *(sym(',') >> Exp) >> -(invoke_args_with_table | TableBlock) | | 518 | Exp >> *(sym(',') >> Exp) >> -(invoke_args_with_table | TableBlock) | |
518 | TableBlock | 519 | TableBlock |
519 | ); | 520 | ); |
520 | 521 | ||
521 | const_value = (expr("nil") | expr("true") | expr("false")) >> not_(AlphaNum); | 522 | const_value = (expr("nil") | expr("true") | expr("false")) >> not_(AlphaNum); |
522 | minus_exp = expr('-') >> not_(set(" \t")) >> Exp; | 523 | minus_exp = expr('-') >> not_(space_one) >> Exp; |
523 | sharp_exp = expr('#') >> Exp; | 524 | sharp_exp = expr('#') >> Exp; |
524 | tilde_exp = expr('~') >> Exp; | 525 | tilde_exp = expr('~') >> not_(space_one) >> Exp; |
525 | not_exp = expr("not") >> not_(AlphaNum) >> Exp; | 526 | not_exp = expr("not") >> not_(AlphaNum) >> Exp; |
526 | unary_exp = minus_exp | sharp_exp | tilde_exp | not_exp; | 527 | unary_exp = minus_exp | sharp_exp | tilde_exp | not_exp; |
527 | 528 | ||
diff --git a/src/MoonP/moon_parser.h b/src/MoonP/moon_parser.h index 00bbcd5..069fdf1 100644 --- a/src/MoonP/moon_parser.h +++ b/src/MoonP/moon_parser.h | |||
@@ -112,6 +112,7 @@ private: | |||
112 | rule MultiLineComment; | 112 | rule MultiLineComment; |
113 | rule Indent; | 113 | rule Indent; |
114 | rule EscapeNewLine; | 114 | rule EscapeNewLine; |
115 | rule space_one; | ||
115 | rule Space; | 116 | rule Space; |
116 | rule SpaceBreak; | 117 | rule SpaceBreak; |
117 | rule EmptyLine; | 118 | rule EmptyLine; |