prettier-java icon indicating copy to clipboard operation
prettier-java copied to clipboard

Align use of var keyword with the spec

Open clementdessoude opened this issue 6 years ago • 1 comments

The var keyword is only allowed to be used as an Identifier in certain contexts and disallowed in others, this is currently not implemented by the parser.

  • e.g: https://docs.oracle.com/javase/specs/jls/se11/html/jls-3.html#jls-TypeIdentifier

(Extracted form #113)

clementdessoude avatar Nov 26 '19 09:11 clementdessoude

I think this could be implemented using token categories to create:

  • IdentifierButNotVar category.

bd82 avatar Nov 26 '19 09:11 bd82