about summary refs log tree commit diff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-02-03T14·45+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-02-03T14·45+0000
commitc4f7ae4aa5fc7071cfa853ec5d75aaf00e7a97fc (patch)
tree99334d6825236ffcab5a64239b95878e733e9ab5 /src/libexpr/eval.cc
parent1c9c0a5a46822be60c999f0196567c9e17cf5fa3 (diff)
* Verify that all variables in a Nix expression are defined.
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 820e934a635a..bbb1393f8388 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -64,30 +64,30 @@ ATerm expandRec(ATerm e, ATermList rbnds, ATermList nrbnds)
     /* Create the substitution list. */
     ATermMap subs;
     for (ATermIterator i(rbnds); i; ++i) {
-        string s;
+        ATerm name;
         Expr e2;
-        if (!(atMatch(m, *i) >> "Bind" >> s >> e2))
+        if (!(atMatch(m, *i) >> "Bind" >> name >> e2))
             abort(); /* can't happen */
-        subs.set(s, ATmake("Select(<term>, <str>)", e, s.c_str()));
+        subs.set(name, ATmake("Select(<term>, <term>)", e, name));
     }
 
     /* Create the non-recursive set. */
     ATermMap as;
     for (ATermIterator i(rbnds); i; ++i) {
-        string s;
+        ATerm name;
         Expr e2;
-        if (!(atMatch(m, *i) >> "Bind" >> s >> e2))
+        if (!(atMatch(m, *i) >> "Bind" >> name >> e2))
             abort(); /* can't happen */
-        as.set(s, substitute(subs, e2));
+        as.set(name, substitute(subs, e2));
     }
 
     /* Copy the non-recursive bindings.  !!! inefficient */
     for (ATermIterator i(nrbnds); i; ++i) {
-        string s;
+        ATerm name;
         Expr e2;
-        if (!(atMatch(m, *i) >> "Bind" >> s >> e2))
+        if (!(atMatch(m, *i) >> "Bind" >> name >> e2))
             abort(); /* can't happen */
-        as.set(s, e2);
+        as.set(name, e2);
     }
 
     return makeAttrs(as);