mirror of
https://github.com/NixOS/nix
synced 2025-06-30 11:43:15 +02:00
* Use a proper namespace.
* Optimise header file usage a bit. * Compile the parser as C++.
This commit is contained in:
parent
aab8812732
commit
75068e7d75
61 changed files with 650 additions and 268 deletions
|
@ -10,12 +10,17 @@
|
|||
#include "get-drvs.hh"
|
||||
#include "attr-path.hh"
|
||||
#include "expr-to-xml.hh"
|
||||
#include "util.hh"
|
||||
#include "store.hh"
|
||||
#include "help.txt.hh"
|
||||
|
||||
|
||||
using namespace nix;
|
||||
|
||||
|
||||
void printHelp()
|
||||
{
|
||||
cout << string((char *) helpText, sizeof helpText);
|
||||
std::cout << string((char *) helpText, sizeof helpText);
|
||||
}
|
||||
|
||||
|
||||
|
@ -23,7 +28,7 @@ static Expr parseStdin(EvalState & state)
|
|||
{
|
||||
startNest(nest, lvlTalkative, format("parsing standard input"));
|
||||
string s, s2;
|
||||
while (getline(cin, s2)) s += s2 + "\n";
|
||||
while (getline(std::cin, s2)) s += s2 + "\n";
|
||||
return parseExprFromString(state, s, absPath("."));
|
||||
}
|
||||
|
||||
|
@ -38,9 +43,9 @@ static void printResult(EvalState & state, Expr e,
|
|||
{
|
||||
if (evalOnly)
|
||||
if (xmlOutput)
|
||||
printTermAsXML(e, cout);
|
||||
printTermAsXML(e, std::cout);
|
||||
else
|
||||
cout << format("%1%\n") % e;
|
||||
std::cout << format("%1%\n") % e;
|
||||
|
||||
else {
|
||||
DrvInfos drvs;
|
||||
|
@ -53,7 +58,7 @@ static void printResult(EvalState & state, Expr e,
|
|||
drvPath = addPermRoot(drvPath,
|
||||
makeRootName(gcRoot, rootNr),
|
||||
indirectRoot);
|
||||
cout << format("%1%\n") % drvPath;
|
||||
std::cout << format("%1%\n") % drvPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue