From 6437b10cd35a55a5a223f98973209cb48f6cfb02 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Thu, 19 Feb 2026 14:55:56 +0800 Subject: Respect reserve comments in spread table/tableblock compilation --- src/yuescript/yue_compiler.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index 9891e79..f67e921 100644 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp @@ -7989,6 +7989,19 @@ private: transformFor(forNode, temp); break; } + case id(): { + if (_config.reserveComment) { + auto comment = static_cast(item); + temp.push_back(indent() + comment->to_string(&_config) + nl(item)); + } + break; + } + case id(): { + if (_config.reserveComment) { + temp.push_back(nl(item)); + } + break; + } case id(): case id(): { if (auto pair = ast_cast(item)) { -- cgit v1.2.3-55-g6feb