forked from lix-project/hydra
hydra-eval-jobs: Use function argument default values
This commit is contained in:
parent
d734b435fa
commit
61405ec58a
|
@ -52,12 +52,16 @@ static void tryJobAlts(EvalState & state, XMLWriter & doc,
|
||||||
|
|
||||||
AutoArgs::const_iterator a = argsLeft.find(cur->name);
|
AutoArgs::const_iterator a = argsLeft.find(cur->name);
|
||||||
|
|
||||||
if (a == argsLeft.end())
|
|
||||||
throw TypeError(format("job `%1%' requires an argument named `%2%'")
|
|
||||||
% attrPath % cur->name);
|
|
||||||
|
|
||||||
Formals::Formals_::iterator next = cur; ++next;
|
Formals::Formals_::iterator next = cur; ++next;
|
||||||
|
|
||||||
|
if (a == argsLeft.end()) {
|
||||||
|
if (!cur->def)
|
||||||
|
throw TypeError(format("job `%1%' requires an argument named `%2%'")
|
||||||
|
% attrPath % cur->name);
|
||||||
|
tryJobAlts(state, doc, argsUsed, argsLeft, attrPath, fun, next, last, actualArgs);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int n = 0;
|
int n = 0;
|
||||||
foreach (ValueList::const_iterator, i, a->second) {
|
foreach (ValueList::const_iterator, i, a->second) {
|
||||||
Bindings actualArgs2(actualArgs); // !!! inefficient
|
Bindings actualArgs2(actualArgs); // !!! inefficient
|
||||||
|
|
Loading…
Reference in a new issue