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
{{ message }}
Repository navigation
t27b: move the node shapes and item scans of lower.rs (is_repeat_op, plain_lit, alias_text, strength_reduced, analyzed_fns and more) to specs/tri/t27b/ast_shape.t27 #8563
Port slice of #6198 (t27b written in t27), under #6063 and #5980. It follows #8347, whose specs/tri/t27b/ast_scan.t27 marks over specs/tri/t27b/ast_walk.t27's byte form of a node list it reuses.
What
cli/t27b/src/lower.rs still tests the shape of a t27c AST node, and scans a file's top-level items, with hand-written Rust over compiler::Node:
is_repeat_op, [_]T{ ... } ** n;
find_const, the value of the first const name = value; in preorder;
simple_repeat_elem, the shapes a repeat element parsed back from its text may take;
repeat_names, the head of every identifier's name;
plain_lit, an array literal of literals and negated literals;
strength_reduced, the * nodes t27c's strength reduction reaches from a fn body's top-level statements;
analyzed_fns, the fns Zig's lazy analysis reaches from the roots.
This issue moves them to specs/tri/t27b/ast_shape.t27. A shape reads one node and its children from flat's bytes; the two item scans write a mark per node they collect, as the scans of ast_scan.t27 do, and marked returns the marked nodes in preorder. flat and marked take any list of node references, so the item scans run over items (the module's children, plus the libm helpers spliced in) as the deleted Rust did.
Plan
The spec has test blocks on hand-built trees. Their expected values come from the hand-written Rust on master.
t27c gen-rust writes gen/rust/tri/t27b/ast_shape.rs, which is mounted in lower.rs as sh.
lower.rs loses those hand-written bodies, its hand glue stays within master's check_budget caps, and the net change in hand lines under cli/t27b/ is negative.
The corpus receipts show no file changed its verdict or its t27b asm digest, apart from the new spec itself.
Activity
t27b: the node shapes and item scans of lower.rs move to specs/tri/t2…