xo-reader: simplify expect_formal_arglist_xs.start() using psm

This commit is contained in:
Roland Conybeare 2024-08-19 16:45:31 -04:00
commit 6dcc0d420e
3 changed files with 4 additions and 6 deletions

View file

@ -53,7 +53,7 @@ namespace xo {
public:
expect_formal_arglist_xs();
static void start(exprstatestack * p_stack);
static void start(parserstatemachine * p_psm);
virtual void on_leftparen_token(const token_type & tk,
parserstatemachine * p_psm) override;

View file

@ -38,9 +38,9 @@ namespace xo {
}
void
expect_formal_arglist_xs::start(exprstatestack * p_stack)
expect_formal_arglist_xs::start(parserstatemachine * p_psm)
{
p_stack->push_exprstate(expect_formal_arglist_xs::make());
p_psm->push_exprstate(expect_formal_arglist_xs::make());
}
expect_formal_arglist_xs::expect_formal_arglist_xs()

View file

@ -30,11 +30,9 @@ namespace xo {
lambda_xs::on_lambda_token(const token_type & tk,
parserstatemachine * p_psm)
{
auto p_stack = p_psm->p_stack_;
if (lmxs_type_ == lambdastatetype::lm_0) {
this->lmxs_type_ = lambdastatetype::lm_1;
expect_formal_arglist_xs::start(p_stack);
expect_formal_arglist_xs::start(p_psm);
} else {
exprstate::on_lambda_token(tk, p_psm);
}