mirror of
https://github.com/NixOS/nix
synced 2025-07-02 21:51:50 +02:00
* Removed the "valid values" feature. Nobody uses it anyway.
This commit is contained in:
parent
b455c4c45c
commit
5664b6d7ba
13 changed files with 22 additions and 104 deletions
|
@ -354,9 +354,8 @@ formals
|
|||
;
|
||||
|
||||
formal
|
||||
: ID { $$ = makeFormal($1, makeUnrestrictedValues(), makeNoDefaultValue()); }
|
||||
| ID ':' '[' expr_list ']' { $$ = makeFormal($1, makeValidValues($4), makeNoDefaultValue()); }
|
||||
| ID '?' expr { $$ = makeFormal($1, makeUnrestrictedValues(), makeDefaultValue($3)); }
|
||||
: ID { $$ = makeFormal($1, makeNoDefaultValue()); }
|
||||
| ID '?' expr { $$ = makeFormal($1, makeDefaultValue($3)); }
|
||||
;
|
||||
|
||||
%%
|
||||
|
@ -396,8 +395,8 @@ static void checkAttrSets(ATerm e)
|
|||
ATermMap names(ATgetLength(formals));
|
||||
for (ATermIterator i(formals); i; ++i) {
|
||||
ATerm name;
|
||||
ATerm d1, d2;
|
||||
if (!matchFormal(*i, name, d1, d2)) abort();
|
||||
ATerm d1;
|
||||
if (!matchFormal(*i, name, d1)) abort();
|
||||
if (names.get(name))
|
||||
throw EvalError(format("duplicate formal function argument `%1%' at %2%")
|
||||
% aterm2String(name) % showPos(pos));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue