Skip to content

The first sentence in [lex.ext]/1, is it really necessary? #4021

Closed
@jabelloc

Description

@jabelloc

First sentence in [lex.ext]/1:

If a token matches both user-defined-literal and another literal kind, it is treated as the latter.

I don't think this is necessary as the non-terminal user-defined-literal is already the last item in the definition of the literal grammar production.

Thus, I think this paragraph could be simplified as follows:

  1. The syntactic non-terminal preceding the ud-suffix in a user-defined-literal is taken to be the longest sequence of characters that could match that non-terminal. [ Example: 123_­km is a user-defined-literal, but 12LL is an integer-literal. — end example ]

Activity

jensmaurer

jensmaurer commented on Jun 3, 2020

@jensmaurer
Member

There is no implied ordering in the presentation of grammar options, so we do need the disambiguation in the first sentence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @jabelloc@jensmaurer

        Issue actions

          The first sentence in [lex.ext]/1, is it really necessary? · Issue #4021 · cplusplus/draft