diff options
| author | Li Jin <dragon-fly@qq.com> | 2026-02-20 13:51:50 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-02-20 13:51:50 +0800 |
| commit | 07e0dacfd50957a8bf7d4c1c53da8ae50acb3ffb (patch) | |
| tree | d56f935d06b58be7791b156d6ab48f57fb065d9d /src | |
| parent | ccb574673067152c12408be4e7329e088576fdea (diff) | |
| download | yuescript-07e0dacfd50957a8bf7d4c1c53da8ae50acb3ffb.tar.gz yuescript-07e0dacfd50957a8bf7d4c1c53da8ae50acb3ffb.tar.bz2 yuescript-07e0dacfd50957a8bf7d4c1c53da8ae50acb3ffb.zip | |
Fix ClassBlock parsing to keep comment lines
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuescript/yue_parser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/yuescript/yue_parser.cpp b/src/yuescript/yue_parser.cpp index 3772af0..f712db7 100644 --- a/src/yuescript/yue_parser.cpp +++ b/src/yuescript/yue_parser.cpp | |||
| @@ -922,9 +922,9 @@ YueParser::YueParser() { | |||
| 922 | YueComment | | 922 | YueComment | |
| 923 | check_indent_match >> space >> (ClassMemberList | Statement) >> -(space >> ','); | 923 | check_indent_match >> space >> (ClassMemberList | Statement) >> -(space >> ','); |
| 924 | ClassBlock = | 924 | ClassBlock = |
| 925 | +space_break >> | 925 | ((+(plain_space >> line_break)) | (+space_break >> not_(expr("--")))) >> |
| 926 | advance_match >> Seperator >> | 926 | advance_match >> Seperator >> |
| 927 | class_line >> *(+space_break >> class_line) >> | 927 | class_line >> *(((plain_space >> line_break) >> class_line) | (+space_break >> not_(expr("--")) >> class_line)) >> |
| 928 | pop_indent; | 928 | pop_indent; |
| 929 | 929 | ||
| 930 | ClassDecl = | 930 | ClassDecl = |
