xo-reader: refactor: simplify paren_xs api
This commit is contained in:
parent
7767833afb
commit
6a71f718bd
2 changed files with 5 additions and 3 deletions
|
|
@ -29,7 +29,7 @@ namespace xo {
|
|||
|
||||
static const paren_xs * from(const exprstate * x) { return dynamic_cast<const paren_xs *>(x); }
|
||||
|
||||
static std::unique_ptr<paren_xs> lparen_0();
|
||||
static void start(exprstatestack * p_stack);
|
||||
|
||||
bool admits_f64() const;
|
||||
bool admits_rightparen() const;
|
||||
|
|
@ -68,6 +68,9 @@ namespace xo {
|
|||
|
||||
virtual void print(std::ostream & os) const override;
|
||||
|
||||
private:
|
||||
static std::unique_ptr<paren_xs> make();
|
||||
|
||||
private:
|
||||
/**
|
||||
* ( foo ... )
|
||||
|
|
|
|||
|
|
@ -57,8 +57,7 @@ namespace xo {
|
|||
//constexpr const char * self_name = "exprstate::on_leftparen";
|
||||
|
||||
/* push lparen_0 to remember to look for subsequent rightparen. */
|
||||
p_stack->push_exprstate(paren_xs::lparen_0());
|
||||
expect_expr_xs::start(p_stack);
|
||||
paren_xs::start(p_stack);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue