Skip to content

Converge the AST dispatch tables onto NodeRegistry (follow-up to #1143) #1243

Description

@nickna

Follow-up to #1143 / epic #1094.

PR #1241 delivered the mechanical half of #1143 (split ObjectBuiltIns into JS-statics + ObjectBuiltIns.RuntimeDescriptors.cs; right-sized BuiltInModuleTypes.cs 2,399 → 697 lines across two domain partials). It did not do the AST-dispatch-table convergence, which is a design change rather than a mechanical move.

Current state: the test-only Accept/IExprVisitor/IStmtVisitor tables the issue referenced are already gone (no matches in Parsing/); the remaining dispatch lives in Parsing/Visitors/NodeRegistry.cs and AstVisitorBase.cs. The #1143 ask is to converge so that a node is declared once — "ideally source-generated."

Action: evaluate a source generator (or a single canonical table) that emits the AstVisitorBase switch and NodeRegistry entries from the AST record definitions in Parsing/AST.cs, so adding a node can't silently skip a dispatch table. This is a behaviour-preserving but non-trivial change (new build-time generator), out of scope for the mechanical-refactor PR #1241.

Part of #1094.

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtCode maintainability / tech-debt cleanup

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions