Repository navigation
Commit a4706ef
Remove obsolete attributes from the printer's filters and merge them
`res.ternary` and `JSX` are now only part of the v0 PPX wire format:
the parser produces `Pexp_ternary` and `Pexp_jsx_element`, and the v0
bridge converts both markers back into those nodes. Drop them from
`is_parsing_attr`, `has_attributes` and `is_printable_attribute`.
`is_printable_attribute` then only differed from `is_parsing_attr` in
`res.patVariantSpread` and `res.dictPattern`, which the parser only puts
on patterns, while the printable helpers are only used on expressions and
module expressions. Define the printable helpers in terms of
`is_parsing_attr`, so the printer has one list of internal attributes
instead of two that disagreed (the cause of the `@JSX` review finding in
#8735). `filter_printable_attributes` was the same as
`filter_parsing_attrs` and is removed.
A `@JSX` attribute written in source now gets the same parens as any
other attribute, e.g. `(@jsx x) + 1`. Formatting of the repo's sources is
unchanged.
Signed-off-by: Christoph Knittel <christoph@knittel.cc>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 51c9a0d commit a4706ef
3 files changed
Lines changed: 10 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
227 | | - | |
| 226 | + | |
| 227 | + | |
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
385 | | - | |
| 385 | + | |
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| |||
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
| 533 | + | |
| 534 | + | |
541 | 535 | | |
542 | | - | |
543 | | - | |
544 | | - | |
| 536 | + | |
| 537 | + | |
545 | 538 | | |
546 | | - | |
547 | | - | |
548 | | - | |
| 539 | + | |
549 | 540 | | |
550 | 541 | | |
551 | | - | |
| 542 | + | |
552 | 543 | | |
553 | 544 | | |
554 | 545 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | 99 | | |
101 | 100 | | |
102 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4291 | 4291 | | |
4292 | 4292 | | |
4293 | 4293 | | |
4294 | | - | |
4295 | | - | |
| 4294 | + | |
4296 | 4295 | | |
4297 | 4296 | | |
4298 | 4297 | | |
| |||
0 commit comments