diff --git a/xo-expression/include/xo/expression/pretty_expression.hpp b/xo-expression/include/xo/expression/pretty_expression.hpp new file mode 100644 index 00000000..1fe2bc77 --- /dev/null +++ b/xo-expression/include/xo/expression/pretty_expression.hpp @@ -0,0 +1,37 @@ +/* @file pretty_expression.hpp + * + * author: Roland Conybeare, Jul 2025 + */ + +#pragma once + +#include "xo/indentlog/print/pretty.hpp" +#include "xo/indentlog/print/pretty_tag.hpp" +#include "xo/refcnt/pretty_refcnt.hpp" +#include "Expression.hpp" + +namespace xo { + namespace print { + template<> + struct ppdetail { + static bool print_upto(ppstate * pps, const xo::ast::GeneralizedExpression & x) { + return x.pretty_print(pps, true); + } + + static void print_pretty(ppstate * pps, const xo::ast::GeneralizedExpression & x) { + x.pretty_print(pps, false); + } + }; + + template <> + struct ppdetail { + static bool print_upto(ppstate * pps, const xo::ast::Expression & x) { + return x.pretty_print(pps, true); + } + + static void print_pretty(ppstate * pps, const xo::ast::Expression & x) { + x.pretty_print(pps, false); + } + }; + } +}