disable multiple builder args on reader macros

This commit is contained in:
2021-11-27 20:07:14 -07:00
parent be787d18c0
commit c5fc1033f3

View File

@@ -532,7 +532,11 @@ class Macros {
case Symbol(s):
streamArgName = s;
case MetaExp("builder", { pos: _, def: Symbol(b) }):
builderArgName = b;
if (builderArgName == null) {
builderArgName = b;
} else {
throw CompileError.fromExp(arg, 'Cannot declare multiple &builder args. Already declared: $builderName');
}
default:
throw messageForBadArgs;
}