forked from lix-project/lix
* expr-to-xml -> value-to-xml.
This commit is contained in:
parent
fc92244ba8
commit
9a64454faa
|
@ -2,12 +2,12 @@ pkglib_LTLIBRARIES = libexpr.la
|
||||||
|
|
||||||
libexpr_la_SOURCES = \
|
libexpr_la_SOURCES = \
|
||||||
nixexpr.cc eval.cc primops.cc lexer-tab.cc parser-tab.cc \
|
nixexpr.cc eval.cc primops.cc lexer-tab.cc parser-tab.cc \
|
||||||
get-drvs.cc attr-path.cc expr-to-xml.cc common-opts.cc \
|
get-drvs.cc attr-path.cc value-to-xml.cc common-opts.cc \
|
||||||
names.cc
|
names.cc
|
||||||
|
|
||||||
pkginclude_HEADERS = \
|
pkginclude_HEADERS = \
|
||||||
nixexpr.hh eval.hh parser.hh lexer-tab.hh parser-tab.hh \
|
nixexpr.hh eval.hh parser.hh lexer-tab.hh parser-tab.hh \
|
||||||
get-drvs.hh attr-path.hh expr-to-xml.hh common-opts.hh \
|
get-drvs.hh attr-path.hh value-to-xml.hh common-opts.hh \
|
||||||
names.hh nixexpr-ast.hh
|
names.hh nixexpr-ast.hh
|
||||||
|
|
||||||
libexpr_la_LIBADD = ../libutil/libutil.la ../libstore/libstore.la \
|
libexpr_la_LIBADD = ../libutil/libutil.la ../libstore/libstore.la \
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include "store-api.hh"
|
#include "store-api.hh"
|
||||||
#include "util.hh"
|
#include "util.hh"
|
||||||
#include "archive.hh"
|
#include "archive.hh"
|
||||||
#include "expr-to-xml.hh"
|
#include "value-to-xml.hh"
|
||||||
#include "nixexpr-ast.hh"
|
#include "nixexpr-ast.hh"
|
||||||
#include "parser.hh"
|
#include "parser.hh"
|
||||||
#include "names.hh"
|
#include "names.hh"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "expr-to-xml.hh"
|
#include "value-to-xml.hh"
|
||||||
#include "xml-writer.hh"
|
#include "xml-writer.hh"
|
||||||
#include "nixexpr-ast.hh"
|
#include "nixexpr-ast.hh"
|
||||||
#include "aterm.hh"
|
#include "aterm.hh"
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef __EXPR_TO_XML_H
|
#ifndef __VALUE_TO_XML_H
|
||||||
#define __EXPR_TO_XML_H
|
#define __VALUE_TO_XML_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
@ -14,4 +14,4 @@ void printValueAsXML(EvalState & state, bool strict,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !__EXPR_TO_XML_H */
|
#endif /* !__VALUE_TO_XML_H */
|
|
@ -7,7 +7,7 @@
|
||||||
#include "parser.hh"
|
#include "parser.hh"
|
||||||
#include "get-drvs.hh"
|
#include "get-drvs.hh"
|
||||||
#include "attr-path.hh"
|
#include "attr-path.hh"
|
||||||
#include "expr-to-xml.hh"
|
#include "value-to-xml.hh"
|
||||||
#include "util.hh"
|
#include "util.hh"
|
||||||
#include "store-api.hh"
|
#include "store-api.hh"
|
||||||
#include "common-opts.hh"
|
#include "common-opts.hh"
|
||||||
|
@ -75,10 +75,15 @@ void processExpr(EvalState & state, const Strings & attrPaths,
|
||||||
std::cout << format("%1%\n") % canonicaliseExpr(e);
|
std::cout << format("%1%\n") % canonicaliseExpr(e);
|
||||||
else {
|
else {
|
||||||
Value v;
|
Value v;
|
||||||
|
PathSet context;
|
||||||
state.eval(e, v);
|
state.eval(e, v);
|
||||||
if (strict) state.strictForceValue(v);
|
|
||||||
if (evalOnly)
|
if (evalOnly)
|
||||||
|
if (xmlOutput)
|
||||||
|
printValueAsXML(state, strict, v, std::cout, context);
|
||||||
|
else {
|
||||||
|
if (strict) state.strictForceValue(v);
|
||||||
std::cout << v << std::endl;
|
std::cout << v << std::endl;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
DrvInfos drvs;
|
DrvInfos drvs;
|
||||||
getDerivations(state, v, "", autoArgs, drvs);
|
getDerivations(state, v, "", autoArgs, drvs);
|
||||||
|
|
Loading…
Reference in a new issue