Commit d4cc5ac
committed
YAML detectors: one safe positional fix, three confirmed deliberate (#51)
Worked the YAML region detectors semantics-aware (not the audit's heuristic).
Key finding: the audit's "route through expandAlts" fix is WRONG for these —
they match STRUCTURAL nodes (a `(Newline item)*` quantifier, config-keyed
bracket pairs), and expandAlts EXPANDS the very quantifier they depend on.
- detectBlockSequence — the one genuine positional rigidity: it matched the
`[item, (Newline item)*]` pattern only at items[0]/items[1]. Now scanned
pairwise (any adjacent k), so a leading element before the sequence does not
hide it. NOT routed through expandAlts (that would expand the quantifier).
yaml byte-identical; the full yaml gate group (depth-witnesses, deepest-sibling,
compact-nest-sites, flow-sites, blockscalar-depth, issue12) stays green.
- detectFold — its visit is ALREADY pairwise; its refsLeaf stopping at a leaf
token (not following a rule-ref) is the DELIBERATE fold-vs-sibling distinction
(an Indent+rule-ref is a sibling node). No change.
- detectExplicitKey — the indicator at items[0] is intrinsic (an explicit-key
entry is headed by `?`); the inner already unwraps a quantifier. No change.
- detectFlowCollections — topLits is positional-agnostic and unwraps
quantifier/group/sep, deliberately stopping at alt/ref to read THIS rule's own
structure. No change.
So the fixed-window fragility class is closed: 13 detectors made shape-robust
where the rigidity was accidental; the rest is deliberate YAML semantics that
the heuristic over-flagged. Not every fixed shape is fragility.1 parent 24cccf1 commit d4cc5ac
1 file changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3626 | 3626 | | |
3627 | 3627 | | |
3628 | 3628 | | |
3629 | | - | |
3630 | | - | |
3631 | | - | |
3632 | | - | |
| 3629 | + | |
| 3630 | + | |
| 3631 | + | |
| 3632 | + | |
| 3633 | + | |
| 3634 | + | |
| 3635 | + | |
3633 | 3636 | | |
3634 | 3637 | | |
3635 | 3638 | | |
| |||
0 commit comments