Test for Error-Handling

Author: Philip Dorrell

This page demonstrates how Bracketup compilation error messages are displayed in the browser.

Error Example with a Mis-Spelt Function Name

(Note: the pointer is pointing at the "[", because the error message is currently associated with the lexed token consisting of "[_longuageTitle ".)

Error Examples With Too Many or Too Few Closing Brackets

Errors with closing brackets can be hard to trace, because the point where the error becomes apparent may be much later than the point where the mistake was made.

To help with tracing such errors, if a "too many" or "too few" closing brackets error occurs, the source code is shown with the following information:

Error Example with Too Many Closing Brackets

This example has extra closing brackets. But the error location is not the actual location of the closing brackets that need to be deleted. (There is a surplus bracket at the end of "Hello World" line, and another one after the word "Spanish".)

Error Example with Not Enough Closing Brackets

This example has a missing closing bracket. But the error location is not the actual location of the closing bracket that needs to be inserted. (There is a closing bracket missing after "Goodbye".)

Error Example with Extra Closing Bracket at the End

This example has one extra closing bracket at the end. This forces the error display, but since only the very last closing bracket is invalid, it lets you see how the rest of the source code is displayed when it is valid.

Last updated: 12 October 2013