summary refs log tree commit diff
path: root/src/libexpr/parser.y
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-10-02 15:52:44 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-10-02 15:52:44 +0000
commitac19b333b38b2ac4b633bc1203e59c153bbb5c91 (patch)
treeec5a7ca923c36a30babd391c661e16241057b32e /src/libexpr/parser.y
parent7581cfdee4001cba719d4d72f8f17f1b4c04ed51 (diff)
downloadguix-ac19b333b38b2ac4b633bc1203e59c153bbb5c91.tar.gz
* Finally, a real "let" syntax: `let x = ...; ... z = ...; in ...'.
Diffstat (limited to 'src/libexpr/parser.y')
-rw-r--r--src/libexpr/parser.y4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index e4b220e04f..f5c3435e5f 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -123,7 +123,7 @@ static void freeAndUnprotect(void * p)
 %type <t> expr_app expr_select expr_simple bind inheritsrc formal
 %type <ts> binds ids expr_list formals string_parts
 %token <t> ID INT STR PATH URI
-%token IF THEN ELSE ASSERT WITH LET REC INHERIT EQ NEQ AND OR IMPL
+%token IF THEN ELSE ASSERT WITH LET IN REC INHERIT EQ NEQ AND OR IMPL
 %token DOLLAR_CURLY /* == ${ */
 
 %nonassoc IMPL
@@ -152,6 +152,8 @@ expr_function
     { $$ = makeAssert($2, $4, CUR_POS); }
   | WITH expr ';' expr_function
     { $$ = makeWith($2, $4, CUR_POS); }
+  | LET binds IN expr_function
+    { $$ = makeSelect(fixAttrs(1, ATinsert($2, makeBind(toATerm("<let-body>"), $4, CUR_POS))), toATerm("<let-body>")); }
   | expr_if
   ;