Repository navigation
Author std/lexing.dag + std/grammar.dag: move LexRule/Grammar/Production canonical types out of compiler/tokenize.dag + compiler/parse.dag into new std/ homes so compiler and extdeps both import std, neither imports the other - #3807
Conversation
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
c470fb0e· Trigger:schedule - Thinking:
233s wall
BLOCKING (1)
Root Cause
src/v4/std/lexing.dagLexRule moved from compiler-local implementation into std without moving its token-class membership query onto a canonical model fact/accessor or adding the required Practice 10 disposition.
| } | ||
|
|
||
|
|
||
| fn lex_rule_token_class_member(rule: LexRule, token_class: Symbol) -> Bool { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
|
Verified against current head 4266c0a. The c470fb0 finding is addressed by commit 4266c0a, which adds a tracked Practice 10 predicate-dissolution marker above |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
be8ba7c1· Trigger:schedule - Thinking:
155s wall
Non-blocking — Strengths
src/v4/std/grammar.dagThe new Grammar and GrammarExpr substrate coproducts keep explicit yellow dissolution gates tied to the bidirectional grammar carrier work.
ROADMAP — Verified
- T-6/T-7: The PR moves lexical and grammar carriers into std so compiler and extdeps consume the shared vocabulary rather than importing each other.
✅ The prior predicate concern is resolved and I found no blocking issues in the changed surface.
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
d85a22c2· Trigger:schedule - Thinking:
269s wall
BLOCKING (2)
Root Cause
src/v4/compiler/02_parse.daggrammar carrier extraction moved authorities into std without auditing every remaining parse.dag constructor/projection use → import the still-used std.node and std.grammar symbols in the same migration.
ROADMAP — Verified
- T-6.1: The lex_rule_token_class_member bridge is now tracked with an owner lane, bounded interim surface, and dissolve-on-arrival trigger.
- T-7.1: The grammar_expr_to_node walker is tracked with an owner lane, bounded interim surface, and dissolve-on-arrival trigger.
| import v4.compiler.tokenize { LexRules, Token, TokenStream } | ||
| import v4.std.diagnostic { Accepted, Diagnostic, Diagnostics, ExternalContractUnknown, Locus, NonEmptyDiagnostics, None, Outcome, Some, Unavailable, UserInputBoundary, diagnostics_singleton, port_locus } | ||
| import v4.std.node { Atom, Conj, Edge, Named, Node, NodeFold, Symbol, TypeNode, fold_node, well_formed } | ||
| import v4.std.node { Conj, Edge, Named, Node, Symbol, TypeNode, well_formed } |
There was a problem hiding this comment.
BLOCKING: The new std.node import drops Atom even though parse_expr still constructs Atom at line 640, leaving the parse stage uncompilable after the carrier migration.
| type ValidatedGrammarRoot { | ||
| root: GrammarRoot | ||
| import v4.std.lexing { Token, TokenStream } | ||
| import v4.std.grammar { |
There was a problem hiding this comment.
BLOCKING: The new std.grammar import omits grammar_repeat_element_node_projection even though parse_repeat_captured_node still uses it at line 576, so the grammar extraction leaves a downstream dependency unsatisfied.
…comment; merge main after #3807 moved function from 02_parse.dag to std/grammar.dag
Point rust_wave2_grammar_structure at v4.std.grammar/lexing helpers per #3807 boundary discipline. Model Rust Reference IfExpression else tail (BlockExpression | IfExpression) and register else lexeme. Co-authored-by: Cursor <cursoragent@cursor.com>
…a excluded) (#3801) * WIP: T-4.17 Wave 2a: rust lex/grammar data fill (deps T-6/T-7/T-4; cpp/java e * WIP: T-4.17 Wave 2a: rust lex/grammar data fill (deps T-6/T-7/T-4; cpp/java e * fix(rust): wave-2 grammar fidelity for comparison and block syntax Comparison uses Optional (at most one `>`) per Rust Reference non-chaining relational operators. Blocks split semicolon-terminated expression statements from a single optional tail expression (return/comparison), matching §17.11. Addresses blocking api-review on PR #3801 (ecbd4d8). Co-authored-by: Cursor <cursoragent@cursor.com> * WIP: T-4.17 Wave 2a: rust lex/grammar data fill (deps T-6/T-7/T-4; cpp/java e * fix(rust): wire return/let/if operands to unified Expression ReturnExpression uses Expression?; LetStatement uses = Expression; if condition uses Expression; ExpressionWithBlock includes block expressions. Factors one Expression graph per Rust Reference. Addresses blocking api-review on PR #3801 (896aaa6). Co-authored-by: Cursor <cursoragent@cursor.com> * fix(rust): wave-2a claim std imports and if-else grammar Point rust_wave2_grammar_structure at v4.std.grammar/lexing helpers per #3807 boundary discipline. Model Rust Reference IfExpression else tail (BlockExpression | IfExpression) and register else lexeme. Co-authored-by: Cursor <cursoragent@cursor.com> * WIP: T-4.17 Wave 2a: rust lex/grammar data fill (deps T-6/T-7/T-4; cpp/java e * WIP: T-4.17 Wave 2a: rust lex/grammar data fill (deps T-6/T-7/T-4; cpp/java e * WIP: T-4.17 Wave 2a: rust lex/grammar data fill (deps T-6/T-7/T-4; cpp/java e * fix(rust): formal block tail-only expr and Bool lhs search Add FormalProduction for `{ Expression }` blocks (Rust Reference §17.11). Replace RustFormalLhsSearchState coproduct with Bool fold via typed rust_formal_production_matches_lhs helper (M9 dissolution). Co-authored-by: Cursor <cursoragent@cursor.com> * fix(rust): wire MVP-1 FormalProduction into wave-2 list Include rust_formal_production_mvp1_fn_add() in rust_wave2_formal_productions so rust_formal_rhs_from_tokens has a consumer; extend structure claim. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(rust): layout-free wave-2 lex and param_list formal alignment Strip embedded whitespace from wave-2 keyword/operator lexeme spellings; rely on WhitespaceChar trivia. Align FormalProduction param_list with operational grammar (no trailing comma via param_list_suffix). Add return; and tight-layout parse claim fixtures (T-22 deferred). Co-authored-by: Cursor <cursoragent@cursor.com> * WIP: T-4.17 Wave 2a: rust lex/grammar data fill (deps T-6/T-7/T-4; cpp/java e * fix(rust): layout-free plus lexeme for wave-2 tight fixtures Change rust_token_plus LiteralPattern from " + " to "+" so rust_wave2_lex_rules (wave-1 + wave-2) tokenizes x+1 in layout-tight claims; whitespace trivia separates tokens. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
Auto-opened by session-dashboard for session
keen-seal-346.Pushing to
session/keen-seal-346advances this PR.Worker attestation
Before flipping this PR to ready for review, confirm each item:
npm test,cargo test) and the result.Closes #Ndirective.Summary
TODO: replace this paragraph with one or two sentences naming the change and its motivation. Reviewers read this first.
Test plan