diff options
| author | chrsm <git@c.chrsm.org> | 2026-02-23 00:12:20 -0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-02-23 17:33:48 +0800 |
| commit | 1d450f59ab482906eedcd3cab4fea28327613592 (patch) | |
| tree | a6f68582d4a269f075f6d3764868dd6b0ceece2e /src | |
| parent | c0cf60fcaaf0d9872b00ff668b8f139632f8322d (diff) | |
| download | yuescript-1d450f59ab482906eedcd3cab4fea28327613592.tar.gz yuescript-1d450f59ab482906eedcd3cab4fea28327613592.tar.bz2 yuescript-1d450f59ab482906eedcd3cab4fea28327613592.zip | |
bugfix: insert comma before eol comment when line numbers on
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuescript/yue_compiler.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index 6cf0fc7..92bf561 100644 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp | |||
| @@ -10020,7 +10020,12 @@ private: | |||
| 10020 | if (baseEntries[i].second && i != lastValue) { | 10020 | if (baseEntries[i].second && i != lastValue) { |
| 10021 | auto pos = item.rfind('\n'); | 10021 | auto pos = item.rfind('\n'); |
| 10022 | if (pos != std::string::npos) { | 10022 | if (pos != std::string::npos) { |
| 10023 | item.insert(pos, ","); | 10023 | auto comment = item.rfind("-- "); |
| 10024 | if (comment != std::string::npos && comment < pos) { | ||
| 10025 | item.insert(comment - 1, ","); | ||
| 10026 | } else { | ||
| 10027 | item.insert(pos, ","); | ||
| 10028 | } | ||
| 10024 | } else { | 10029 | } else { |
| 10025 | item.push_back(','); | 10030 | item.push_back(','); |
| 10026 | } | 10031 | } |
