mirror of
https://github.com/ksherlock/mpw-shell.git
synced 2026-04-26 05:17:56 +00:00
support for Loop ... End, Break, and Continue.
This commit is contained in:
@@ -4,14 +4,41 @@
|
||||
#include <stdexcept>
|
||||
#include <system_error>
|
||||
|
||||
class execution_of_input_terminated : public std::runtime_error {
|
||||
class mpw_error : public std::runtime_error {
|
||||
public:
|
||||
execution_of_input_terminated(int status = -9) :
|
||||
std::runtime_error("MPW Shell - Execution of input Terminated."), _status(status)
|
||||
mpw_error(int status, const std::string &s) : std::runtime_error(s), _status(status)
|
||||
{}
|
||||
|
||||
mpw_error(int status, const char *s) : std::runtime_error(s), _status(status)
|
||||
{}
|
||||
|
||||
constexpr int status() const noexcept { return _status; }
|
||||
private:
|
||||
int _status;
|
||||
int _status;
|
||||
};
|
||||
|
||||
class execution_of_input_terminated : public mpw_error {
|
||||
public:
|
||||
execution_of_input_terminated(int status = -9) :
|
||||
mpw_error(status, "MPW Shell - Execution of input Terminated.")
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
class break_error : public mpw_error {
|
||||
public:
|
||||
break_error(int status = -3) :
|
||||
mpw_error(status, "MPW Shell - Break must be within for or loop.")
|
||||
{}
|
||||
};
|
||||
|
||||
class continue_error : public mpw_error {
|
||||
public:
|
||||
continue_error(int status = -3) :
|
||||
mpw_error(status, "MPW Shell - Continue must be within for or loop.")
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user