From 9f09c7a0d570266119cb6da6362225da5f22055c Mon Sep 17 00:00:00 2001 From: Li Jin Date: Wed, 18 Feb 2026 22:57:40 +0800 Subject: Fix TableLit YueComment parsing with mixed-indent table lines --- src/yuescript/yue_parser.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') 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() { table_lit_line = -EmptyLine >> ( - 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) + push_indent_match >> ( + space >> not_(line_break | '}') >> (table_value | expected_expression_error) >> *(space >> ',' >> space >> table_value) >> pop_indent | + YueComment >> pop_indent | + pop_indent + ) ) | ( space ); @@ -899,7 +903,7 @@ YueParser::YueParser() { TableLit = '{' >> Seperator >> - -(plain_space >> (table_value | YueComment) >> *(plain_space >> ',' >> plain_space >> (table_value | YueComment)) >> -(plain_space >> ',')) >> + -(space >> table_value >> *(space >> ',' >> space >> table_value) >> -(space >> ',')) >> ( table_lit_lines >> white >> end_braces_expression | white >> '}' -- cgit v1.2.3-55-g6feb