Skip to content

feat: support Java 25 imports and constructor prologues - #19

Merged
exKAZUu merged 2 commits into
mainfrom
feat/java25-declarations
Oct 18, 2026
Merged

exKAZUu merged 2 commits into
mainfrom
feat/java25-declarations

Conversation

@exKAZUu

@exKAZUu exKAZUu commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

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

  • required: Improve the fork by addressing eligible upstream items in dedicated, nonduplicate PRs; backward compatibility is not required.
  • chosen: Support Java 25 module import declarations and flexible constructor bodies together because both are the outstanding syntax additions from the same upstream PR.
  • required: Preserve ordinary and static import declarations and explicit constructor invocation nodes.
  • chosen: Permit statements before and after one explicit constructor invocation, following JLS 25 section 8.8.7; leave early-construction semantic restrictions to Java compilers.
  • chosen: Parse module names with the existing qualified-name rule, following JLS 25 section 7.5.5, while excluding wildcard and static module imports.

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 verify pass. Annotated receiver regressions also pass after integrating the current base. Full platform tests run in PR CI.

exKAZUu and others added 2 commits October 19, 2026 04:30
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
@exKAZUu exKAZUu self-assigned this Oct 18, 2026
@exKAZUu
exKAZUu merged commit c0f0f10 into main Oct 18, 2026
10 checks passed
@exKAZUu
exKAZUu deleted the feat/java25-declarations branch October 18, 2026 22:22
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