Skip to content

test(tokenizer): cover ENUM and GUARD keywords at both surfaces#60

Open
bbodi wants to merge 1 commit into
MadAppGang:mainfrom
bbodi:test/tokenizer-enum-guard-coverage
Open

test(tokenizer): cover ENUM and GUARD keywords at both surfaces#60
bbodi wants to merge 1 commit into
MadAppGang:mainfrom
bbodi:test/tokenizer-enum-guard-coverage

Conversation

@bbodi

@bbodi bbodi commented May 17, 2026

Copy link
Copy Markdown

Add ENUM and GUARD to two complementary tokenizer tests:

  • TestTokenIsKeyword checks the IsKeyword() predicate that classifies a TokenKind once it already exists.
  • TestTokenizeIdentifiers drives the full scanner over a source buffer and asserts the resulting TokenKind values, so it covers the keyword-lookup map that maps identifier text -> kind.

These surfaces are independent: removing "enum"/"guard" from the keyword map in tokenizer.go only breaks TestTokenizeIdentifiers, because IsKeyword() works on the TokenKind itself. Covering both catches regressions in either direction.

Add ENUM and GUARD to two complementary tokenizer tests:

- `TestTokenIsKeyword` checks the `IsKeyword()` predicate that classifies
  a `TokenKind` once it already exists.
- `TestTokenizeIdentifiers` drives the full scanner over a source buffer
  and asserts the resulting `TokenKind` values, so it covers the
  keyword-lookup map that maps identifier text -> kind.

These surfaces are independent: removing `"enum"`/`"guard"` from the
keyword map in `tokenizer.go` only breaks `TestTokenizeIdentifiers`,
because `IsKeyword()` works on the `TokenKind` itself. Covering both
catches regressions in either direction.
bbodi added a commit to bbodi/dingo that referenced this pull request May 18, 2026
…g#62 into fork main

Combines all four currently open pull requests against MadAppGang/dingo into
the local fork's main so downstream work (e.g. the nodes.go cascade fix) can
build on top of all of them without one-by-one branch juggling. The
upstream PRs remain unaffected because their base branch is MadAppGang/dingo:main,
not bbodi/dingo:main.

Included:
  MadAppGang#59 fix(ast/transform): recognise method receiver param lists for type annotations
  MadAppGang#60 test(tokenizer): cover ENUM and GUARD keywords at both surfaces
  MadAppGang#61 fix(ast/enum_parser): allow arbitrary nesting of '*' and '[]' in variant field types
  MadAppGang#62 feat(feature): add Validator plugin extension and character-level pre-transform phase
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