Commit 24cccf1
committed
Normalize the expression-position shape-detectors (#51)
Reading each expression detector myself (the audit agent's output was
malformed): five matched a construct on the raw r.body, so an equivalent
factoring slips them. Route them through expandAlts, same pattern as
detectTernary/detectCallExpression:
- detectBareArrowParam — `ref '=>'`; an opt-tail arrow (`[x, opt('=>', body)]`)
was dropped (verified: variable.parameter now emitted for that factoring).
- detectPropertyAccess — `'.'`/`'?.'` before a token ref.
- detectParenArrowParams + detectArrowParamDelims — the deliberate pair that
read the same arrow param-list production; routed identically so they still
cannot disagree.
- detectDirectParamKeywords — keyword directly before `(`; also recurse `sep`.
detectConstructorKeywords already expands (no change). Byte-identical on all six
shipped grammars. Twelve detectors are now shape-robust. The YAML region
detectors are deferred to a semantics-aware pass: their fixed shapes encode
DELIBERATE YAML semantics (detectFold stops at a leaf token and does NOT follow
a rule-ref by design — an Indent+rule-ref is a SIBLING node, not a fold), so the
audit's heuristic "follow the ref" fix would break the fold-vs-sibling meaning.
Not every fixed shape is fragility — some are intent.1 parent f6a9990 commit 24cccf1
1 file changed
Lines changed: 14 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2049 | 2049 | | |
2050 | 2050 | | |
2051 | 2051 | | |
2052 | | - | |
2053 | | - | |
2054 | | - | |
2055 | | - | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
2056 | 2056 | | |
2057 | 2057 | | |
2058 | 2058 | | |
| |||
2079 | 2079 | | |
2080 | 2080 | | |
2081 | 2081 | | |
2082 | | - | |
2083 | | - | |
| 2082 | + | |
| 2083 | + | |
2084 | 2084 | | |
2085 | 2085 | | |
2086 | 2086 | | |
| |||
2112 | 2112 | | |
2113 | 2113 | | |
2114 | 2114 | | |
2115 | | - | |
2116 | | - | |
| 2115 | + | |
| 2116 | + | |
2117 | 2117 | | |
2118 | 2118 | | |
2119 | 2119 | | |
| |||
2159 | 2159 | | |
2160 | 2160 | | |
2161 | 2161 | | |
2162 | | - | |
2163 | | - | |
| 2162 | + | |
| 2163 | + | |
2164 | 2164 | | |
2165 | 2165 | | |
2166 | 2166 | | |
| |||
2289 | 2289 | | |
2290 | 2290 | | |
2291 | 2291 | | |
2292 | | - | |
2293 | | - | |
2294 | | - | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
2295 | 2296 | | |
2296 | 2297 | | |
2297 | 2298 | | |
| |||
0 commit comments