Commit d18b25f
* fix(faces): stop appending `;` to `--` comment lines in LucidScript
The previous pipeline first called `convert_dashdash_comment` (turning
`-- text` into `// text`), then passed the result to
`strip_dashdash_comment`. Because `strip_dashdash_comment` scans for
`--` and found none in the converted line, it returned the entire `//
text` string as the "code part". That code part fell through to the
expression handler, which appended `;`, producing `// text;`.
Fix: apply `strip_dashdash_comment` directly to the raw (pre-conversion)
line. A `-- comment` line now yields an empty code part and a populated
comment_opt, so it is emitted as `// text\n` with no trailing `;`.
As a side effect, `convert_dashdash_comment` becomes unused and is
deleted.
`is_blank_line` is updated to treat canonical `//` lines as blank (so
the next-meaningful-indent scan skips them), and a new dispatch branch
in `transform_source` passes canonical `//`/`/*` lines through unchanged
before they can reach the equation handler.
Updated snapshot `tests/faces/hello-lucid.expected.txt`.
* fix(faces/lucid): emit `//` (no trailing space) for blank `--` lines
When a `--`-comment line has no text (e.g. just `--`), `strip_dashdash_comment`
returns `Some ""`. The previous code would emit `"// " ^ "" ^ "\n"` = `"// \n"`,
leaving a trailing space. The expected snapshot (and readable output) needs
`"//\n"` with no trailing space.
Fix: check the trimmed comment text and emit bare `"//"` when it is empty.
https://claude.ai/code/session_01Vrh2f1G8tf7ZbNcKh9r5U9
* fix(lucid-face): strip extra trailing newline from transform_source
When source ends with \n, String.split_on_char '\n' produces a trailing
empty string. The loop processes it as an empty line, emitting an extra
\n via Buffer.add_char — making output end with \n\n instead of \n.
Strip the redundant newline at the end of transform_source so the output
matches the snapshot (which was already updated to have exactly one
trailing newline).
https://claude.ai/code/session_01Vrh2f1G8tf7ZbNcKh9r5U9
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent d2811a9 commit d18b25f
2 files changed
Lines changed: 40 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 73 | + | |
83 | 74 | | |
84 | 75 | | |
85 | 76 | | |
| |||
105 | 96 | | |
106 | 97 | | |
107 | 98 | | |
108 | | - | |
| 99 | + | |
109 | 100 | | |
110 | 101 | | |
111 | 102 | | |
| |||
144 | 135 | | |
145 | 136 | | |
146 | 137 | | |
147 | | - | |
| 138 | + | |
148 | 139 | | |
149 | 140 | | |
150 | 141 | | |
| |||
156 | 147 | | |
157 | 148 | | |
158 | 149 | | |
159 | | - | |
| 150 | + | |
160 | 151 | | |
161 | 152 | | |
162 | 153 | | |
| |||
221 | 212 | | |
222 | 213 | | |
223 | 214 | | |
224 | | - | |
| 215 | + | |
225 | 216 | | |
226 | 217 | | |
227 | 218 | | |
| |||
252 | 243 | | |
253 | 244 | | |
254 | 245 | | |
255 | | - | |
| 246 | + | |
256 | 247 | | |
257 | 248 | | |
258 | 249 | | |
| |||
267 | 258 | | |
268 | 259 | | |
269 | 260 | | |
270 | | - | |
| 261 | + | |
271 | 262 | | |
272 | 263 | | |
273 | 264 | | |
| |||
350 | 341 | | |
351 | 342 | | |
352 | 343 | | |
353 | | - | |
| 344 | + | |
354 | 345 | | |
355 | 346 | | |
356 | 347 | | |
| |||
395 | 386 | | |
396 | 387 | | |
397 | 388 | | |
398 | | - | |
| 389 | + | |
399 | 390 | | |
400 | 391 | | |
401 | 392 | | |
| |||
535 | 526 | | |
536 | 527 | | |
537 | 528 | | |
538 | | - | |
| 529 | + | |
539 | 530 | | |
540 | 531 | | |
541 | | - | |
542 | | - | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
543 | 537 | | |
544 | 538 | | |
545 | 539 | | |
| |||
571 | 565 | | |
572 | 566 | | |
573 | 567 | | |
574 | | - | |
575 | | - | |
| 568 | + | |
576 | 569 | | |
577 | 570 | | |
578 | 571 | | |
| |||
583 | 576 | | |
584 | 577 | | |
585 | 578 | | |
586 | | - | |
587 | | - | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
588 | 587 | | |
589 | 588 | | |
590 | 589 | | |
| |||
659 | 658 | | |
660 | 659 | | |
661 | 660 | | |
662 | | - | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
663 | 665 | | |
664 | | - | |
| 666 | + | |
665 | 667 | | |
666 | 668 | | |
667 | 669 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
0 commit comments