diff options
author | eldritch horrors <pennae@lix.systems> | 2024-03-08 09:19:27 +0100 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-03-09 10:17:26 -0700 |
commit | 030c8aa833e019df6caa5c686dc989442c3d7638 (patch) | |
tree | 1e7a7f5d31aec193d57212f770621ef113f916a1 /src/libcmd/repl.cc | |
parent | 992d99592f1022593e4df276e39e8f4f65822f74 (diff) |
Rename `ProcessLineResult` variants
(cherry picked from commit 8e71883e3f59100479e96aa1883ef52dbaa03fd3)
Change-Id: If7d8b75eaec623dac106ce2363fa148af37d150c
Diffstat (limited to 'src/libcmd/repl.cc')
-rw-r--r-- | src/libcmd/repl.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc index ea2f4ebe6..20567f840 100644 --- a/src/libcmd/repl.cc +++ b/src/libcmd/repl.cc @@ -58,16 +58,16 @@ enum class ProcessLineResult { * program or evaluation (e.g., if the REPL was acting as the debugger) * should also exit. */ - QuitAll, + Quit, /** * The user exited with `:continue`. The REPL should exit, but the program * should continue running. */ - QuitOnce, + Continue, /** * The user did not exit. The REPL should request another line of input. */ - Continue, + PromptAgain, }; struct NixRepl @@ -315,11 +315,11 @@ ReplExitStatus NixRepl::mainLoop() logger->resume(); try { switch (processLine(input)) { - case ProcessLineResult::QuitAll: + case ProcessLineResult::Quit: return ReplExitStatus::QuitAll; - case ProcessLineResult::QuitOnce: - return ReplExitStatus::Continue; case ProcessLineResult::Continue: + return ReplExitStatus::Continue; + case ProcessLineResult::PromptAgain: break; default: abort(); @@ -514,7 +514,7 @@ ProcessLineResult NixRepl::processLine(std::string line) { line = trim(line); if (line.empty()) - return ProcessLineResult::Continue; + return ProcessLineResult::PromptAgain; _isInterrupted = false; @@ -609,13 +609,13 @@ ProcessLineResult NixRepl::processLine(std::string line) else if (state->debugRepl && (command == ":s" || command == ":step")) { // set flag to stop at next DebugTrace; exit repl. state->debugStop = true; - return ProcessLineResult::QuitOnce; + return ProcessLineResult::Continue; } else if (state->debugRepl && (command == ":c" || command == ":continue")) { // set flag to run to next breakpoint or end of program; exit repl. state->debugStop = false; - return ProcessLineResult::QuitOnce; + return ProcessLineResult::Continue; } else if (command == ":a" || command == ":add") { @@ -758,7 +758,7 @@ ProcessLineResult NixRepl::processLine(std::string line) else if (command == ":q" || command == ":quit") { state->debugStop = false; - return ProcessLineResult::QuitAll; + return ProcessLineResult::Quit; } else if (command == ":doc") { @@ -819,7 +819,7 @@ ProcessLineResult NixRepl::processLine(std::string line) } } - return ProcessLineResult::Continue; + return ProcessLineResult::PromptAgain; } void NixRepl::loadFile(const Path & path) |