[C++ PATCH] Make parser revert digraph "<:"
Theodore Papadopoulo
Theodore.Papadopoulo@sophia.inria.fr
Mon Jan 26 18:43:00 GMT 2004
giovannibajo@libero.it said:
> Did you *actually* check my patch? This is what I do.
Sorry, I had a quick look at the explanation but forgot it after
reading the rest of the thread.
I think I now understand better the whole issue... Here is my
(simple user) opinion....
For clarity, I string quote "" the input file ASCII characters.
Overall, I like the idea of letting people simply write "A<::B>".
What I dislike with your patch (and I think what Gaby and other
dislike also) is that I will also have a message if I wrote "A[:B>".
Ie, as far as I understand, seeing the token sequence
<square bracket><:> you assume that the code contained "<::" which
will not be true if the code actually contained "[:". This is why Jason
says to authorize this under -fpermissive.
>From a user standpoint, I'd like to have the message if and only if
the character sequence in the file is "<::" and nothing (well a
standard syntax error I suppose) when the sequence is "[:". As far
as I understand, this information is currently not available because
the lexer somehow throws it away.
Using the tentative parsing only when you got a token
<square bracket (from digraph)> (where the (from digraph) is the
annotation actually dropped by the lexer would be very nice to the
user and will never emit a strange message when the input contains
"[:".
With this sort of modification (I do not know whether this is easy),
I would even say that the message should be emitted only in pedantic
mode (but that my naive uninformed opinion).
I hope this is not just noise in the discussion...
Theo.
--------------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
--------------------------------------------------------------------
More information about the Gcc-patches
mailing list