News for hackers. Stuff that matters.
Re:Pratt parsing is a black box by vinipsmaker on Wednesday November 04, 2026 @12:52PM (#50369110)
You need to forbid stuff such as:

  return return 1;
return itself isn't an expression (it's a statement) so it can't be used in places that expect expressions (such as the "argument" to return itself).

However extending Pratt parsing to handle this case is trivial: https://vinipsmaker.github.io/blog/article/statements-in-pra...

It's still an extension so not really pure Pratt parsing IMO (other practitioners of Pratt parsing disagree with me).

There are no comments on this comment yet.