Result: done Files: crates/nikaia/src/parser/mod.rs crates/nikaia-std/src/grammar.rs crates/nikaia-std/src/tools/ast.nika crates/nikaia-std/src/tools/check_core_pilot.nika crates/nikaia-std/src/tools/check_grammar.nika crates/nikaia-std/src/tools/check_imports.nika crates/nikaia-std/src/tools/emit_core_match.nika crates/nikaia-std/src/tools/emit_grammar.nika crates/nikaia-std/src/tools/emit_holes.nika crates/nikaia-std/src/tools/emit_pattern.nika crates/nikaia-std/src/tools/emit_state.nika crates/nikaia-std/src/tools/fold_bound.nika crates/nikaia-std/src/tools/grammar_types.nika crates/nikaia-std/src/tools/lowered.rs crates/nikaia-std/src/tools/lowered/ast.rs crates/nikaia-std/src/tools/lowered/check_core_pilot.rs crates/nikaia-std/src/tools/lowered/check_grammar.rs crates/nikaia-std/src/tools/lowered/check_imports.rs crates/nikaia-std/src/tools/lowered/emit_core_match.rs crates/nikaia-std/src/tools/lowered/emit_grammar.rs crates/nikaia-std/src/tools/lowered/emit_holes.rs crates/nikaia-std/src/tools/lowered/emit_pattern.rs crates/nikaia-std/src/tools/lowered/emit_state.rs crates/nikaia-std/src/tools/lowered/fold_bound.rs crates/nikaia-std/src/tools/lowered/grammar_types.rs crates/nikaia-std/src/tools/lowered/node_numbers.rs crates/nikaia-std/src/tools/node_numbers.nika tests/compiler/tests/grammar_members_a_member_twice_fails.nika tests/compiler/tests/grammar_members_a_member_twice_fails.stdout tests/compiler/tests/grammar_members_a_missing_field_fails.nika tests/compiler/tests/grammar_members_a_missing_field_fails.stdout tests/compiler/tests/grammar_members_an_unknown_member.nika tests/compiler/tests/grammar_members_an_unknown_member.stdout tests/compiler/tests/grammar_members_builds_a_struct.nika tests/compiler/tests/grammar_members_builds_a_struct.stdout tests/compiler/tests/grammar_members_null_into_a_field_that_takes_none_fails.nika tests/compiler/tests/grammar_members_null_into_a_field_that_takes_none_fails.stdout Commit: grammar: members[S] builds a struct by the mapping rule (ADR-grammar-2 D3, D5) Body: membersS parses to Pattern::Members; grammar_types copies the value rule per field of S (S must be a struct the grammar’s file declares, else NK1164) and lowers to helper rules __nikaia_members_N{,_all,_more,_one,_value(i)} that gather each member as Option<Option> and apply the mapping rule (default, else null in T?, else fail; null into a non-T? field takes the default, else fails; twice fails; unknown fails unless unknown: names a skip rule), key dispatch by nikaia_std::grammar::member_index. Errors: "the field `x` is missing / is given twice / takes no null", "the member `z` names no field"; the twice/missing ones point at the end of the members, and the rendered stack still names the internal __nikaia_members_* rules (the stack path is a later step). To copy per field, match T::kind now takes `Struct(_)` (check_core_pilot, emit_core_match, grammar_types: a `_` part binds nothing; it was NK1250). The null:/unknown: rule names are not yet checked by the checker. Expected .stdout files are what the programs print. Part: #1019 Pushed: local 20a79c9375f96dea75c83a7d130f51663634b01b Tests: the 5 new grammar_members_* fail on the old compiler (parse error at members' `,`) and pass --both-settings on the new; all 44 *grammar* tests and the 7 other ::kind tests pass; lower-std fixpoint clean; clippy (1.97, 1.99.1 not installed), cargo fmt, pre-push-check green; no lib unit tests in parser::/grammar:: Gate: none Deviation: none Found: lowering defect: in grammar_types.nika a local `let name = f"{words.resolve(x)}"` passed as `work.structs.get(name)` (BTreeMap[String,_]) is kept in a tether Keep frame and lowers to `.get(&name)` with name: &String, rustc E0277 `String: Borrow<&String>`; avoided by passing words.resolve(x) directly as grammar_types_put does Needs: none Changelog: `members[S](key, value, sep; null:, unknown:)` in a grammar builds the struct S from keyed members by the mapping rule of ADR-grammar-2 D3, D5: a missing field takes its default or null, a member given twice or an unknown member fails, with a message naming the field or key. Owner: none Disk freed: none (cache 3.6G, 11G free on /, no new entry over 100 MB) Rs2nika: none

This site is open source. Improve this page.