xo-reader: refactor: simplify progress_xs api
This commit is contained in:
parent
5916ac874f
commit
6d73caf308
4 changed files with 23 additions and 6 deletions
|
|
@ -110,9 +110,9 @@ namespace xo {
|
|||
* def pi = 3.14159265;
|
||||
* \---tk---/
|
||||
*/
|
||||
p_stack->push_exprstate
|
||||
(progress_xs::make
|
||||
(Constant<double>::make(tk.f64_value())));
|
||||
progress_xs::start
|
||||
(Constant<double>::make(tk.f64_value()),
|
||||
p_stack);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ namespace xo {
|
|||
switch (this->parenxs_type_) {
|
||||
case parenexprstatetype::lparen_0: {
|
||||
this->parenxs_type_ = parenexprstatetype::lparen_1; /* wants on_rightparen */
|
||||
p_stack->push_exprstate(progress_xs::make(expr.promote()));
|
||||
progress_xs::start(expr.promote(), p_stack);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,16 @@ namespace xo {
|
|||
return std::make_unique<progress_xs>(progress_xs(std::move(valex), op));
|
||||
}
|
||||
|
||||
void
|
||||
progress_xs::start(rp<Expression> valex, optype op, exprstatestack * p_stack) {
|
||||
p_stack->push_exprstate(progress_xs::make(valex, op));
|
||||
}
|
||||
|
||||
void
|
||||
progress_xs::start(rp<Expression> valex, exprstatestack * p_stack) {
|
||||
p_stack->push_exprstate(progress_xs::make(valex));
|
||||
}
|
||||
|
||||
progress_xs::progress_xs(rp<Expression> valex, optype op)
|
||||
: exprstate(exprstatetype::expr_progress),
|
||||
lhs_{std::move(valex)},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue