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

Safe HaskellNone
LanguageHaskell2010

Language.ECMAScript3.PrettyPrint

Description

Pretty-printing JavaScript.

Synopsis

Documentation

class Pretty a where Source #

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 -> Doc Source #

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

Instances
Pretty PrefixOp Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Pretty AssignOp Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Pretty InfixOp Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Pretty [Statement a] Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Methods

prettyPrint :: [Statement a] -> Doc Source #

Pretty (Statement a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Pretty (ForInInit a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Pretty (ForInit a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Methods

prettyPrint :: ForInit a -> Doc Source #

Pretty (VarDecl a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Methods

prettyPrint :: VarDecl a -> Doc Source #

Pretty (CatchClause a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Pretty (CaseClause a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Pretty (Expression a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Pretty (LValue a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Methods

prettyPrint :: LValue a -> Doc Source #

Pretty (Prop a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Methods

prettyPrint :: Prop a -> Doc Source #

Pretty (Id a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Methods

prettyPrint :: Id a -> Doc Source #

Pretty (JavaScript a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

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

class PP a where Source #

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

Methods

pp :: a -> Doc Source #

Instances
Pretty a => PP a Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Methods

pp :: a -> Doc Source #

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