Re: Error reporting
- Posted by mattlewis (admin) Jan 07, 2014
- 1597 views
Could I request that the error has a bit more detail, like which variable is producing the error, or even just which side of the equality, or both, is at fault?
This isn't a perfect solution, but I think it gets us a lot farther than we are now...I'm looking at where we are in the code, and if it's a RHS_SUBS or RHS_SUBS_CHECK (should look at the LHS versions, too) then I look for a symbol name. If it's not there, I back up to see if the preceding operation was one of those. If I find a variable, I say the name of the variable and which subscript it was that caused it. So:
? foo[a][b][c] -- ^ error happens here
...and the error message would look something like:
subscript value 1 is out of bounds, reading from a sequence of length 0 - in subscript #2 of 'foo'
So you'd know it happened on the second subscript operation. If it's something more complicated:
? foo[a][b[x]][c] -- ^ error happens here
...and the error message would look something like:
subscript value 1 is out of bounds, reading from a sequence of length 0 - as the result of an expression
That's fairly simple, since we know the opcodes and their size.
Matt