about summary refs log tree commit diff
path: root/src/libexpr/parser.y
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-07-24T15·16+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-07-24T15·16+0000
commit57751fdb55ad04d82542165417511d26304cadc2 (patch)
tree4e31f364095847bfc80b927f23e2a0d23f46e2aa /src/libexpr/parser.y
parent9c3099d3286b7bc8582b1685ba1917db409cac0c (diff)
* Refactoring to support domain checks.
Diffstat (limited to 'src/libexpr/parser.y')
-rw-r--r--src/libexpr/parser.y7
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)); }
   ;
   
 %%