Repository navigation
Conversation
A new tier-0 crate, item 7.3 first half (contracts before code). The AST is an arena of nodes with spans, whose kinds are named after the productions of ECMA-262 (§13 to §16), children before parents, optional symbols as Absent nodes. Joins PLACES as a Renderer crate; its only dependency is vstd. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tion, as a spec spec.rs transcribes ECMA-262's §13 to §16 as a relation between an arena AST and a token stream (d, one arm per node kind, the grammar parameters as Ctx), with the lexer abstracted behind LexerSpec, and §12.10.1's rules as gap_justified: an inserted semicolon is justified when no sentence of the grammar without insertion begins with the tokens before it and the offending token. The recursion limit is MAX_DEPTH, a listed deviation. The file's header lists what is covered, what is left out, and every modelling choice. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… spec early states each "It is a Syntax Error if" rule of the clauses it cites (identifiers, literals, assignment targets, names declared twice, labels and break/continue targets, strict mode, super and new.target, parameters, classes and private names, modules) over the AST, with what a rule reads off a node's position carried down as EarlyEnv. is_valid_parse is a parse of the source by the grammar with no early error: the relation the parser's contract is stated by. What is not yet specified is listed in the header. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…roven examples contract.rs: parse_requires (none: the parser is total) and parse_ensures: an Ok is a well-formed arena with spans inside the source, a valid parse of it, within MAX_DEPTH; an Err means no valid parse within the limit, and Syntax means none at all. api.rs: the body-less trait JsParser<L: LexerSpec>, with no escape hatch. examples.rs: seven small proofs about the spec. There is no parser yet; the tier stays 0. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
atiernan
had a problem deploying
to
full-verification
November 17, 2026 16:15 — with
GitHub Actions
Error
CI's proof job requires a mutations.json for every crate Verus checks. Three mutations (`??` mixing with `||`, a unary base for `**`, the do-while semicolon inserted anywhere), each killed by an existing proven example. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
atiernan
had a problem deploying
to
full-verification
November 17, 2026 21:10 — with
GitHub Actions
Error
span_ok put an empty node at the end of the token before it. An Absent
first child (`import {a} from 'm'`, the `{a}` import specifier) then
fell outside its parent whenever white space came between, so the
grammar's d and spans_wf could not both hold. An empty node may now sit
anywhere in the white space before its token.
§15.7.1's "ContainsAwait of ClassStaticBlockStatementList" rule was
missing: `await 0` or `for await` in a static block inside an async
function parsed. The static block now sets no_yield_await, which
ContainsAwait matches (it does not look inside functions or async arrow
bodies), and a `for await` is an error where it is set.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
atiernan
had a problem deploying
to
full-verification
November 18, 2026 14:10 — with
GitHub Actions
Error
atiernan
temporarily deployed
to
full-verification
November 20, 2026 14:25 — with
GitHub Actions
Inactive
atiernan
requested a deployment
to
full-verification
November 20, 2026 20:26 — with
GitHub Actions
Queued
This branch is being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 7 item 7.3, first half:
clazel-js-syntax, the parser's spec and contracts (rule 3). There is no parser implementation yet. The crate stays at tier 0, and its target tier is 1.This PR is part of stack #188, on top of #186.
What's here
src/ast.rs: an arena AST with spans, covering scripts and modules, with about 150 node kinds named after the standard's productions.Absentnode.src/spec.rs: about 3,900 lines.d(ast, toks, n, ctx, i, j), with one arm per node kind.Ctxcarries[Yield],[Await],[In],[Return]and[Default].MAX_DEPTH = 1024, a listed deviation.is_parseis the grammar relation, andis_valid_parseadds the early errors to it.src/contract.rsandsrc/api.rs:JsParser::parse(src, goal), on a body-less trait with no escape hatch.Ok: the arena is well formed, every span lies inside the source, the result is a valid parse, and its height is at mostMAX_DEPTH.Err: no valid parse exists within the limit, andSyntaxmeans no valid parse exists at all.src/examples.rs: seven small proofs.;.a ?? b || cand-a ** b.breakoutside a loop, andwithin strict code.;consumes no token.For the spec reviewer, first
LexerSpec, and the contract is stated relative to it. The second half of 7.3 must instantiate it withclazel-js-lexer'snext_tokencontract.;lives in a gap between tokens, so no span covers text that isn't in the source.do-whileis rule 1's third condition, which is where the pinned text puts it.EarlyEnvfollows howdpassesCtx. If the two get out of step, a rule is weakened without any error showing, so this is the likeliest place for findings.choose, andspan_okthen checks that span.CoverInitializedNameis always an early error.?.followed by a template is in the grammar and is always an early error. Without it, ASI would wrongly splita?.bfollowed by a newline and a template (§13.3.1.1).lvlcompresses the precedence chain into one number per node kind.??,**and#x in yare special cases.Tok::name. Thelegacyflag isn't in the lexer'sValue::String.Not covered (listed at the top of
spec.rs)for (var e of …)insidecatch (e).eval.regexp_literal_validfrom the lexer trait.Nothing about the spec's totality, determinism or agreement with the standard is proven. The evidence so far is the seven examples and the line-by-line citations. The section numbers were checked against an ES2026
spec.html, but that copy was not confirmed to be the pinned commit, so a reviewer should check them against the pin.Verification
verification results:: 57 verified, 0 errors.cargo xtask check: STATIC CHECKS PASSED.-D warningsand rustfmt: clean.cargo xtask verify --changedwas not run locally, because the new crate changesCargo.lock. CI's full verification is the check, and its proof jobs need approval.🤖 Generated with Claude Code