Skip to content

feat: Update Dart BNF grammar and Grammar-Kit plugin#180

Open
jwren wants to merge 1 commit intoflutter:mainfrom
jwren:bnf-presubmit
Open

feat: Update Dart BNF grammar and Grammar-Kit plugin#180
jwren wants to merge 1 commit intoflutter:mainfrom
jwren:bnf-presubmit

Conversation

@jwren
Copy link
Member

@jwren jwren commented Jan 2, 2026

  • Update org.jetbrains.grammarkit to 2023.3.0.1.
  • Regenerate parser and lexer files with the new plugin version.
    • Note: The new version introduces recursion_guard_ and renames variables (e.g., b -> builder_) in the generated parser.
  • Configure generateDartParser task to include instrumented classes and compile classpath to correctly resolve DartPsiImplUtil methods during generation.
  • Add verify-parser job to presubmit.yaml to ensure generated files are up-to-date.

@jwren jwren requested review from helin24 and pq January 2, 2026 23:44
- Update `org.jetbrains.grammarkit` to `2023.3.0.1`.
- Regenerate parser and lexer files with the new plugin version.
  - Note: The new version introduces `recursion_guard_` and renames variables (e.g., `b` -> `builder_`) in the generated parser.
- Configure `generateDartParser` task to include compiled classes (via `sourceSets["main"].output`) to correctly resolve `DartPsiImplUtil` methods during generation.
- Add `verify-parser` job to `presubmit.yaml` to ensure generated files are up-to-date.
  - Runs `./gradlew classes` before generation to ensure dependencies are built.
- Remove `_DartDocLexer` as it is now handled by the main lexer generation.
@pq
Copy link
Collaborator

pq commented Feb 4, 2026

I'd love to walk through this... Wanna fix the merge conflict so it's ready to go?

@jwren
Copy link
Member Author

jwren commented Feb 4, 2026

Yes, I'll try to do this soon, and we can walk through it together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants