language-ecmascript-0.16.2: JavaScript parser and pretty-printer library

Safe HaskellNone

Language.ECMAScript3.PrettyPrint

Description

Pretty-printing JavaScript.

Synopsis

Documentation

class Pretty a whereSource

A class of pretty-printable ECMAScript AST nodes. Will pretty-print correct JavaScript given that the isValid predicate holds for the AST.

Methods

prettyPrint :: a -> DocSource

Pretty-print an ECMAScript AST node. Use render or show to convert Doc to String.

javaScript :: JavaScript a -> DocSource

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] -> StringSource

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 -> StringSource

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

class PP a whereSource

Deprecated: These interfaces are outdated and would be removed/hidden in version 1.0. Use the Pretty class instead.

Methods

pp :: a -> DocSource

Instances

Pretty a => PP a 

unsafeInExprStmt :: Expression a -> BoolSource

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 '()'.