PreviousUpNext

15.4.829  src/lib/prettyprint/big/src/base-prettyprinter.pkg

## base-prettyprinter.pkg
#
# Support for prettyprinting plain ascii text --
# a workhorse tool used by about eighty packages.
#
# Compare to:
#     src/lib/prettyprint/simple/simple-prettyprinter.pkg

# Compiled by:
#     src/lib/prettyprint/big/prettyprinter.lib



package   base_prettyprinter
: (weak)  Base_Prettyprinter                                                            # Base_Prettyprinter    is from   src/lib/prettyprint/big/src/base-prettyprinter.api
{
    Prettyprint_Output_Stream
        =
        { consumer:   String -> Void,
          flush:      Void -> Void,
          close:      Void -> Void
        };

    package out {
        #
        Prettyprint_Output_Stream = Prettyprint_Output_Stream;
        Texttraits = Void;

        fun same_texttraits _    = TRUE;
        fun push_texttraits _    = ();
        fun pop_texttraits _     = ();
        fun default_texttraits _ = ();

        fun put_string ( { consumer, flush, close }, s) =  consumer s;

        fun flush    { consumer, flush, close }     =  flush();
        fun close    { consumer, flush, close }     =  close();
    };

    package pp
        =
        base_prettyprinter_g (                                                          # base_prettyprinter_g          is from   src/lib/prettyprint/big/src/base-prettyprinter-g.pkg
            #
            package tt  =  traitless_text;                                              # traitless_text                is from   src/lib/prettyprint/big/src/traitless-text.pkg
            package out =  out;
        );

    include package   pp;
};                                                                                      # package base_prettyprinter


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext