Safe Haskell | None |
---|---|
Language | Haskell2010 |
Pretty-printing JavaScript.
- class Pretty a where
- javaScript :: JavaScript a -> Doc
- renderStatements :: [Statement a] -> String
- renderExpression :: Expression a -> String
- class PP a where
- unsafeInExprStmt :: Expression a -> Bool
Documentation
A class of pretty-printable ECMAScript AST nodes. Will
pretty-print correct JavaScript given that the isValid
predicate
holds for the AST.
prettyPrint :: a -> Doc Source #
Pretty PrefixOp Source # | |
Pretty AssignOp Source # | |
Pretty InfixOp Source # | |
Pretty [Statement a] Source # | |
Pretty (Statement a) Source # | |
Pretty (ForInInit a) Source # | |
Pretty (ForInit a) Source # | |
Pretty (VarDecl a) Source # | |
Pretty (CatchClause a) Source # | |
Pretty (CaseClause a) Source # | |
Pretty (Expression a) Source # | |
Pretty (LValue a) Source # | |
Pretty (Prop a) Source # | |
Pretty (Id a) Source # | |
Pretty (JavaScript a) Source # | |
javaScript :: JavaScript a -> Doc Source #
Deprecated: These interfaces are outdated and would be removed/hidden in version 1.0. Use the Pretty class instead.
DEPRECATED: Use prettyPrint
instead! Renders a JavaScript
program as a document, the show instance of Doc
will pretty-print
it automatically
renderStatements :: [Statement a] -> String Source #
Deprecated: These interfaces are outdated and would be removed/hidden in version 1.0. Use the Pretty class instead.
DEPRECATED: Use prettyPrint
instead! Renders a list of
statements as a String
renderExpression :: Expression a -> String Source #
Deprecated: These interfaces are outdated and would be removed/hidden in version 1.0. Use the Pretty class instead.
DEPRECATED: Use prettyPrint
instead! Renders a list of
statements as a String
Deprecated: These interfaces are outdated and would be removed/hidden in version 1.0. Use the Pretty class instead.
unsafeInExprStmt :: Expression a -> Bool Source #
A predicate to tell if the expression --when pretty-printed-- will begin with "function" or '{' and be thus unsafe to use in an expression statement without wrapping it in '()'.