Skip to content

[java] typeIdentifier in grammar is incorrect. #4594

@kaby76

Description

@kaby76

The JLS says explicitly:

TypeIdentifier:
    Identifier but not permits, record, sealed, var, or yield

But, in java/java/JavaParser.g4, it incorrectly adds several of those keywords that should not be there (#2923; partially fixed with #2925). This could result in ambiguity.

In addition, typeIdentifier was introduced and used in only one rule (in classOrInterfaceType). Presumably, this was done to avoid ambiguity with uses in other places, with identifier. This should be investigated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions