xo-reader: refactor: splitoff defexpr state machine from exprstate

This commit is contained in:
Roland Conybeare 2024-08-08 15:11:50 -04:00
commit fccff55001
6 changed files with 204 additions and 320 deletions

View file

@ -167,6 +167,17 @@ namespace xo {
return exprstatetype::invalid;
}
exprstate const * i_exstate(std::size_t i) const {
std::size_t z = xs_stack_.size();
if (i < z) {
return xs_stack_[i].get();
}
/* out of bounds */
return nullptr;
}
/** true iff parser contains state for an incomplete expression.
* For this to be true, parser must have consumed at least one token
* since end of last toplevel expression