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

Safe HaskellNone
LanguageHaskell2010

Language.ECMAScript3.PrettyPrint

Description

Pretty-printing JavaScript.

Synopsis

Documentation

class Pretty a where #

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

Minimal complete definition

prettyPrint

Methods

prettyPrint :: a -> Doc #

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

Instances

Pretty PrefixOp # 

Methods

prettyPrint :: PrefixOp -> Doc #

Pretty AssignOp # 

Methods

prettyPrint :: AssignOp -> Doc #

Pretty InfixOp # 

Methods

prettyPrint :: InfixOp -> Doc #

Pretty [Statement a] # 

Methods

prettyPrint :: [Statement a] -> Doc #

Pretty (Statement a) # 

Methods

prettyPrint :: Statement a -> Doc #

Pretty (ForInInit a) # 

Methods

prettyPrint :: ForInInit a -> Doc #

Pretty (ForInit a) # 

Methods

prettyPrint :: ForInit a -> Doc #

Pretty (VarDecl a) # 

Methods

prettyPrint :: VarDecl a -> Doc #

Pretty (CatchClause a) # 

Methods

prettyPrint :: CatchClause a -> Doc #

Pretty (CaseClause a) # 

Methods

prettyPrint :: CaseClause a -> Doc #

Pretty (Expression a) # 

Methods

prettyPrint :: Expression a -> Doc #

Pretty (LValue a) # 

Methods

prettyPrint :: LValue a -> Doc #

Pretty (Prop a) # 

Methods

prettyPrint :: Prop a -> Doc #

Pretty (Id a) # 

Methods

prettyPrint :: Id a -> Doc #

Pretty (JavaScript a) # 

Methods

prettyPrint :: JavaScript a -> Doc #

javaScript :: JavaScript a -> Doc #

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 #

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 #

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 #

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

Minimal complete definition

pp

Methods

pp :: a -> Doc #

Instances

Pretty a => PP a # 

Methods

pp :: a -> Doc #

unsafeInExprStmt :: Expression a -> Bool #

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