Thank you for the quick reply.

> how about "stray %qs token"?

I will change.

> I wonder how much we want to special-case this. Are you thinking about
> the case where there's a stray symbol in the code (perhaps due to a
> stray keypress, or unfinished manual edits)?

At the moment I only think about ) } ]

I would like to focus on only those 3 to start with. but it sounds
good to prepare for more stray tokens later.

> if (c_parser_next_token_is_meaningless_p (parser))
>   complain_about_stray_token (parser);
> else
>   ...

sure!

> It might make sense to emit a fix-it hint suggesting the removal of the
> stray token.

It is 50% chance that the closing paranthesis should be removed. Maybe
there is a missing "(".

Maybe the error message should indicate that.. something like "either
there is missing "(" or this ")" is a stray token".

Best regards,
Daniel Marjamäki

Reply via email to