C++ Logo

std-proposals

Advanced search

Re: [std-proposals] hexadecimal-escape-sequence

From: Jens Maurer <jens.maurer_at_[hidden]>
Date: Thu, 26 Jan 2023 18:42:24 +0100
On 26/01/2023 18.23, Fraser Gordon via Std-Proposals wrote:
> Hi folks,
>
> I was reading the [lex.ccon] section of the current draft and noticed an oddity in the hexadecimal-escape-sequence <https://eel.is/c++draft/lex.ccon#nt:hexadecimal-escape-sequence> production:
>
> /hexadecimal-escape-sequence:/
>
> \x /hexadecimal-digit-sequence/
> /hexadecimal-escape-sequence hexadecimal-digit/
> \x{ /simple-hexadecimal-digit-sequence/ }
>
> The combination of the 2nd and 3rd rules seems to say that \x{20}20 should be parsed as a hex escape sequence (presumably representing u+2020).

That seems to be a bug in the standard.

I think we want

/hexadecimal-escape-sequence:/
     \x /simple-hexadecimal-digit-sequence/
     \x{ /simple-hexadecimal-digit-sequence/ }


Jens

Received on 2023-01-26 17:42:28