pretty printing -- copmlete for xo::ast::GeneralizedExpression

This commit is contained in:
Roland Conybeare 2025-07-19 11:47:03 -05:00
commit 2e0846823b
67 changed files with 1230 additions and 478 deletions

View file

@ -0,0 +1,44 @@
/* file pretty_parserstatemachine.cpp
*
* author: Roland Conybeare, Jul 2025
*/
#include "pretty_parserstatemachine.hpp"
#include "pretty_exprstatestack.hpp"
#include "pretty_envframestack.hpp"
#include "exprstatestack.hpp"
namespace xo {
namespace print {
bool
ppdetail<xo::scm::parserstatemachine>::print_pretty(const ppindentinfo & ppii, const xo::scm::parserstatemachine & x)
{
ppstate * pps = ppii.pps();
if (ppii.upto()) {
if (!pps->print_upto("<psm"))
return false;
if (!pps->print_upto_tag("stack", x.p_stack_))
return false;
if (!pps->print_upto_tag("env_stack", x.p_env_stack_))
return false;
if (!pps->print_upto_tag("emit_expr", (void*)x.p_emit_expr_))
return false;
return pps->print_upto(">");
} else {
pps->write("<psm");
pps->newline_pretty_tag(ppii.ci1(), "stack", x.p_stack_);
pps->newline_pretty_tag(ppii.ci1(), "env_stack", x.p_env_stack_);
pps->newline_pretty_tag(ppii.ci1(), "emit_expr", (void*)x.p_emit_expr_);
pps->write(">");
return false;
}
}
} /*namespace print*/
} /*namespace xo*/