Date: Thu, 14 Aug 2025 13:42:59 +0200
On 14.08.25 12:27, Russell Shaw via Std-Discussion wrote:
> Hi,
>
> In [lex.ccon]:
>
> --------------------------------------------------
> character-literal :
> encoding-prefixopt ’ c-char-sequence ’
>
> encoding-prefix : one of
> u8 u U L
>
> c-char-sequence :
> c-char
> c-char-sequence c-char
>
> c-char :
> basic-c-char
> escape-sequence
> universal-character-name
>
> escape-sequence :
> simple-escape-sequence
> numeric-escape-sequence
> conditional-escape-sequence
>
> numeric-escape-sequence :
> octal-escape-sequence
> hexadecimal-escape-sequence
>
> hexadecimal-escape-sequence :
> \x simple-hexadecimal-digit-sequence <- AA
> \x{ simple-hexadecimal-digit-sequence }
>
> --------------------------------------------------
>
> The line at AA is an unbounded sequence.
>
> That doesn't really make sense because the loop implies multiple such
> hexadecimal-escape-sequences:
>
> c-char-sequence :
> c-char
> c-char-sequence c-char
That's fine; lexing applies max-munch.
So, \x000000000000000000000000000000000000000000000000000000001zzzzz
is totally fine.
(Any errors for oversize value come after lexing.)
Jens
> Hi,
>
> In [lex.ccon]:
>
> --------------------------------------------------
> character-literal :
> encoding-prefixopt ’ c-char-sequence ’
>
> encoding-prefix : one of
> u8 u U L
>
> c-char-sequence :
> c-char
> c-char-sequence c-char
>
> c-char :
> basic-c-char
> escape-sequence
> universal-character-name
>
> escape-sequence :
> simple-escape-sequence
> numeric-escape-sequence
> conditional-escape-sequence
>
> numeric-escape-sequence :
> octal-escape-sequence
> hexadecimal-escape-sequence
>
> hexadecimal-escape-sequence :
> \x simple-hexadecimal-digit-sequence <- AA
> \x{ simple-hexadecimal-digit-sequence }
>
> --------------------------------------------------
>
> The line at AA is an unbounded sequence.
>
> That doesn't really make sense because the loop implies multiple such
> hexadecimal-escape-sequences:
>
> c-char-sequence :
> c-char
> c-char-sequence c-char
That's fine; lexing applies max-munch.
So, \x000000000000000000000000000000000000000000000000000000001zzzzz
is totally fine.
(Any errors for oversize value come after lexing.)
Jens
Received on 2025-08-14 11:43:07