Helpful error messages for macro expansion errors
This commit is contained in:
@@ -283,7 +283,6 @@ class Kiss {
|
||||
// Bind the table arguments of this function for easy recursive calling/passing
|
||||
var convert = readerExpToHaxeExpr.bind(_, k);
|
||||
|
||||
|
||||
var none = EBlock([]).withMacroPosOf(exp);
|
||||
|
||||
var expr = switch (exp.def) {
|
||||
|
@@ -453,8 +453,12 @@ class Macros {
|
||||
args[innerArgNames.shift()] = restArgs;
|
||||
}
|
||||
|
||||
// Return the macro expansion:
|
||||
return Helpers.runAtCompileTime(b.callSymbol("begin", exps.slice(2)), k, args);
|
||||
try {
|
||||
// Return the macro expansion:
|
||||
return Helpers.runAtCompileTime(b.callSymbol("begin", exps.slice(2)), k, args);
|
||||
} catch (error) {
|
||||
throw CompileError.fromExp(wholeExp, 'Macro expansion error: $error');
|
||||
};
|
||||
};
|
||||
|
||||
null;
|
||||
|
Reference in New Issue
Block a user