Repository navigation
feat: support Java 25 imports and constructor prologues - #19
Merged
Merged
Conversation
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
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.
Why
Java 25 module imports and statements before an explicit constructor invocation produce syntax errors. This addresses the remaining grammar additions in
tree-sitter/tree-sitter-java#233; final type patterns and qualified record patterns are already supported by this fork.Requirements
Customer Summary
Java 25 module imports and constructor prologues parse without errors. Explicit constructor invocations remain identifiable after edits that insert or remove prologue statements.
Technical Summary
The import rule distinguishes module imports from ordinary and static imports. Constructor bodies permit statement sequences around an optional explicit invocation. The parser is regenerated with the repository's corpus profile.
Testing
Two public Wasm tests fail against published 3.0.3 and pass with the grammar change. They cover module-name boundaries, ordinary/static import controls, invalid module import forms, qualified and generic constructor invocations, and incremental versus fresh tree structure. Corpus fixtures exercise both additions. The canonical Wasm build, 144 native and Wasm corpus cases, 2,000 focused fuzz iterations, and
bun run verifypass. Annotated receiver regressions also pass after integrating the current base. Full platform tests run in PR CI.