The implementation of the Rascal meta-programming language (including interpreter, type checker, parser generator, compiler and JVM based run-time system)
I would like to be able to write try-finally blocks like so:
try {
...
}
finally {
...
}
but this is not in the syntax of Rascal.
Example usage:
void job(str label, void (void () step) block) {
try {
jobStart(label);
block(() { jobStep(label, label, work=1);});
}
catch x: {
throw x; // this rethrow erases the location of the original, also it doesn't add functionality to the code.
}
finally {
jobEnd(label); // this is essential. I need to do this also when exceptions pop the stack.
}
}
Describe the bug
I would like to be able to write try-finally blocks like so:
but this is not in the syntax of Rascal.
Example usage: