Skip to content

Design: Error Handling

John Till edited this page Aug 3, 2023 · 2 revisions

When parsing an invalid Forscape program with an error, the compiler pipeline needs to keep running to the extent possible so that the IDE interactions are maintained. Historically, this has been a huge source of invalid access crashes. The compiler pipeline naturally makes assumptions that the data is structured, e.g. an assignment has a variable as the left-hand side. If the left-hand side is actually an Error result, and we try to follow a Symbol pointer from it, we have a classic invalid access on our hands- the stuff that makes C/C++ great.

Excessive error handling logic will quickly obsfucate the compiler code. We would much prefer to make the error handling robust by design, meaning that any access on an Error node is designed to be a valid access. DO THIS

Clone this wiki locally