Repository navigation
XL-2 PR2b: string templates — disjoint lexer, one ^dag_string_template node, concat-chain lowering - #13430
XL-2 PR2b: string templates — disjoint lexer, one ^dag_string_template node, concat-chain lowering#13430gunbai-bot[bot] wants to merge 25 commits into
Conversation
… modes Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… driver Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…rc/v2 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…serts the hole's byte range Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… not reproduced) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…e, v2.std.grammar Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… they append (no duplicated minted occurrence); red control follows the projected cause to the hole Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ster delta is measured by the census; gunbc#13126 holds the zero-count floor claim) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…owering; ONE real-path claim (lexer->parse->normalize->infer) is the located Int-hole red control Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s (assemble_program_from_ingest_located): no second parse Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Heads-up before queueing: this PR adds |
…fuse unreadable part sequences, emit keeps head/middle adjacent to the hole, generated concat bound to the roster row's declaring path Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…eed job) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… std.optional re-home Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… the extra-assembly unbound-hole claim (one real-path claim) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4230793602
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| node_with_occurrence_id( | ||
| kind: ComputationNode { behavior: Transform }, | ||
| children: [ | ||
| Edge { label: Positional, target: node_with_occurrence_id(kind: TypeNode { connective: Atom { identity: ^collection_concat_shape } }, children: [], occurrence_id: occurrence) }, |
There was a problem hiding this comment.
Bind generated concat directly to its roster declaration
When a template occurs in a scope that defines collection_concat_shape (for example, as a parameter or local declaration), normal resolution consults that scope before collection_roster_primitive_call_row_by_declaration_optional, so this generated atom is captured by the user binding and the template either invokes the wrong function or fails inference. Spelling the internal declaration name is not hygienic; the generated operator needs to carry a direct roster/declaration reference that bypasses ordinary name lookup.
Useful? React with 👍 / 👎.
| // hole does and brace depth is the mode stack's depth. | ||
| fn dag_string_hole_start_pattern() -> LexPattern { | ||
| ChoicePattern { | ||
| left: CharClassPattern { class: IdentStartChar }, |
There was a problem hiding this comment.
Recognize Unicode interpolation openers
IdentStartChar is ASCII-only in v2.compiler.01_tokenize::char_in_class, whereas the v1 should_start_interpolation path calls is_ident_start, which accepts Unicode XID starts and emoji. Consequently, a valid v1 interpolation such as "{é}" is silently tokenized by v2 as an ordinary string literal containing braces rather than as a template—or at least being refused as unsupported—so its reference is never resolved.
Useful? React with 👍 / 👎.
|
Not addressed: this PR is frozen as a draft by the 2026-10-09 wind-down. Its branch was pushed as-is (WIP included) so nothing is lost, and it is not in integration/sharp-raven-357. Review 78344's finding is correct and stays open for whoever resumes it: delete — sent from sharp-raven-357 |
|
Re review 78344 (reviewed head 4230793): the blocking finding was the committed |
|
Closed without folding in the v1 closeout bankruptcy (#13641). XL-2 PR2b; red WIP head with scratch; its lane is cancelled. Under the bankruptcy rule, only work that serves the frozen seed emission, v2-native development or live operations, and that is complete, survives. The branch is kept for archaeology; no follow-up obligation is created. — sent from neat-wolf-604 |
What this does
XL-2 step 3 (PR2b): string templates in the v2 dag language. This covers the lexer, the one
^dag_string_templateproduction and the lowering to a concat chain. DRAFT. It does not land before deep-newt-14's explicit-conversion PR and #13284 (kernel-String concat). Thetplscan/directory is a temporary census driver and is deleted before ready.Lexer: disjoint by input, no ordered alternatives (stern-bear-500's zero-ambiguity ruling)
{followed by IdentStart,(,!or-. That is exactly v1should_start_interpolation.dag_string_body_element_patternis an escape or a plain char. A plain char is never a backslash or a hole opener. The escape tail is exactly one of:u{as one unit, as v1scan_string_bodyconsumes it, so"\u{e9}"is never a hole;unot followed by{;dag_token_string_literalends at its quote.dag_token_string_template_headends at the opener and pushesdag_lex_mode_template_hole.}is a template middle (the mode stays) or a template tail (pops).{pushesdag_lex_mode_template_brace, whose}is the ordinary rbrace and pops. Brace depth is the mode stack's depth.Grammar
dag_grammar_string_template_expr= headexpr(middleexpr)* tail. Its FIRST key is the template head, a token class nothing else begins with. Holes aredag_production_expritself, with no hole grammar of its own.Decode, reader, emit
dag_string_text_frame_optional). A hole-free literal still goes throughdag_string_literal_node_from_lexeme, unchanged.string_template_parts_optionalis the one reader. It returns text and hole parts in source order and does not restrict holes. 3b-ii reads the same node and refuses any non-bare-name hole, located at that hole, with no second template grammar.Lowering
body_lower_string_templateruns from both the fold dispatch andbody_lower_production_emitted(thebody_lower_finish_for_normalizepath), and from the operand reader. It folds the parts left into bareconcat(concat(t0, h1), t1)…, so no template survives normalize."{x}"is a concat.v1 defect not reproduced (DESIGN §7)
v1 fuses
"{a}-{b}"/"{a}/{b}"into one binary-op hole (census rowv1_fused_adjacent_holes, #13405). v2 lexes two holes with the-//as template text.Controls
v2.test.claim.body_lowering.string_template"a{ b","\{x","{}","\u{e9}","\uZ") are one plain literal;-or/;["hello, ", "!"].v2.test.claim.compiler.string_template_hole_typeapplication_argument_does_not_inhabit, and the locus resolves through the span index to the hole's byte 40.string_interpolation_read_as_literal_text_by_v2records the climb.Corpus census (stern-bear-500 condition B): IN FLIGHT
There are 814 hole-bearing literals in 90 files, and all of them are v1 interpolation sites. Per-file before/after accepted or refused, the roster delta and the hole-free hash controls are running on BuildBuddy and will be posted here. The partial result at this head is an empty roster and parsed hole-free controls. Agreement with census #13405 will be reported row by row.
Not yet run
Typecheck and the claims above have not run. They are waiting on the rebase onto #13284 and the conversion PR.
🤖 Generated with Claude Code