diff options
author | Ben Burdette <bburdette@protonmail.com> | 2022-05-19 17:01:23 -0600 |
---|---|---|
committer | Ben Burdette <bburdette@protonmail.com> | 2022-05-19 17:01:23 -0600 |
commit | 0600df86b8bc59633457f7ceb79e84c8ea3fed17 (patch) | |
tree | a369026f39acc3b3a63bb0fc67c18934f7c9974a /src/libcmd/command.cc | |
parent | 7ddef73d026d79adc0c4f3fd1518d88d1331c38c (diff) |
'debugMode'
Diffstat (limited to 'src/libcmd/command.cc')
-rw-r--r-- | src/libcmd/command.cc | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/src/libcmd/command.cc b/src/libcmd/command.cc index a7d7bfb17..a4ea5bc33 100644 --- a/src/libcmd/command.cc +++ b/src/libcmd/command.cc @@ -118,32 +118,35 @@ ref<EvalState> EvalCommand::getEvalState() searchPath, getEvalStore(), getStore()) #endif ; + + evalState->debugMode = startReplOnEvalErrors; // TODO move this somewhere else. Its only here to get the evalState ptr! - if (startReplOnEvalErrors) - // debuggerHook = [evalState{ref<EvalState>(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<DebugTraceStacker>( - 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>(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<DebugTraceStacker>( + // 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>(evalState); } |