feat: parser slices 8 + 9 — trait + impl declarations (unified <T> form) #2
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/002-feat-parser-slices-8-9-trait-impl-declarations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
feat: parser slices 8 + 9 — trait + impl declarations (unified form)
Along the way:
Touches 66 files:
docs/00_why.md,docs/impl/03-parser.md,docs/impl/README.md,docs/impl/slices.md,docs/syntax.md,docs/traits.mdand 60 more.Split. The decision in
first_blockis a pure function now, with its own tests insrc/rust/crates/ck_parser/src/tests/stmt.rs.A clear improvement. The change in
src/rust/crates/ck_parser/src/tests/stmt.rsis the part I would have argued for.@ -0,0 +90,4 @@}self.expect(SyntaxKind::Eq, "E0054", "expected `=` in let binding");self.parse_expr(0);self.expect(The expect message on
expectis the only thing a user sees if this fires. Does it say what they should do, or only what we assumed?@ -0,0 +10,4 @@use super::*;use ck_lex::SyntaxKind;fn first_block(out: &ParseOutput) -> &SyntaxNode {first_blockreads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?It said what I assumed. Reworded in
src/rust/crates/ck_parser/src/stmt.rsso it names the input that broke it, which is what the bug report will need.Wires the slice-10 Pratt parser into `parse_block`, so fn bodies, impl-method bodies, and the new block-as-primary case all share one `Block ::= { Expr? }` production. Generalizes E0036's message from "function body" to "block".