xo-reader: refactor: simplify expect_formal_xs api

This commit is contained in:
Roland Conybeare 2024-08-19 00:17:32 -04:00
commit 0dd66a4bcc
2 changed files with 3 additions and 2 deletions

View file

@ -55,7 +55,6 @@ namespace xo {
this->farglxs_type_ = formalarglstatetype::argl_1a;
/* TODO: refactor to have setup method on each exprstate */
expect_formal_xs::start(p_stack);
expect_symbol_xs::start(p_stack);
} else {
exprstate::on_leftparen_token(tk, p_stack, p_emit_expr);
}
@ -82,7 +81,6 @@ namespace xo {
if (farglxs_type_ == formalarglstatetype::argl_1b) {
this->farglxs_type_ = formalarglstatetype::argl_1a;
expect_formal_xs::start(p_stack);
expect_symbol_xs::start(p_stack);
} else {
exprstate::on_comma_token(tk, p_stack, p_emit_expr);
}

View file

@ -4,6 +4,7 @@
*/
#include "expect_formal_xs.hpp"
#include "expect_symbol_xs.hpp"
#include "expect_type_xs.hpp"
#include "xo/expression/Variable.hpp"
@ -37,6 +38,8 @@ namespace xo {
void
expect_formal_xs::start(exprstatestack * p_stack) {
p_stack->push_exprstate(expect_formal_xs::make());
expect_symbol_xs::start(p_stack);
}
expect_formal_xs::expect_formal_xs()