xo-reader: parserstatemachine -> consolidate on_expr() args

This commit is contained in:
Roland Conybeare 2024-08-19 12:17:26 -04:00
commit bdf75d5620
14 changed files with 29 additions and 47 deletions

View file

@ -134,8 +134,7 @@ namespace xo {
void
progress_xs::on_expr(ref::brw<Expression> expr,
exprstatestack * /*p_stack*/,
rp<Expression> * /*p_emit_expr*/)
parserstatemachine * /*p_psm*/)
{
/* note: previous token probably an operator,
* handled from progress_xs::on_operator_token(),
@ -200,15 +199,13 @@ namespace xo {
scope log(XO_DEBUG(c_debug_flag));
auto p_stack = p_psm->p_stack_;
auto p_emit_expr = p_psm->p_emit_expr_;
rp<Expression> expr = this->assemble_expr();
std::unique_ptr<exprstate> self = p_stack->pop_exprstate();
p_stack->top_exprstate().on_expr(expr,
p_stack,
p_emit_expr);
p_stack->top_exprstate().on_expr(expr, p_psm);
/* control here on input like:
* (1.234;
*
@ -261,7 +258,6 @@ namespace xo {
constexpr const char * self_name = "progress_xs::on_rightparen";
auto p_stack = p_psm->p_stack_;
auto p_emit_expr = p_psm->p_emit_expr_;
/* stack may be something like:
*
@ -286,7 +282,7 @@ namespace xo {
log && log(xtag("stack", p_stack));
p_stack->top_exprstate().on_expr(expr, p_stack, p_emit_expr);
p_stack->top_exprstate().on_expr(expr, p_psm);
/* now deliver rightparen */
p_stack->top_exprstate().on_rightparen_token(tk, p_psm);