disable multiple builder args on reader macros

This commit is contained in:
2021-11-27 20:07:14 -07:00
parent b071b89802
commit 2b759680dd

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;
}