xo-reader: simplify: drop exprstate.admits_colon()
This commit is contained in:
parent
99d9f40091
commit
2b436850cf
7 changed files with 4 additions and 49 deletions
|
|
@ -76,35 +76,6 @@ namespace xo {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
exprstate::admits_colon() const {
|
||||
switch (exs_type_) {
|
||||
case exprstatetype::expect_toplevel_expression_sequence:
|
||||
case exprstatetype::defexpr:
|
||||
case exprstatetype::parenexpr:
|
||||
/* unreachable -- redirects to define_xs::admits_colon() etc */
|
||||
assert(false);
|
||||
return false;
|
||||
|
||||
case exprstatetype::expect_rhs_expression:
|
||||
case exprstatetype::expect_symbol:
|
||||
case exprstatetype::expect_type:
|
||||
return false;
|
||||
|
||||
case exprstatetype::expr_progress:
|
||||
/* unreachable */
|
||||
assert(false);
|
||||
return false;
|
||||
|
||||
case exprstatetype::invalid:
|
||||
case exprstatetype::n_exprstatetype:
|
||||
/* unreachable */
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
exprstate::admits_semicolon() const {
|
||||
switch (exs_type_) {
|
||||
|
|
@ -214,12 +185,9 @@ namespace xo {
|
|||
constexpr const char * self_name = "exprstate::on_colon";
|
||||
|
||||
/* lots of illegal states */
|
||||
if (!this->admits_colon())
|
||||
{
|
||||
throw std::runtime_error(tostr(self_name,
|
||||
": unexpected colon for parsing state",
|
||||
xtag("state", *this)));
|
||||
}
|
||||
throw std::runtime_error(tostr(self_name,
|
||||
": unexpected colon for parsing state",
|
||||
xtag("state", *this)));
|
||||
|
||||
assert(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,9 +17,6 @@ namespace xo {
|
|||
bool
|
||||
paren_xs::admits_symbol() const { return true; }
|
||||
|
||||
bool
|
||||
paren_xs::admits_colon() const { return false; }
|
||||
|
||||
bool
|
||||
paren_xs::admits_semicolon() const { return false; }
|
||||
|
||||
|
|
|
|||
|
|
@ -17,9 +17,6 @@ namespace xo {
|
|||
bool
|
||||
progress_xs::admits_symbol() const { return false; }
|
||||
|
||||
bool
|
||||
progress_xs::admits_colon() const { return false; }
|
||||
|
||||
bool
|
||||
progress_xs::admits_semicolon() const { return true; }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue