This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] Make parser revert digraph "<:"


Gabriel Dos Reis wrote:

>> That being said, for the problem at hand it might be an overkill and
>> the scheme has also to be tested when there are other syntax errors
>> further in the program.
>
> For the problem at hand, we know what the value of the token is.  It
> is the value of the token '['.  The issue is to determine whether it
> was spelt '[' or '<:' for diagnostic purpose only.  So, it is not a
> case where we really have a tentative parsing.

No, it's not only a diagnostic issue. If you check my patch, I emit a
diagnostic only to be fully ISO compliant. If you comment the errors out, my
code makes the parser accept "A<::B>" without whitespaces and go on with the
compilation correctly. I use tentative parsing to achieve this.

This is why I keep stressing the fact that checking if there actually was a
digraph is not going to help that much.

Giovanni Bajo



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]