mirror of
https://github.com/ksherlock/mpw-shell.git
synced 2025-02-09 14:30:46 +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; }
|
constexpr int status() const noexcept { return _status; }
|
||||||
private:
|
private:
|
||||||
int _status;
|
int _status;
|
||||||
};
|
};
|
||||||
|
|
||||||
class execution_of_input_terminated : public mpw_error {
|
class execution_of_input_terminated : public mpw_error {
|
||||||
public:
|
public:
|
||||||
execution_of_input_terminated(int status = -9) :
|
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
|
#endif
|
@ -3,6 +3,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "mpw-shell.h"
|
#include "mpw-shell.h"
|
||||||
|
#include "error.h"
|
||||||
|
|
||||||
%%{
|
%%{
|
||||||
machine tokenizer;
|
machine tokenizer;
|
||||||
@ -29,9 +30,7 @@
|
|||||||
sstring =
|
sstring =
|
||||||
['] schar** [']
|
['] schar** [']
|
||||||
${ quoted = true; }
|
${ quoted = true; }
|
||||||
$err{
|
$err{ throw sstring_error(); }
|
||||||
throw std::runtime_error("### MPW Shell - 's must occur in pairs.");
|
|
||||||
}
|
|
||||||
;
|
;
|
||||||
|
|
||||||
escape_seq =
|
escape_seq =
|
||||||
@ -49,9 +48,7 @@
|
|||||||
dstring =
|
dstring =
|
||||||
["] dchar** ["]
|
["] dchar** ["]
|
||||||
${ quoted = true; }
|
${ quoted = true; }
|
||||||
$err{
|
$err{ throw dstring_error(); }
|
||||||
throw std::runtime_error("### MPW Shell - \"s must occur in pairs.");
|
|
||||||
}
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user