xo-reader: parserstatemachine -> consolidate on_formal_arglist()
This commit is contained in:
parent
b02d1e17e4
commit
29932f9a3d
5 changed files with 15 additions and 12 deletions
|
|
@ -94,13 +94,11 @@ namespace xo {
|
|||
parserstatemachine * p_psm)
|
||||
{
|
||||
auto p_stack = p_psm->p_stack_;
|
||||
auto p_emit_expr = p_psm->p_emit_expr_;
|
||||
|
||||
if (farglxs_type_ == formalarglstatetype::argl_1b) {
|
||||
std::unique_ptr<exprstate> self = p_stack->pop_exprstate();
|
||||
|
||||
p_stack->top_exprstate().on_formal_arglist(this->argl_,
|
||||
p_stack, p_emit_expr);
|
||||
p_stack->top_exprstate().on_formal_arglist(this->argl_, p_psm);
|
||||
} else {
|
||||
exprstate::on_rightparen_token(tk, p_psm);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,14 +125,15 @@ namespace xo {
|
|||
|
||||
void
|
||||
exprstate::on_formal_arglist(const std::vector<rp<Variable>> & argl,
|
||||
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()));
|
||||
|
||||
|
|
|
|||
|
|
@ -44,15 +44,16 @@ namespace xo {
|
|||
|
||||
void
|
||||
lambda_xs::on_formal_arglist(const std::vector<rp<Variable>> & argl,
|
||||
exprstatestack * p_stack,
|
||||
rp<Expression> * p_emit_expr)
|
||||
parserstatemachine * p_psm)
|
||||
{
|
||||
auto p_stack = p_psm->p_stack_;
|
||||
|
||||
if (lmxs_type_ == lambdastatetype::lm_1) {
|
||||
this->lmxs_type_ = lambdastatetype::lm_2;
|
||||
this->argl_ = argl;
|
||||
expect_expr_xs::start(p_stack);
|
||||
} else {
|
||||
exprstate::on_formal_arglist(argl, p_stack, p_emit_expr);
|
||||
exprstate::on_formal_arglist(argl, p_psm);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue