sparkly 0.1.5

A pretty-printing library based on Wadler's "A Prettier Printer" with support for ANSI styling.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[macro_export]
macro_rules! impl_Display_for_Sparkly {
    (($($bound:tt)*) $ty:ty) => {
        impl<$($bound)*> ::std::fmt::Display for $ty
        where
            $ty: $crate::Sparkly,
        {
            fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
                write!(fmt, "{}", $crate::Sparkly::to_doc(self).display_opts(80, false))
            }
        }
    };
    ($ty:ty) => {
        impl_Display_for_Sparkly!(() $ty);
    };
}