helpful error when hscript fails to parse a macro body

This commit is contained in:
2021-08-04 20:52:07 -06:00
parent b086d37caa
commit 0064fe4994

View File

@@ -342,7 +342,11 @@ class Helpers {
} else {
interps.push(new Cloner().clone(interps[-1]));
}
var parsed = parser.parseString(code);
var parsed = try {
parser.parseString(code);
} catch (e) {
throw CompileError.fromExp(exp, 'macro-time hscript parsing failed with $e:\n$code');
}
interps[-1].variables.set("__args__", args); // trippy
if (args != null) {