The exception information we receive when running user sketches also includes information about the column number of the error. While this can sometimes be misleading, especially with syntax errors, it might also help the user locate the error more easily.
Note that we'll have to figure out a solution for the implicit setup() functionality. While line numbers are preserved in that case, column numbers on the first line aren't. Options here include:
Implement a hack whereby we detect whether the error is on the first line, and then subtract a constant from the column number if so. This takes advantage of the fact that our mangling is very simple.
Use source maps. This also means integrating something like stacktrace.js, since browser stack traces aren't source-mapped. It's a much bigger lift, but it'd pave the way for supporting features like transpiling to ES2015 and other languages in the future.
The exception information we receive when running user sketches also includes information about the column number of the error. While this can sometimes be misleading, especially with syntax errors, it might also help the user locate the error more easily.
Note that we'll have to figure out a solution for the implicit
setup()
functionality. While line numbers are preserved in that case, column numbers on the first line aren't. Options here include: