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

This commit is contained in:
Roland Conybeare 2024-08-19 11:46:46 -04:00
commit dbd2f69533
5 changed files with 10 additions and 10 deletions

View file

@ -64,14 +64,13 @@ namespace xo {
void
expect_formal_arglist_xs::on_formal(const rp<Variable> & formal,
exprstatestack * p_stack,
rp<Expression> * p_emit_expr)
parserstatemachine * p_psm)
{
if (farglxs_type_ == formalarglstatetype::argl_1a) {
this->farglxs_type_ = formalarglstatetype::argl_1b;
this->argl_.push_back(formal);
} else {
exprstate::on_formal(formal, p_stack, p_emit_expr);
exprstate::on_formal(formal, p_psm);
}
}

View file

@ -91,7 +91,9 @@ namespace xo {
rp<Variable> var = Variable::make(result_.name(),
result_.td());
p_stack->top_exprstate().on_formal(var, p_stack, p_emit_expr);
parserstatemachine psm(p_stack, p_emit_expr);
p_stack->top_exprstate().on_formal(var, &psm);
} else {
exprstate::on_typedescr(td, p_stack, p_emit_expr);
}

View file

@ -104,14 +104,15 @@ namespace xo {
void
exprstate::on_formal(const rp<Variable> & formal,
exprstatestack * p_stack,
rp<Expression> * /*p_emit_expr*/)
parserstatemachine * p_psm)
{
/* returning type description to something that wants it */
constexpr bool c_debug_flag = true;
scope log(XO_DEBUG(c_debug_flag));
auto p_stack = p_psm->p_stack_;
log && log(xtag("exstype",
p_stack->top_exprstate().exs_type()));