Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8286427

3.8: Clarify that Identifier is not a ReservedKeyword

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 18
    • Fix Version/s: 19
    • Component/s: specification
    • Labels:

      Description

      JLS18 defines Identifier to exclude every Keyword:

        Identifier:
          IdentifierChars but not a Keyword or BooleanLiteral or NullLiteral

      which makes TypeIdentifier's exclusion of certain keywords rather redundant:

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

      3.5's tokenization rules are clear that identifiers are exclusive with, specifically, _reserved_ keywords: "A sequence of input characters that could be reduced to either an identifier token or a reserved keyword token (§3.9) is always reduced to a reserved keyword token."

      Therefore, Identifier should exclude ReservedKeyword, not Keyword:

        Identifier:
          IdentifierChars but not a ***ReservedKeyword*** or BooleanLiteral or NullLiteral

        Attachments

          Activity

            People

            Assignee:
            gbierman Gavin Bierman
            Reporter:
            abuckley Alex Buckley
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: