public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: syntax errors
@ 2019-01-03 17:03 Daniel Marjamäki
  2019-01-03 17:39 ` Jonathan Wakely
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Marjamäki @ 2019-01-03 17:03 UTC (permalink / raw)
  To: David Malcolm, gcc

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

^ permalink raw reply	[flat|nested] 5+ messages in thread
* syntax errors
@ 2022-05-10 22:18 André Coelho
  2022-05-10 22:23 ` Andrew Pinski
  2022-05-10 22:32 ` Mohamed Atef
  0 siblings, 2 replies; 5+ messages in thread
From: André Coelho @ 2022-05-10 22:18 UTC (permalink / raw)
  To: gcc

Hey...if the compiler can check syntax errors...why can't it fixed them?


thanks


andre coelho


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-10 22:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-03 17:03 syntax errors Daniel Marjamäki
2019-01-03 17:39 ` Jonathan Wakely
2022-05-10 22:18 André Coelho
2022-05-10 22:23 ` Andrew Pinski
2022-05-10 22:32 ` Mohamed Atef

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).