-
Notifications
You must be signed in to change notification settings - Fork 586
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Java] Fix default method modifier (#3439)
* [Java] Fix default method modifier scope Fixes #3438 This commit re-orders `declarations` and `statements` contexts to ensure to first consume `default Type method()` declarations, which is required to properly scope `default` keyword in that context. That change revealed `yield` being missing in `control_keywords` which caused it to be scoped `storage.type` in some contexts by accident. That's fixed to keep syntax tests passing. * [Java] Adjust modifier scopes This commit renames scope of `default` and `throws` keyword in context of defining method attributes to `storage.modifier`. Motivation 1. `default` is scoped `storage.modifier` in front of default method declarations and `keyword.control` in switch-case statements. A third scope for the same keyword is probably too much and may feel inconsistent. 2. `extends` or `inherits` keywords, which are used in exactly the same position (related context with regards to class/interface declarations) are scoped `storage.modifier`. 3. scope of `throws` keyword is adjusted, too, because of 2.) and to keep in consistent with scope of `default` in same position.
- Loading branch information
Showing
2 changed files
with
51 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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