forked from lix-project/lix
line endings
This commit is contained in:
parent
ca6cba8b81
commit
172a83d22a
4 changed files with 14 additions and 14 deletions
|
@ -125,7 +125,7 @@ ref<EvalState> EvalCommand::getEvalState()
|
|||
std::unique_ptr<DebugTraceStacker>(
|
||||
new DebugTraceStacker(
|
||||
*evalState,
|
||||
DebugTrace
|
||||
DebugTrace
|
||||
{.pos = (error->info().errPos ? *error->info().errPos : evalState->positions[expr.getPos()]),
|
||||
.expr = expr,
|
||||
.env = env,
|
||||
|
|
|
@ -276,10 +276,10 @@ void NixRepl::mainLoop(const std::vector<std::string> & files)
|
|||
printMsg(lvlError, e.msg());
|
||||
}
|
||||
} catch (EvalError & e) {
|
||||
// in debugger mode, an EvalError should trigger another repl session.
|
||||
// in debugger mode, an EvalError should trigger another repl session.
|
||||
// when that session returns the exception will land here. No need to show it again;
|
||||
// show the error for this repl session instead.
|
||||
if (debuggerHook && !this->state->debugTraces.empty())
|
||||
if (debuggerHook && !this->state->debugTraces.empty())
|
||||
showDebugTrace(std::cout, this->state->positions, this->state->debugTraces.front());
|
||||
else
|
||||
printMsg(lvlError, e.msg());
|
||||
|
@ -511,7 +511,7 @@ bool NixRepl::processLine(std::string line)
|
|||
if (arg == "stack") {
|
||||
int idx = 0;
|
||||
for (auto iter = this->state->debugTraces.begin();
|
||||
iter != this->state->debugTraces.end();
|
||||
iter != this->state->debugTraces.end();
|
||||
++iter, ++idx) {
|
||||
std::cout << "\n" << ANSI_BLUE << idx << ANSI_NORMAL << ": ";
|
||||
showDebugTrace(std::cout, this->state->positions, *iter);
|
||||
|
@ -519,7 +519,7 @@ bool NixRepl::processLine(std::string line)
|
|||
} else if (arg == "env") {
|
||||
int idx = 0;
|
||||
for (auto iter = this->state->debugTraces.begin();
|
||||
iter != this->state->debugTraces.end();
|
||||
iter != this->state->debugTraces.end();
|
||||
++iter, ++idx) {
|
||||
if (idx == this->debugTraceIndex)
|
||||
{
|
||||
|
@ -539,7 +539,7 @@ bool NixRepl::processLine(std::string line)
|
|||
|
||||
int idx = 0;
|
||||
for (auto iter = this->state->debugTraces.begin();
|
||||
iter != this->state->debugTraces.end();
|
||||
iter != this->state->debugTraces.end();
|
||||
++iter, ++idx) {
|
||||
if (idx == this->debugTraceIndex)
|
||||
{
|
||||
|
|
|
@ -730,7 +730,7 @@ void printWithBindings(const SymbolTable &st, const Env &env)
|
|||
{
|
||||
if (env.type == Env::HasWithAttrs)
|
||||
{
|
||||
std::cout << "with: ";
|
||||
std::cout << "with: ";
|
||||
std::cout << ANSI_MAGENTA;
|
||||
Bindings::iterator j = env.values[0]->attrs->begin();
|
||||
while (j != env.values[0]->attrs->end()) {
|
||||
|
@ -747,13 +747,13 @@ void printEnvBindings(const SymbolTable &st, const StaticEnv &se, const Env &env
|
|||
std::cout << "Env level " << lvl << std::endl;
|
||||
|
||||
if (se.up && env.up) {
|
||||
std::cout << "static: ";
|
||||
std::cout << "static: ";
|
||||
printStaticEnvBindings(st, se);
|
||||
printWithBindings(st, env);
|
||||
std::cout << std::endl;
|
||||
printEnvBindings(st, *se.up, *env.up, ++lvl);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
std::cout << ANSI_MAGENTA;
|
||||
// for the top level, don't print the double underscore ones; they are in builtins.
|
||||
|
@ -784,7 +784,7 @@ void mapStaticEnvBindings(const SymbolTable &st, const StaticEnv &se, const Env
|
|||
{
|
||||
// add bindings for the next level up first, so that the bindings for this level
|
||||
// override the higher levels.
|
||||
// The top level bindings (builtins) are skipped since they are added for us by initEnv()
|
||||
// The top level bindings (builtins) are skipped since they are added for us by initEnv()
|
||||
if (env.up && se.up) {
|
||||
mapStaticEnvBindings(st, *se.up, *env.up, vm);
|
||||
|
||||
|
@ -1086,13 +1086,13 @@ void EvalState::addErrorTrace(Error & e, const PosIdx pos, const char * s, const
|
|||
e.addTrace(positions[pos], s, s2);
|
||||
}
|
||||
|
||||
std::unique_ptr<DebugTraceStacker> makeDebugTraceStacker(EvalState &state, Expr &expr, Env &env,
|
||||
std::unique_ptr<DebugTraceStacker> makeDebugTraceStacker(EvalState &state, Expr &expr, Env &env,
|
||||
std::optional<ErrPos> pos, const char * s, const std::string & s2)
|
||||
{
|
||||
return std::unique_ptr<DebugTraceStacker>(
|
||||
new DebugTraceStacker(
|
||||
state,
|
||||
DebugTrace
|
||||
DebugTrace
|
||||
{.pos = pos,
|
||||
.expr = expr,
|
||||
.env = env,
|
||||
|
|
|
@ -352,7 +352,7 @@ void ExprVar::bindVars(const EvalState & es, const std::shared_ptr<const StaticE
|
|||
/* Otherwise, the variable must be obtained from the nearest
|
||||
enclosing `with'. If there is no `with', then we can issue an
|
||||
"undefined variable" error now. */
|
||||
if (withLevel == -1)
|
||||
if (withLevel == -1)
|
||||
{
|
||||
throw UndefinedVarError({
|
||||
.msg = hintfmt("undefined variable '%1%'", es.symbols[name]),
|
||||
|
@ -392,7 +392,7 @@ void ExprAttrs::bindVars(const EvalState & es, const std::shared_ptr<const Stati
|
|||
staticenv = env;
|
||||
|
||||
if (recursive) {
|
||||
auto newEnv = std::shared_ptr<StaticEnv>(new StaticEnv(false, env.get(), recursive ? attrs.size() : 0));
|
||||
auto newEnv = std::shared_ptr<StaticEnv>(new StaticEnv(false, env.get(), recursive ? attrs.size() : 0));
|
||||
|
||||
Displacement displ = 0;
|
||||
for (auto & i : attrs)
|
||||
|
|
Loading…
Reference in a new issue