You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Destructurer dispatcher v2: admission-keyed buckets, two levels deep
The v1 dispatcher tried arms in declaration order, so the late pratt op forms
paid ~20 failed unifications per expression node. v2 derives each arm's
FIRST-CHILD admission keys from its step plan (node rule / leaf tokenType /
literal first charCode, with nullable-first arms admitting everything) and
dispatches through nested switches: node child -> rule bucket, leaf ->
tokenType bucket ($keyword/$punct sub-switched on the first character). Big
node-rule buckets (a pratt rule's self bucket holds every led + op form)
sub-dispatch one level deeper on c[1] - the connector position. Buckets are
SUPERSET filters (every arm fn still verifies exactly) and preserve
declaration order internally, so tie semantics are unchanged.
Destructure-EVERY-node overhead over the bare CST pass: +64% (v1) -> +39%
(one level) -> +31% (two levels); totality unchanged (32,336 nodes, 0 misses
across all seven grammars + the TS corpus sample) and the tsc-structural
oracle stays node-identical (32/32).
0 commit comments