xo-reader: misc bugfixes + logging [wip, utests not passing]
This commit is contained in:
parent
22d4c6c601
commit
ac4ee7d6b8
14 changed files with 175 additions and 17 deletions
|
|
@ -47,6 +47,54 @@ namespace xo {
|
|||
|
||||
p_env_stack_->pop_envframe();
|
||||
}
|
||||
|
||||
void
|
||||
parserstatemachine::on_symbol(const std::string & x)
|
||||
{
|
||||
constexpr bool c_debug_flag = true;
|
||||
scope log(XO_DEBUG(c_debug_flag));
|
||||
|
||||
log && log(xtag("x", x),
|
||||
xtag("psm", *this));
|
||||
|
||||
this->p_stack_
|
||||
->top_exprstate().on_symbol(x, this);
|
||||
}
|
||||
|
||||
void
|
||||
parserstatemachine::on_leftbrace_token(const token_type & tk)
|
||||
{
|
||||
constexpr bool c_debug_flag = true;
|
||||
scope log(XO_DEBUG(c_debug_flag));
|
||||
|
||||
log && log(xtag("tk", tk),
|
||||
xtag("psm", *this));
|
||||
|
||||
this->p_stack_
|
||||
->top_exprstate().on_leftbrace_token(tk, this);
|
||||
}
|
||||
|
||||
void
|
||||
parserstatemachine::on_rightbrace_token(const token_type & tk)
|
||||
{
|
||||
constexpr bool c_debug_flag = true;
|
||||
scope log(XO_DEBUG(c_debug_flag));
|
||||
|
||||
log && log(xtag("tk", tk),
|
||||
xtag("psm", *this));
|
||||
|
||||
this->p_stack_
|
||||
->top_exprstate().on_rightbrace_token(tk, this);
|
||||
}
|
||||
|
||||
void
|
||||
parserstatemachine::print(std::ostream & os) const {
|
||||
os << "<psm";
|
||||
os << xtag("stack", p_stack_);
|
||||
os << xtag("env_stack", p_env_stack_);
|
||||
os << xtag("emit_expr", p_emit_expr_);
|
||||
os << ">";
|
||||
}
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue