xo-reader: parserstatemachine -> consolidate on_formal() args
This commit is contained in:
parent
29932f9a3d
commit
dbd2f69533
5 changed files with 10 additions and 10 deletions
|
|
@ -58,8 +58,7 @@ namespace xo {
|
|||
virtual void on_leftparen_token(const token_type & tk,
|
||||
parserstatemachine * p_psm) override;
|
||||
virtual void on_formal(const rp<Variable> & formal,
|
||||
exprstatestack * p_stack,
|
||||
rp<Expression> * p_emit_expr) override;
|
||||
parserstatemachine * p_psm) override;
|
||||
virtual void on_comma_token(const token_type & tk,
|
||||
parserstatemachine * p_psm) override;
|
||||
virtual void on_rightparen_token(const token_type & tk,
|
||||
|
|
|
|||
|
|
@ -110,8 +110,7 @@ namespace xo {
|
|||
|
||||
/** update exprstate when expecting a formal parameter **/
|
||||
virtual void on_formal(const rp<Variable> & formal,
|
||||
exprstatestack * p_stack,
|
||||
rp<Expression> * p_emit_expr);
|
||||
parserstatemachine * p_psm);
|
||||
|
||||
/** update expression when epecting a formal parameter list **/
|
||||
virtual void on_formal_arglist(const std::vector<rp<Variable>> & argl,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue