diff options
| author | Li Jin <dragon-fly@qq.com> | 2026-02-19 14:55:56 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-02-19 14:55:56 +0800 |
| commit | 6437b10cd35a55a5a223f98973209cb48f6cfb02 (patch) | |
| tree | 77816b90d4b63f9bf2c2c4fc5b625e21a74fe0a2 /src | |
| parent | 36d9c36b53f5ce2b389be2637d35fab0aa5d65f0 (diff) | |
| download | yuescript-6437b10cd35a55a5a223f98973209cb48f6cfb02.tar.gz yuescript-6437b10cd35a55a5a223f98973209cb48f6cfb02.tar.bz2 yuescript-6437b10cd35a55a5a223f98973209cb48f6cfb02.zip | |
Respect reserve comments in spread table/tableblock compilation
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuescript/yue_compiler.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
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: | |||
| 7989 | transformFor(forNode, temp); | 7989 | transformFor(forNode, temp); |
| 7990 | break; | 7990 | break; |
| 7991 | } | 7991 | } |
| 7992 | case id<YueComment_t>(): { | ||
| 7993 | if (_config.reserveComment) { | ||
| 7994 | auto comment = static_cast<YueComment_t*>(item); | ||
| 7995 | temp.push_back(indent() + comment->to_string(&_config) + nl(item)); | ||
| 7996 | } | ||
| 7997 | break; | ||
| 7998 | } | ||
| 7999 | case id<EmptyLine_t>(): { | ||
| 8000 | if (_config.reserveComment) { | ||
| 8001 | temp.push_back(nl(item)); | ||
| 8002 | } | ||
| 8003 | break; | ||
| 8004 | } | ||
| 7992 | case id<VariablePair_t>(): | 8005 | case id<VariablePair_t>(): |
| 7993 | case id<VariablePairDef_t>(): { | 8006 | case id<VariablePairDef_t>(): { |
| 7994 | if (auto pair = ast_cast<VariablePairDef_t>(item)) { | 8007 | if (auto pair = ast_cast<VariablePairDef_t>(item)) { |
