Skip to content

Commit 27cbb4e

Browse files
committed
Move refactor plan to repo root; printer is dumb, features own output
Plan lives at repo root (docs/ is author-owned). Correct the model: features own their output via lowering (incl. f-string grouping); the printer only writes node strings and tracks the output cursor.
1 parent 87c36cb commit 27cbb4e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- Plugins renamed verb-first: `RenameReservedKeywords`, `DetectAsync`, `DetectSlots`, `DetectMutableDefaults`, `CollectSpreadKwargs`. (`3968b0b`)
88

99
## Decisions
10-
- Pipeline: parse, then ordered plugin passes, then generate. Generate stays separate (f-string merging and source mapping are whole-output jobs, not per-node).
10+
- Pipeline: parse, then ordered plugin passes, then a thin printer. Features own their output by lowering the AST (including f-string grouping and helper choice). The printer is mechanical: it writes each node's string and assigns compiled positions from carried spans. No feature logic lives in it. The only thing inherent to the printer is the output cursor.
1111
- `Shorthand` stays an `AttributeKind`. It is NOT source-level sugar for `x={x}`: `{x}` has no `=`, and source-mapping is tied to original syntax.
1212
- Source-mapping must be span-based: read spans, never branch on `AttributeKind`. Currently violated by `injection_analyzer.rs` and `brace_collector.rs`.
1313
- Desugaring happens on the AST with spans carried forward (rustc/Babel/TS model), never on source text.
@@ -18,7 +18,7 @@
1818
2. Desugar `Shorthand` into `Expression` as an AST pass, carrying spans forward. Runs before `RenameReservedKeywords`.
1919
3. Unify the HTML emit table so longhand renders like shorthand (`data` to render_data, `aria` to render_aria, else to render_attr). Behavior change: regenerate expected via `accept_expected` dry-run, review, then apply. Then JetBrains visual check on `kitchen_sink.hyper`.
2020
4. Delete `helper_detect`; the generator records the helpers it emits and builds imports from that (needs two-phase: emit body, then header). Fixes the `data={x}` dead-import bug.
21-
5. Vision: each feature becomes a full lowering pass; the generator becomes a near-dumb printer.
21+
5. Vision: every feature is a lowering pass (including f-string grouping). The printer is dumb: write each node's string, assign positions from carried spans, advance the cursor. The cursor is the only thing inherent to the printer.
2222

2323
## Also pending
2424
- dotfiles `adhd.md` provenance-header addition is uncommitted (separate repo).

0 commit comments

Comments
 (0)