fix(format): never glue a composite separator on a section header #292
No reviewers
Labels
No labels
bug
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gram-lang/gram!292
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/format-composite-repair-skips-headers"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #291.
Rule 6 (glue a spaced composite,
@a{1} < @b{2}→@a{1}<@b{2}) ran on every line, section headers included, while a##header holds no element: its title is text the compiler keeps as written.## <@s: rule 6 took the blank after##, rule 8 put it back; unchanged text but 2 changes reported at every pass, sogram format --checkfailed forever (fuzzformat-idempotent, seed 1627016615, index 10547 on dev/1.6).## Zest <@lemon ~{-1 h}became## Zest<@lemon ~{-1 h}: the compiled section title changed.Fix: rule 6 skips header lines (
##not followed by#, as rule 8 reads them, newHEADER_LINE). A###line is a step and is still glued.packages/format/tests/formatter.test.tsandfuzz/regressions/291-header-composite-repair.gram(all fail on main).patchchangeset for@gram-lang/format.Checks: 3949 pass / 1 skip / 0 fail, conformance 142/142 and 24/24 with no golden change, typecheck, biome,
deprecations:check, audit 127 (main's baseline since #290), fuzz 50k (seed 3547255441, 0 signature).fuzz/known-failures.jsonstays empty.