uliwitness / Stacksmith

An intuitive software erector kit targeted at people new to programming, but with enough potential to stay useful once they've learned, inspired by HyperCard.
http://stacksmith.org
128 stars 13 forks source link

Go through parser and make sure it deals better with invalid code #98

Open uliwitness opened 5 years ago

uliwitness commented 5 years ago

Now that we actually run our parser over the script for formatting, make sure that the parse tree when errors happen is always left in a state that calling GenerateCode() on it doesn't crash.

I've fixed a bunch of cases where a command used to be able to just assume it had 2 arguments by the time GenerateCode was called, but now with runtime-deferred errors and the formatter walking the parse tree, we need to add extra NULL checks and extra error checks before so we are not dumb and set an argument to NULL.