1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 02:11:15 +02:00

* New language feature: domain checks, which check whether a function

argument has a valid value, i.e., is in a certain domain.  E.g.,

    { foo : [true false]
    , bar : ["a" "b" "c"]
    }: ...

  This previously could be done using assertions, but domain checks
  will allow the buildfarm to automatically extract the configuration
  space from functions.
This commit is contained in:
Eelco Dolstra 2006-07-24 16:35:34 +00:00
parent 88acffa20a
commit f4c5531d92
4 changed files with 40 additions and 13 deletions

View file

@ -206,7 +206,7 @@ formals
formal
: ID { $$ = makeFormal($1, makeUnrestrictedValues(), makeNoDefaultValue()); }
// | ID ':' '[' expr_list ']' { $$ = makeDefFormal($1, $3); }
| ID ':' '[' expr_list ']' { $$ = makeFormal($1, makeValidValues($4), makeNoDefaultValue()); }
| ID '?' expr { $$ = makeFormal($1, makeUnrestrictedValues(), makeDefaultValue($3)); }
;