xo-expression: + pretty_expression.hpp
This commit is contained in:
parent
0b0d8ffdc0
commit
ca4181a822
1 changed files with 37 additions and 0 deletions
37
xo-expression/include/xo/expression/pretty_expression.hpp
Normal file
37
xo-expression/include/xo/expression/pretty_expression.hpp
Normal file
|
|
@ -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<xo::ast::GeneralizedExpression> {
|
||||
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<xo::ast::Expression> {
|
||||
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);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue