test(tokenizer): cover ENUM and GUARD keywords at both surfaces#60
Open
bbodi wants to merge 1 commit into
Open
test(tokenizer): cover ENUM and GUARD keywords at both surfaces#60bbodi wants to merge 1 commit into
bbodi wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add ENUM and GUARD to two complementary tokenizer tests:
TestTokenIsKeywordchecks theIsKeyword()predicate that classifies aTokenKindonce it already exists.TestTokenizeIdentifiersdrives the full scanner over a source buffer and asserts the resultingTokenKindvalues, so it covers the keyword-lookup map that maps identifier text -> kind.These surfaces are independent: removing
"enum"/"guard"from the keyword map intokenizer.goonly breaksTestTokenizeIdentifiers, becauseIsKeyword()works on theTokenKinditself. Covering both catches regressions in either direction.