diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-07-24T15·16+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-07-24T15·16+0000 |
commit | 57751fdb55ad04d82542165417511d26304cadc2 (patch) | |
tree | 4e31f364095847bfc80b927f23e2a0d23f46e2aa /src/libexpr/parser.y | |
parent | 9c3099d3286b7bc8582b1685ba1917db409cac0c (diff) |
* Refactoring to support domain checks.
Diffstat (limited to 'src/libexpr/parser.y')
-rw-r--r-- | src/libexpr/parser.y | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y index cba390d8dad8..b28aa27601bd 100644 --- a/src/libexpr/parser.y +++ b/src/libexpr/parser.y @@ -16,6 +16,8 @@ #include "lexer-tab.h" typedef ATerm Expr; +typedef ATerm ValidValues; +typedef ATerm DefaultValue; typedef ATerm Pos; #include "nixexpr-ast.hh" @@ -203,8 +205,9 @@ formals ; formal - : ID { $$ = makeNoDefFormal($1); } - | ID '?' expr { $$ = makeDefFormal($1, $3); } + : ID { $$ = makeFormal($1, makeUnrestrictedValues(), makeNoDefaultValue()); } +// | ID ':' '[' expr_list ']' { $$ = makeDefFormal($1, $3); } + | ID '?' expr { $$ = makeFormal($1, makeUnrestrictedValues(), makeDefaultValue($3)); } ; %% |