forked from lix-project/lix
add colors; remove headings
This commit is contained in:
parent
a4d8a799b7
commit
bf8a065be0
|
@ -444,7 +444,6 @@ bool NixRepl::processLine(string line)
|
||||||
|
|
||||||
else if (command == ":d" || command == ":debug") {
|
else if (command == ":d" || command == ":debug") {
|
||||||
if (arg == "stack") {
|
if (arg == "stack") {
|
||||||
std::cout << "eval stack:" << std::endl;
|
|
||||||
for (auto iter = this->state->debugTraces.begin();
|
for (auto iter = this->state->debugTraces.begin();
|
||||||
iter != this->state->debugTraces.end(); ++iter) {
|
iter != this->state->debugTraces.end(); ++iter) {
|
||||||
std::cout << "\n" << "… " << iter->hint.str() << "\n";
|
std::cout << "\n" << "… " << iter->hint.str() << "\n";
|
||||||
|
@ -463,7 +462,6 @@ bool NixRepl::processLine(string line)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (arg == "env") {
|
} else if (arg == "env") {
|
||||||
std::cout << "env stack:" << std::endl;
|
|
||||||
auto iter = this->state->debugTraces.begin();
|
auto iter = this->state->debugTraces.begin();
|
||||||
if (iter != this->state->debugTraces.end()) {
|
if (iter != this->state->debugTraces.end()) {
|
||||||
printStaticEnvBindings(iter->expr);
|
printStaticEnvBindings(iter->expr);
|
||||||
|
|
|
@ -679,12 +679,15 @@ std::optional<EvalState::Doc> EvalState::getDoc(Value & v)
|
||||||
void printStaticEnvBindings(const StaticEnv &se, int lvl)
|
void printStaticEnvBindings(const StaticEnv &se, int lvl)
|
||||||
{
|
{
|
||||||
std::cout << "Env level " << lvl << std::endl;
|
std::cout << "Env level " << lvl << std::endl;
|
||||||
|
|
||||||
if (se.up) {
|
if (se.up) {
|
||||||
|
std::cout << ANSI_MAGENTA;
|
||||||
for (auto i = se.vars.begin(); i != se.vars.end(); ++i)
|
for (auto i = se.vars.begin(); i != se.vars.end(); ++i)
|
||||||
{
|
{
|
||||||
std::cout << i->first << " ";
|
std::cout << i->first << " ";
|
||||||
}
|
}
|
||||||
|
std::cout << ANSI_NORMAL;
|
||||||
|
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
|
||||||
|
@ -692,12 +695,14 @@ void printStaticEnvBindings(const StaticEnv &se, int lvl)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
std::cout << ANSI_MAGENTA;
|
||||||
// for the top level, don't print the double underscore ones; they are in builtins.
|
// for the top level, don't print the double underscore ones; they are in builtins.
|
||||||
for (auto i = se.vars.begin(); i != se.vars.end(); ++i)
|
for (auto i = se.vars.begin(); i != se.vars.end(); ++i)
|
||||||
{
|
{
|
||||||
if (((string)i->first).substr(0,2) != "__")
|
if (((string)i->first).substr(0,2) != "__")
|
||||||
std::cout << i->first << " ";
|
std::cout << i->first << " ";
|
||||||
}
|
}
|
||||||
|
std::cout << ANSI_NORMAL;
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue