Exemplo n.º 1
0
def example_doc_2bis():
    '''Second example from scheme pprint library, second varian'''
    return hsappend(text('let'),
                    align(vbappend(hsappend(fill_break(6, text('empty')),
                                            text('::'),
                                            text('Doc')),
                                   hsappend(fill_break(6, text('next')),
                                            text('::'),
                                            text('Int -> Doc -> Doc')),
                                   hsappend(fill_break(6, text('linebreak')),
                                            text('::'),
                                            text('Doc')))))
Exemplo n.º 2
0
def example_doc_3():
    '''A simple group example'''
    return happend(hsappend(text('public'), text('void'), text('mymethod')),
                   text('('),
                   align(group(vappend(
                happend(text('Type1'), text(' '), text('arg1'), text(',')),
                happend(text('Type2'), text(' '), text('arg2'), text(',')),
                happend(text('Type3'), text(' '), text('arg3'), text(',')),
                happend(text('Type4'), text(' '), text('arg4'))))),
                   text(')'),
                   text(';'))