curry.backends.generic.renderer module

class curry.backends.generic.renderer.CxxSourceRenderer(istart=0)[source]

Bases: SourceRenderer

BLOCK_CLOSE = '}'
BLOCK_OPEN = '{'
COMMENT_STR = '//'
HCOL = 20
SOURCE_NAME = 'C++'
class curry.backends.generic.renderer.PySourceRenderer(istart=0)[source]

Bases: SourceRenderer

BLOCK_CLOSE = None
BLOCK_OPEN = None
COMMENT_STR = '#'
SOURCE_NAME = 'Python'
class curry.backends.generic.renderer.ShSourceRenderer(istart=0)[source]

Bases: SourceRenderer

BLOCK_CLOSE = None
BLOCK_OPEN = None
COMMENT_STR = '#'
SOURCE_NAME = 'sh'
class curry.backends.generic.renderer.SourceRenderer(istart=0)[source]

Bases: object

HCOL = 39
INDENT = 2
WIDTH = 80
format(arg, level=-1)[source]

Formats one line or block of code, with the proper indentation. Long lines are split.

justify(seq, maximum=None)[source]
prettylist(seq, level=0)[source]

Formats a list as one element per line with leading commas.

renderLines(lines)[source]

Renders list-formatted code into a string.

The input is possibly-nested lists of strings or string pairs. The list nestings correspond to indentation levels. Pairs are rendered as code followed by a comment to the right.