From c9bc3735f639a4d022ab071feb5dabd451a0d016 Mon Sep 17 00:00:00 2001 From: Ben Burdette Date: Tue, 15 Feb 2022 09:49:25 -0700 Subject: quit repl from step mode --- src/libexpr/primops.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/libexpr/primops.cc') 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]; } -- cgit v1.2.3