Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Lua pretty-printer.
Documentation
renderPretty :: Float -> Int -> Doc -> SimpleDoc Source #
This is the default pretty printer which is used by show
,
putDoc
and hPutDoc
. (renderPretty ribbonfrac width x)
renders
document x
with a page width of width
and a ribbon width of
(ribbonfrac * width)
characters. The ribbon width is the maximal
amount of non-indentation characters on a line. The parameter
ribbonfrac
should be between 0.0
and 1.0
. If it is lower or
higher, the ribbon width will be 0 or width
respectively.
displayIO :: Handle -> SimpleDoc -> IO () Source #
(displayIO handle simpleDoc)
writes simpleDoc
to the file
handle handle
. This function is used for example by hPutDoc
:
hPutDoc handle doc = displayIO handle (renderPretty 0.4 100 doc)
Instances
LPretty Bool Source # | |
LPretty FunArg Source # | |
LPretty FunCall Source # | |
LPretty FunBody Source # | |
LPretty FunName Source # | |
LPretty Block Source # | |
LPretty TableField Source # | |
Defined in Language.Lua.PrettyPrinter pprint :: TableField -> Doc Source # pprint' :: Precedence -> TableField -> Doc | |
LPretty PrefixExp Source # | |
LPretty Unop Source # | |
LPretty Binop Source # | |
LPretty Var Source # | |
LPretty Exp Source # | |
LPretty Stat Source # | |
LPretty Name Source # | |
LPretty [Char] Source # | |
LPretty [TableField] Source # | |
Defined in Language.Lua.PrettyPrinter pprint :: [TableField] -> Doc Source # pprint' :: Precedence -> [TableField] -> Doc |