You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test/lexer and test/parser are not wired into any build.w test target #563
Same shape as #559, found during its investigation: test/lexer/ (7 tests) and test/parser/ (11 tests) are referenced by no build.w target, so they never run under with build :test.
Sampled current state:
test/parser/ast_basic_decls.wpasses today.
test/lexer/lexer_keywords_test.wfails under the new pub-visibility enforcement (0c06fbd4): 'Lexer' is private to module 'src/Lexer.w', 'TokenKind' private to 'src/Token.w'.
The exclusion dates to d5ec2f11 ("Reorganize test directory"), which kept lexer/parser/internals out of the default run citing "known codegen bugs with compiler internal APIs". That reason is stale — the harness path works (proven by test/internals/conan_recipe_link_metadata_test.w and the passing parser test); the failures today are visibility, the same disease #559 documents for src/compiler/foundation/*.w.
Proposed fix
Same pattern as the #559 fix: add pub to the consumed surface of src/Lexer.w / src/Token.w (and whatever else these tests import), fix or remove any genuinely stale tests, then add lexer-tests and parser-tests Test targets (or fold both globs into one target) wired into the test group, following the internals-tests shape.
Investigation results (against 89ad31a) — full inventory, and the fix is already proven green file-by-file in a temp tree.
Status: 7/7 lexer tests fail (visibility: Lexer, TokenKind private), parser is mixed — 7 pass (pure-syntax fixtures), parser_unit_test.w fails on visibility (AstPool + friends), ast_expr_forms.w fails on its own drift (match arms written ->; grammar is =>).
Minimal pub surface — 10 declarations, empirically validated: the enforcement gates only directly-named top-level symbols; methods and fields of a pub type are reachable without their own pub. So: type Lexer (Lexer.w:71), enum TokenKind (Token.w:10), type Parser (Parser.w:15), type AstPool (Ast.w:462), enum NodeKind (Ast.w:20), enum BinaryOp (Ast.w:313), const TYPE_TRAIT_OBJECT_DYN/IMPL (Ast.w:252-253), type InternPool (InternPool.w:81), type DiagnosticList (Diagnostic.w:102). No fn pubs needed, so #559's explicit-return-type constraint doesn't bite.
API drift to fix in the same change (all verified):
lexer_fuzz_smoke_test.w:7-8 chains a mut-self method on an rvalue — now correctly rejected (§15.3); bind var l = Lexer.init(...) first.
parser_unit_test.w:150,152 — NK_TRAIT_DECL extra layout grew a 2-slot [trait_tp_count, trait_tp_start] prefix (Parser.w:2649-2651); shift offsets by 2.
ast_expr_forms.w:3-4 — -> → =>.
Stale bootstrap-era relics (coverage_manifest.txt, token_corpus.txt, ast_corpus.txt) reference dead paths; nothing uses them — delete in the same change.
Fix shape (one logical change, mirrors ef5c106): two Test targets lexer-tests / parser-tests after the internals-tests block (build.w:849-853), wired into the test group (~build.w:955), + the 10 pub markers + the 4 drift fixes. src/ changes ride the bootstrap chain, so full build/fixpoint/test gauntlet applies.
Activity
ehartford commentedon Jun 12, 2026
Investigation results (against 89ad31a) — full inventory, and the fix is already proven green file-by-file in a temp tree.
Status: 7/7 lexer tests fail (visibility:
Lexer,TokenKindprivate), parser is mixed — 7 pass (pure-syntax fixtures),parser_unit_test.wfails on visibility (AstPool+ friends),ast_expr_forms.wfails on its own drift (match arms written->; grammar is=>).Minimal pub surface — 10 declarations, empirically validated: the enforcement gates only directly-named top-level symbols; methods and fields of a pub type are reachable without their own pub. So:
type Lexer(Lexer.w:71),enum TokenKind(Token.w:10),type Parser(Parser.w:15),type AstPool(Ast.w:462),enum NodeKind(Ast.w:20),enum BinaryOp(Ast.w:313),const TYPE_TRAIT_OBJECT_DYN/IMPL(Ast.w:252-253),type InternPool(InternPool.w:81),type DiagnosticList(Diagnostic.w:102). No fn pubs needed, so #559's explicit-return-type constraint doesn't bite.API drift to fix in the same change (all verified):
TokenKind.TK_EOF()paren-call style — passescheckbut fails codegen ("aggregate rvalue missing destination struct type"). Fix: strip parens. The sema-accepts/codegen-rejects mismatch itself is filed as Enum variant referenced with call parens (Color.Red()) passeswith checkbut fails codegen #566.lexer_fuzz_smoke_test.w:7-8chains a mut-self method on an rvalue — now correctly rejected (§15.3); bindvar l = Lexer.init(...)first.parser_unit_test.w:150,152— NK_TRAIT_DECL extra layout grew a 2-slot[trait_tp_count, trait_tp_start]prefix (Parser.w:2649-2651); shift offsets by 2.ast_expr_forms.w:3-4—->→=>.coverage_manifest.txt,token_corpus.txt,ast_corpus.txt) reference dead paths; nothing uses them — delete in the same change.Fix shape (one logical change, mirrors ef5c106): two Test targets
lexer-tests/parser-testsafter the internals-tests block (build.w:849-853), wired into the test group (~build.w:955), + the 10 pub markers + the 4 drift fixes. src/ changes ride the bootstrap chain, so full build/fixpoint/test gauntlet applies.