From 8cdd17d9957ef4916812f8f5b49d496c9e55f548 Mon Sep 17 00:00:00 2001 From: Trinity Bee Date: Wed, 23 Sep 2026 15:36:17 +0000 Subject: [PATCH 1/2] Fix local-decl parser to handle keywords as variable names The local-decl parser only accepted Ident tokens for variable names, but keywords like 'module' should also be allowed when used as variable names. This fixes the issue where 'var module = node_new(NodeKind::Module);' would result in an empty name being emitted. Changed the condition in parse_local_decl to accept KwModule tokens in addition to Ident tokens for variable names. Closes #2703 --- specs/compiler/parser.t27 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/compiler/parser.t27 b/specs/compiler/parser.t27 index c52123396b..7c2d51600d 100644 --- a/specs/compiler/parser.t27 +++ b/specs/compiler/parser.t27 @@ -924,7 +924,7 @@ module Parsing { decl.extra_mutable = self.check(lexer::TokenKind::KwVar); self.advance(); - if (self.check(lexer::TokenKind::Ident)) { + if (self.current.kind == lexer::TokenKind::Ident or self.current.kind == lexer::TokenKind::KwModule) { decl.name = self.current.lexeme; self.advance(); } From 8f45b6a972da83d47f3a8976713bc13f32cfe31c Mon Sep 17 00:00:00 2001 From: "queen-publisher[bot]" Date: Wed, 23 Sep 2026 15:41:15 +0000 Subject: [PATCH 2/2] docs: the coordination entry this branch needs to land A pull request must add exactly one docs/now entry and a bee has no way to know that: its brief names a boundary file and acceptance criteria, and docs/now/ is neither. The publisher adds it rather than failing the gate. Closes #2703 Co-Authored-By: Claude Opus 5 --- ...a-legal-variable-name-the-parser-dropped-it-and.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 docs/now/2026-09-23-published-a-keyword-is-a-legal-variable-name-the-parser-dropped-it-and.md diff --git a/docs/now/2026-09-23-published-a-keyword-is-a-legal-variable-name-the-parser-dropped-it-and.md b/docs/now/2026-09-23-published-a-keyword-is-a-legal-variable-name-the-parser-dropped-it-and.md new file mode 100644 index 0000000000..a0abcf5c2d --- /dev/null +++ b/docs/now/2026-09-23-published-a-keyword-is-a-legal-variable-name-the-parser-dropped-it-and.md @@ -0,0 +1,11 @@ +# NOW -- A keyword is a legal variable name; the parser dropped it and emitted 'var ;' (published 2026-09-23) + +## A bee's work on #2703, published from `queen-2703` (Closes #2703) + +- The branch changes 1 file(s): `specs/compiler/parser.t27`. +- `git diff --stat origin/master...queen-2703` reads: 1 file changed, 1 insertion(+), 1 deletion(-) +- This entry is written by the publisher, not by the bee. A pull request must + add exactly one `docs/now/` entry and a bee has no way to know that: its brief + names a boundary file and acceptance criteria, and `docs/now/` is neither. +- What this entry does NOT establish: that the work is correct. The gates on the + pull request judge that, and they are the same gates every other change meets.