mirror of
https://github.com/ksherlock/mpw-shell.git
synced 2025-01-16 09:30:27 +00:00
mpw errors
This commit is contained in:
parent
1a98acb756
commit
47af010ba5
30
error.h
30
error.h
@ -14,13 +14,13 @@ public:
|
||||
|
||||
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.")
|
||||
mpw_error(status, "MPW Shell - Execution of input Terminated.")
|
||||
{}
|
||||
};
|
||||
|
||||
@ -39,6 +39,32 @@ public:
|
||||
{}
|
||||
};
|
||||
|
||||
class estring_error: public mpw_error {
|
||||
public:
|
||||
estring_error(int status = -3) :
|
||||
mpw_error(status, "MPW Shell - `s must occur in pairs.")
|
||||
{}
|
||||
};
|
||||
|
||||
class vstring_error: public mpw_error {
|
||||
public:
|
||||
vstring_error(int status = -3) :
|
||||
mpw_error(status, "MPW Shell - {s must occur in pairs.")
|
||||
{}
|
||||
};
|
||||
|
||||
class sstring_error: public mpw_error {
|
||||
public:
|
||||
sstring_error(int status = -3) :
|
||||
mpw_error(status, "MPW Shell - 's must occur in pairs.")
|
||||
{}
|
||||
};
|
||||
|
||||
class dstring_error: public mpw_error {
|
||||
public:
|
||||
dstring_error(int status = -3) :
|
||||
mpw_error(status, "MPW Shell - \"s must occur in pairs.")
|
||||
{}
|
||||
};
|
||||
|
||||
#endif
|
@ -3,6 +3,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "mpw-shell.h"
|
||||
#include "error.h"
|
||||
|
||||
%%{
|
||||
machine tokenizer;
|
||||
@ -29,9 +30,7 @@
|
||||
sstring =
|
||||
['] schar** [']
|
||||
${ quoted = true; }
|
||||
$err{
|
||||
throw std::runtime_error("### MPW Shell - 's must occur in pairs.");
|
||||
}
|
||||
$err{ throw sstring_error(); }
|
||||
;
|
||||
|
||||
escape_seq =
|
||||
@ -49,9 +48,7 @@
|
||||
dstring =
|
||||
["] dchar** ["]
|
||||
${ quoted = true; }
|
||||
$err{
|
||||
throw std::runtime_error("### MPW Shell - \"s must occur in pairs.");
|
||||
}
|
||||
$err{ throw dstring_error(); }
|
||||
;
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user