Hacker News new | ask | show | jobs
by red2awn 2032 days ago
Yeah I am currently writing a compiler, turns out for useful error messages my parser should accept a superset of my language, then validate it afterwards.
2 comments

The way the D compiler does it is by parsing until it finds an error, marking the node as "poisoned" then walking back up until it can keep going.

It seems to work although I would include a "fail early" flag just to help with enormous error messages (if you apply the principle to sema as well)