Open bbrk24 opened 2 days ago
Oh, I see what's happening. Adding parens and changing whitespace for clarity, though I'm not sure if this version still parses:
(
try
foo
catch e
) <? RangeError bar(e)
It's like this:
(try
foo()
catch e) <? RangeError
bar(e)
It's not that crazy, given what patterns are currently supported... But obviously not what you wanted. I think mainly we need to implement this form of pattern.
Maybe we also want to forbid content on the same line as a try/catch block, but I could also imagine that it might be useful sometimes...
If nothing else, content before the try
is definitely useful. Example:
ast := try parse input catch err
if err <? AssertionError
console.error 'DEBUG ASSERTION FAILED'
console.error err
else
console.error makeErrorString err
return 1
What on earth is this miscompile