aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
authorBen Burdette <bburdette@protonmail.com>2022-02-15 09:49:25 -0700
committerBen Burdette <bburdette@protonmail.com>2022-02-15 09:49:25 -0700
commitc9bc3735f639a4d022ab071feb5dabd451a0d016 (patch)
treefe07df55b9a8c2d52c17b53338d43723fffadfaa /src/libexpr/primops.cc
parente761bf0601a56db26c31891a3433c1319814fffa (diff)
quit repl from step mode
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 25845bdc4..80d78e150 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -718,6 +718,15 @@ static RegisterPrimOp primop_break({
auto &dt = state.debugTraces.front();
debuggerHook(&error, dt.env, dt.expr);
+ if (state.debugQuit) {
+ // if the user elects to quit the repl, throw an exception.
+ throw Error(ErrorInfo{
+ .level = lvlInfo,
+ .msg = hintfmt("quit from debugger"),
+ .errPos = pos,
+ });
+ }
+
// returning the value we were passed.
v = *args[0];
}