aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2026-02-18 22:57:40 +0800
committerLi Jin <dragon-fly@qq.com>2026-02-18 22:57:40 +0800
commit9f09c7a0d570266119cb6da6362225da5f22055c (patch)
tree354619411e30e123666594c2d8b43e172d560d1a /src
parentbdca36433c0ca86e4eab0672f3308dba7a76a871 (diff)
downloadyuescript-codex/add-single-line-comments-support-to-ast.tar.gz
yuescript-codex/add-single-line-comments-support-to-ast.tar.bz2
yuescript-codex/add-single-line-comments-support-to-ast.zip
Fix TableLit YueComment parsing with mixed-indent table linescodex/add-single-line-comments-support-to-ast
Diffstat (limited to 'src')
-rw-r--r--src/yuescript/yue_parser.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/yuescript/yue_parser.cpp b/src/yuescript/yue_parser.cpp
index 746ea29..e3dc598 100644
--- a/src/yuescript/yue_parser.cpp
+++ b/src/yuescript/yue_parser.cpp
@@ -890,7 +890,11 @@ YueParser::YueParser() {
890 890
891 table_lit_line = 891 table_lit_line =
892 -EmptyLine >> ( 892 -EmptyLine >> (
893 push_indent_match >> (plain_space >> not_(line_break | '}') >> (table_value | YueComment | expected_expression_error) >> *(plain_space >> ',' >> plain_space >> (table_value | YueComment)) >> pop_indent | pop_indent) 893 push_indent_match >> (
894 space >> not_(line_break | '}') >> (table_value | expected_expression_error) >> *(space >> ',' >> space >> table_value) >> pop_indent |
895 YueComment >> pop_indent |
896 pop_indent
897 )
894 ) | ( 898 ) | (
895 space 899 space
896 ); 900 );
@@ -899,7 +903,7 @@ YueParser::YueParser() {
899 903
900 TableLit = 904 TableLit =
901 '{' >> Seperator >> 905 '{' >> Seperator >>
902 -(plain_space >> (table_value | YueComment) >> *(plain_space >> ',' >> plain_space >> (table_value | YueComment)) >> -(plain_space >> ',')) >> 906 -(space >> table_value >> *(space >> ',' >> space >> table_value) >> -(space >> ',')) >>
903 ( 907 (
904 table_lit_lines >> white >> end_braces_expression | 908 table_lit_lines >> white >> end_braces_expression |
905 white >> '}' 909 white >> '}'