From 5b5a3af98372029f3a870cf18cc1442f1434be85 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 20 Jan 2008 20:44:03 +0000 Subject: [PATCH] Probably fixed __exprToString --- src/libexpr/primops.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 #include @@ -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()); } /*************************************************************