Skip to content

phase2/01: per-TU LexicalSession with typedef/enum registries - #92

Merged
rieske merged 1 commit into
masterfrom
phase2/01-lexical-session
Jul 30, 2026
Merged

phase2/01: per-TU LexicalSession with typedef/enum registries#92
rieske merged 1 commit into
masterfrom
phase2/01-lexical-session

Conversation

@rieske

@rieske rieske commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Introduce stack-owned per-translation-unit LexicalSession holding TypedefRegistry and EnumConstantRegistry (no process-static maps).
  • Wire factory → Scanner → FA: keyword lookup first, then has(name) emits typedef_name.
  • FA does not consult identifier shadows (TokenStream owns that in later slices). Sessions are single-shot (no reset API).

Stack

Phase 2 PR 1 of 6 (base: master).

# Branch
01 phase2/01-lexical-session (this PR)
02 phase2/02-lex-id-context
03 phase2/03-parse-environment
04 phase2/04-enums
05 phase2/05-typedef
06 phase2/06-scanner-filters

Test plan

  • Unit pins: per-TU isolation, keyword-over-typedef, FA ignores shadows, last-wins, file-scope auto-root / empty-pop
  • Full ctest green on stack tip

Add TypedefRegistry and EnumConstantRegistry owned by LexicalSession.
Wire FiniteAutomaton typedef_name feedback, Scanner session, and Compiler
ownership so later typedef/enum work is instance-scoped, not process-static.
@mergify

mergify Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@rieske
rieske merged commit 0a98c54 into master Jul 30, 2026
4 checks passed
@rieske
rieske deleted the phase2/01-lexical-session branch July 30, 2026 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant