C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] (SC22WG14.19303) adding punctuator tokens

From: Jens Gustedt <jens.gustedt_at_[hidden]>
Date: Sat, 17 Apr 2021 11:36:23 +0200
Jens,

on Sat, 17 Apr 2021 10:02:15 +0200 you (Jens Maurer
<Jens.Maurer_at_[hidden]>) wrote:

> On 17/04/2021 09.04, Jens Gustedt via Liaison wrote:
> > on Fri, 16 Apr 2021 17:11:12 -0400 you (Steve Downey
> > <sdowney_at_[hidden]>) wrote:
>
> >> There were some grammar changes just to fix some problems with
> >> pp-tokens, making sure that UCNs always were, and dealing with
> >> pp-numbers that don't turn out to be numbers.
> >
> > That worries me a bit more. I would be good if that would converge
> > to a common treatement in C and C++. I don't think that pp-numbers
> > in C ever caused serious problems. They just survive for later
> > translation phases and if they are not appropriate, the problem is
> > handled there.
>
> The paper is here:
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1949r6.html
>
> The pp-number change in particular is just applying the new
> UAX#31-based lexing grammar non-terminals to these. Nothing to see,
> I believe.

ah, ok. So I guess the intent of this change is to allow such letters
in application defined number and string suffixes? That would be
reasonable also to have for C, I think.

> Note that the lexing grammar presented here will need to change again
> once C++ switches to a "model C" approach (no early transformation
> of extended characters into UCNs)
> http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2021/p2314r1.html

That convinces me even more that this might be a good point in time to
start sharing a common specification for lexing and preprocessing.

I personally would for example not mind if by such a thing we would
import some punctuator tokens into C for which we don't have use yet
(as would have been for `::` if we hadn't adopted attributes) as long
as they don't conflict with the existing grammar. And also to extend
the preprocessor string and character literals should not conflict
too much with C's grammar.

Thanks
Jens

-- 
:: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536   ::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::

Received on 2021-04-17 04:36:31