aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2008-01-20 20:44:03 +0000
committerMichael Raskin <7c6f434c@mail.ru>2008-01-20 20:44:03 +0000
commit5b5a3af98372029f3a870cf18cc1442f1434be85 (patch)
tree94473b9cc98bed5e589713a60db60ff2da306d0c /src
parent5eb5c23447b5c2bfa097416aab340d172eb416d3 (diff)
Probably fixed __exprToString
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/primops.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 883e99ad0..864292d4a 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -6,6 +6,7 @@
#include "archive.hh"
#include "expr-to-xml.hh"
#include "nixexpr-ast.hh"
+#include "parser.hh"
#include <sys/types.h>
#include <sys/stat.h>
@@ -949,6 +950,8 @@ static Expr prim_unsafeDiscardStringContext(EvalState & state, const ATermVector
return makeStr(s, PathSet());
}
+/* Expression serialization/deserialization */
+
static Expr prim_ExprToString ( EvalState & state, const ATermVector & args)
{
return makeStr ( atPrint ( evalExpr ( state, args [ 0 ] ) ) );
@@ -961,7 +964,7 @@ static Expr prim_StringToExpr ( EvalState & state, const ATermVector & args)
if (! matchStr ( evalExpr ( state, args[0] ), s, l )) {
throw EvalError("__stringToExpr needs string argument!");
}
- return toATerm ( s );
+ return ATreadFromString(s.c_str());
}
/*************************************************************