From 7ccb2700c0401c553631e07aeb49e08f976274a3 Mon Sep 17 00:00:00 2001 From: Ben Burdette Date: Sun, 22 May 2022 19:15:58 -0600 Subject: [PATCH] comments --- src/libcmd/command.cc | 50 ------------------------------------------ src/libexpr/nixexpr.cc | 4 ---- src/libexpr/nixexpr.hh | 2 -- 3 files changed, 56 deletions(-) diff --git a/src/libcmd/command.cc b/src/libcmd/command.cc index b61b9b61d..c1d9eefc6 100644 --- a/src/libcmd/command.cc +++ b/src/libcmd/command.cc @@ -121,59 +121,9 @@ ref EvalCommand::getEvalState() evalState->debugMode = startReplOnEvalErrors; - // TODO move this somewhere else. Its only here to get the evalState ptr! if (startReplOnEvalErrors) { evalState->debugRepl = &runRepl; }; - // // debuggerHook = [evalState{ref(evalState)}](const Error * error, const Env & env, const Expr & expr) { - // debuggerHook = [](EvalState & evalState, const Error * error, const Env & env, const Expr & expr) { - // auto dts = - // error && expr.getPos() - // ? std::make_unique( - // evalState, - // DebugTrace { - // .pos = error->info().errPos ? *error->info().errPos : evalState.positions[expr.getPos()], - // .expr = expr, - // .env = env, - // .hint = error->info().msg, - // .isError = true - // }) - // : nullptr; - - // if (error) - // printError("%s\n\n" ANSI_BOLD "Starting REPL to allow you to inspect the current state of the evaluator.\n" ANSI_NORMAL, error->what()); - - // auto se = evalState.getStaticEnv(expr); - // if (se) { - // auto vm = mapStaticEnvBindings(evalState.symbols, *se.get(), env); - // runRepl(evalState, *vm); - // } - // if (startReplOnEvalErrors) - - // // debuggerHook = [evalState{ref(evalState)}](const Error * error, const Env & env, const Expr & expr) { - // debuggerHook = [](EvalState & evalState, const Error * error, const Env & env, const Expr & expr) { - // auto dts = - // error && expr.getPos() - // ? std::make_unique( - // evalState, - // DebugTrace { - // .pos = error->info().errPos ? *error->info().errPos : evalState.positions[expr.getPos()], - // .expr = expr, - // .env = env, - // .hint = error->info().msg, - // .isError = true - // }) - // : nullptr; - - // if (error) - // printError("%s\n\n" ANSI_BOLD "Starting REPL to allow you to inspect the current state of the evaluator.\n" ANSI_NORMAL, error->what()); - - // auto se = evalState.getStaticEnv(expr); - // if (se) { - // auto vm = mapStaticEnvBindings(evalState.symbols, *se.get(), env); - // runRepl(evalState, *vm); - // } - // }; } return ref(evalState); } diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc index b40791694..52d48122c 100644 --- a/src/libexpr/nixexpr.cc +++ b/src/libexpr/nixexpr.cc @@ -8,10 +8,6 @@ namespace nix { -/* Launch the nix debugger */ - -// std::function debuggerHook; - /* Displaying abstract syntax trees. */ static void showString(std::ostream & str, std::string_view s) diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh index 6a5d02ed1..9b3a9f5d0 100644 --- a/src/libexpr/nixexpr.hh +++ b/src/libexpr/nixexpr.hh @@ -22,8 +22,6 @@ MakeError(UndefinedVarError, Error); MakeError(MissingArgumentError, EvalError); MakeError(RestrictedPathError, Error); -// extern std::function debuggerHook; - /* Position objects. */ struct Pos