xo-reader2: refactor: make() + _make() pair for each ssm
This commit is contained in:
parent
da58e18779
commit
9a97bb2680
12 changed files with 92 additions and 59 deletions
|
|
@ -58,8 +58,8 @@ namespace xo {
|
|||
}
|
||||
|
||||
DApplySsm *
|
||||
DApplySsm::make(DArena & arena,
|
||||
obj<AExpression> fn_expr)
|
||||
DApplySsm::_make(DArena & arena,
|
||||
obj<AExpression> fn_expr)
|
||||
{
|
||||
obj<AAllocator,DArena> mm(&arena);
|
||||
|
||||
|
|
@ -83,6 +83,13 @@ namespace xo {
|
|||
return new (mem) DApplySsm(applystate, fn_expr, args);
|
||||
}
|
||||
|
||||
obj<ASyntaxStateMachine,DApplySsm>
|
||||
DApplySsm::make(DArena & arena,
|
||||
obj<AExpression> fn_expr)
|
||||
{
|
||||
return obj<ASyntaxStateMachine,DApplySsm>(_make(arena, fn_expr));
|
||||
}
|
||||
|
||||
void
|
||||
DApplySsm::start(obj<AExpression> fn_expr,
|
||||
ParserStateMachine * p_psm)
|
||||
|
|
@ -91,10 +98,7 @@ namespace xo {
|
|||
|
||||
DArena::Checkpoint ckp = p_psm->parser_alloc().checkpoint();
|
||||
|
||||
DApplySsm * apply_ssm
|
||||
= DApplySsm::make(p_psm->parser_alloc(), fn_expr);
|
||||
|
||||
obj<ASyntaxStateMachine,DApplySsm> ssm(apply_ssm);
|
||||
auto ssm = DApplySsm::make(p_psm->parser_alloc(), fn_expr);
|
||||
|
||||
p_psm->push_ssm(ckp, ssm);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue