pretty printing -- copmlete for xo::ast::GeneralizedExpression
This commit is contained in:
parent
adc0ca287e
commit
c0587aa4fb
14 changed files with 206 additions and 29 deletions
|
|
@ -15,6 +15,10 @@ namespace xo {
|
|||
* @brief A stack of exprstate objects
|
||||
**/
|
||||
class exprstatestack {
|
||||
public:
|
||||
using ppstate = xo::print::ppstate;
|
||||
using ppindentinfo = xo::print::ppindentinfo;
|
||||
|
||||
public:
|
||||
exprstatestack() {}
|
||||
|
||||
|
|
@ -45,6 +49,7 @@ namespace xo {
|
|||
}
|
||||
|
||||
void print (std::ostream & os) const;
|
||||
bool pretty_print(const ppindentinfo & ppii) const;
|
||||
|
||||
private:
|
||||
std::vector<std::unique_ptr<exprstate>> stack_;
|
||||
|
|
@ -65,21 +70,6 @@ namespace xo {
|
|||
return os;
|
||||
}
|
||||
} /*namespace scm*/
|
||||
|
||||
#ifndef ppdetail_atomic
|
||||
namespace print {
|
||||
template <>
|
||||
struct ppdetail<xo::scm::exprstatestack *> {
|
||||
static bool print_upto(ppstate * pps, const xo::scm::exprstatestack * x) {
|
||||
return ppdetail_atomic<const xo::scm::exprstatestack *>::print_upto(pps, x);
|
||||
}
|
||||
static void print_pretty(ppstate * pps, const xo::scm::exprstatestack * x) {
|
||||
ppdetail_atomic<const xo::scm::exprstatestack *>::print_pretty(pps, x);
|
||||
}
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
} /*namespace xo*/
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue