tnelson / Forge

Forge: A Tool and Language for Teaching Formal Methods
https://forge-fm.org/
MIT License
67 stars 9 forks source link

Roll in better handling of some errors, propagate stxloc; beginnings of srcloc tests #223

Closed tnelson closed 9 months ago

tnelson commented 9 months ago

This PR includes mainly fixes for some error messages and the beginnings of test-suite infrastructure for preservation of syntax location information during expansion.

If used as a procedure post-expansion, formula AST nodes now enable a more sensible error. Previously, this error was the usual error that Racket would give if a non-procedure was used as one.

The raise-forge-error function should gradually replace raise-user-error and raise-syntax-error in Forge, because it eschews the confusing stack trace but prints the syntax location, so that the VSCode extension (and those running from the terminal) can see the location of the issue.