xo-reader: refactor: use parsestatemachine w/ on_symbol_token()

This commit is contained in:
Roland Conybeare 2024-08-19 01:03:18 -04:00
commit bda115037b
14 changed files with 30 additions and 31 deletions

View file

@ -4,6 +4,7 @@
*/
#include "expect_symbol_xs.hpp"
#include "parserstatemachine.hpp"
namespace xo {
namespace scm {
@ -24,14 +25,17 @@ namespace xo {
void
expect_symbol_xs::on_symbol_token(const token_type & tk,
exprstatestack * p_stack,
rp<Expression> * p_emit_expr)
parserstatemachine * p_psm)
{
auto p_stack = p_psm->p_stack_;
auto p_emit_expr = p_psm->p_emit_expr_;
/* have to do pop first, before sending symbol to
* the o.g. symbol-requester
*/
std::unique_ptr<exprstate> self = p_stack->pop_exprstate();
p_stack->top_exprstate().on_symbol(tk.text(),
p_stack, p_emit_expr);
return;