Scaffold semantic analysis #14
Loading…
Reference in a new issue
No description provided.
Delete branch "types"
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?
Step 00.
sourcefromlexer1b59359a22astfromparserd65f1a0794astinto one module per node family ad1726c19dsemacrate and the compile-phase fixture driver (RED) 7d9b95b7d8Spec phase: compile. Fixtures: all 21 under tests/fixtures/semantics/. `check(&ast::Program, &SourceBuffer) -> Result<hir::Program, Vec<Diagnostic>>`, with a body that returns one diagnostic saying semantic analysis is not implemented. That is the whole crate. The signature is the deliverable: it says semantics lowers into a typed HIR rather than annotating the AST in place, and it says diagnostics accumulate rather than short-circuit, which are decisions 2 and 4 of the phase README. `hir::Program` is a stub carrying only its span; step 20 declares the node families. The driver asserts more than the lexer's and the parser's do, because a semantics fixture is not only a program that must be accepted. Three of them are refusals, and AGENTS.md already requires each to mark its offending line with a trailing `// ERROR:` comment. That marker is now an assertion: an unmarked fixture must type-check, and a marked one must be rejected on exactly the marked lines. Without the second half, a negative fixture passes whenever the checker rejects it at all, including for an unrelated reason on an unrelated line, which is the failure a negative test exists to rule out. Only error-severity diagnostics are compared, so a future warning on an unrelated line cannot break a negative fixture. RED: 21 of 21, every one of them "semantic analysis is not implemented". That count is the phase's progress bar, so the driver is not #[ignore]d; `.known-red` carries the exemption and will refuse to outlive it. Non-vacuity, run by hand against three throwaway `check` bodies rather than one: always-Err on line 1 -> 21 fail; the 3 negatives fail on the distinct line-mismatch message, not the generic one always-Ok -> 18 pass; the 3 negatives fail with "accepted, but line 3 is marked" reject-on-marker -> 21 pass So the all-green state is reachable, the Ok arms are exercised, and the line mapping is right for owned-rebinding.cat, which is the one fixture with CRLF endings.typesto Scaffold semantic analysis