Result: partial Files: crates/nikaia-std/src/tools/parser_grammar.nika crates/nikaia-std/src/tools/lowered/parser_grammar.rs crates/nikaia-std/src/tools/lowered.rs tests/compiler/tests/parser_grammar_trivia.nika tests/compiler/tests/parser_grammar_trivia.stdout tests/compiler/tests/parser_grammar_words.nika tests/compiler/tests/parser_grammar_words.stdout Commit: parser: the trivia and word rules in tools/parser_grammar.nika (#557 step 4c) Body: Step 1 of chunk 1: WSE WS COMMENT BLOCK_COMMENT BLOCK_INNER, the /// doc rule (DOC_LINE, docs: one space stripped, lines joined, comments and blank lines between them kept in the run; a stray /// is no trivia, ADR-339 D4), the 51 KW_, RESERVED/A/B/C, NAME (a winnow_grammar::Symbol through ident) and UNDERSCORE, plus a tokens scan entry and pg_render/pg_count to read the rules through. same_line and here are the grammar language’s (ADR-339 D1, D2). Comment list (ADR-337 D2): a grammar has no state, so WS records nothing; the list is to be a lexical scan of its own over COMMENT, BLOCK_COMMENT and the literals, each comment a span, built with the literal rules. Trailing-trivia cut (ADR-383): none needed, the generator skips trivia before an element and never after one, so span(as b) in a as b c is 2..6 by construction. Differences from the Rust grammar: a line break inside a block comment counts for same_line (the lowering’s LineBreaks wraps all of WS); an unclosed /* is refused at the end of input (“expected */”) and parse_errors.nika’s rewrite to the opening stays the compiler’s. Comparing the grammars later, Nikaia only: a tests/compiler program runs pg_render over every tests/compiler and tests/errors program and checks it against nikaia check accepting or refusing (the refusal’s line and column); a token- or tree-level comparison needs a dump of the Rust parse that no subcommand prints. scripts/self_hosting.py row: “parser_grammar.nika”: “parser: the compiler’s grammar in Nikaia, lexical rules (#557 step 4c)”. Part: #557 Tests: tests/compiler –both-settings 582 passed 0 failed (580 + parser_grammar_trivia, parser_grammar_words); it – parse grammar span 147 passed; guard sequences::the_corpus_has_no_more_unanswered_method_calls passes; tests/errors untouched (no compiler change) Gate: build, lower-std fixpoint (lowered unchanged on second run), cargo fmt, clippy –all-targets -D warnings clean, pre-push green Deviation: step 2 (STRING STR_CHAR CHAR CHAR_BODY F_STRING family DIGITS DIGIT_GROUP FLOAT EXPONENT, numbers through parse_numbers, SEGMENT G_BUILTIN) and the comment-list scan not done: turn budget; F_HOLE needs expr, a syntactic rule of a later chunk, so the f-string family cannot be whole in this chunk Found: (1) checker: rule R -> String = n:raw_ident -> { n.clone() } | "_" -> { "_" } gives NK1104 (action builds ref String) and with .clone() NK1301 (clone of a literal adds nothing): no form passes (ledger.nika answers with -> ref String); (2) a name bound inside a labelled s:span(KW_AS n:NAME) is “Cannot find value n”, though 10.8 says a labelled span binds its inner names; (3) ident Symbols come from a ParseContext interner dropped after the entry returns, so a tree of Symbols from a Nikaia entry cannot be resolved by its caller (the Rust Parsed keeps its interner) Needs: supervisor decision on (3) before the syntactic chunks; (1) and (2) filed as defects; a builder for step 2 Changelog: none Owner: none Disk freed: target/nikaia-project-tests removed (free space was under 3 GB); / now 4.6G free; no new cache entry over 100 MB Rs2nika: none Attribution: Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Claude-Session: https://claude.ai/code/session_01GFeMqxRbtUMiGVyDMxsvEq Pushed: local 0479949f9a1613d5ff9982e3e97b50c09dbd9a00

This site is open source. Improve this page.