about summary refs log tree commit diff
path: root/src/libexpr/common-opts.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-05-12T13·59+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-05-12T13·59+0000
commit8032f26ca0bd2233de066ce5786ff976bbd641ae (patch)
tree954b2ecdce037dcf47b0376616ac05dbad8542ab /src/libexpr/common-opts.cc
parent4750065ada362bd46e85879975a3148e18df5b0c (diff)
parentbd25ac2260267abd2181324e1650820da70e5e60 (diff)
* Merged the `fast-eval' branch.
Diffstat (limited to 'src/libexpr/common-opts.cc')
-rw-r--r--src/libexpr/common-opts.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libexpr/common-opts.cc b/src/libexpr/common-opts.cc
index 9e3f8f9614da..5a4856568b4b 100644
--- a/src/libexpr/common-opts.cc
+++ b/src/libexpr/common-opts.cc
@@ -9,7 +9,7 @@ namespace nix {
 
 bool parseOptionArg(const string & arg, Strings::iterator & i,
     const Strings::iterator & argsEnd, EvalState & state,
-    ATermMap & autoArgs)
+    Bindings & autoArgs)
 {
     if (arg != "--arg" && arg != "--argstr") return false;
 
@@ -19,11 +19,13 @@ bool parseOptionArg(const string & arg, Strings::iterator & i,
     string name = *i++;
     if (i == argsEnd) throw error;
     string value = *i++;
-    
-    Expr e = arg == "--arg"
-        ? parseExprFromString(state, value, absPath("."))
-        : makeStr(value);
-    autoArgs.set(toATerm(name), e);
+
+    Value & v(autoArgs[state.symbols.create(name)].value);
+
+    if (arg == "--arg")
+        state.mkThunk_( v, parseExprFromString(state, value, absPath(".")));
+    else
+        mkString(v, value);
     
     return true;
 }