language-javascript-0.7.1.0: Parser for JavaScript

Safe Haskell | None
Language | Haskell98

Language.JavaScript.Parser

Contents

- AST elements
- Pretty Printing

Synopsis

- parse :: String -> String -> Either String JSAST
- parseModule :: String -> String -> Either String JSAST
- readJs :: String -> JSAST
- readJsModule :: String -> JSAST
- parseFile :: FilePath -> IO JSAST
- parseFileUtf8 :: FilePath -> IO JSAST
- showStripped :: JSAST -> String
- showStrippedMaybe :: Show a => Either a JSAST -> String
- data JSExpression
  - = JSIdentifier !JSAnnot !String
  - | JSDecimal !JSAnnot !String
  - | JSLiteral !JSAnnot !String
  - | JSHexInteger !JSAnnot !String
  - | JSOctal !JSAnnot !String
  - | JSStringLiteral !JSAnnot !String
  - | JSRegEx !JSAnnot !String
  - | JSArrayLiteral !JSAnnot ![JSArrayElement] !JSAnnot
  - | JSAssignExpression !JSExpression !JSAssignOp !JSExpression
  - | JSAwaitExpression !JSAnnot !JSExpression
  - | JSCallExpression !JSExpression !JSAnnot !(JSCommaList JSExpression) !JSAnnot
  - | JSCallExpressionDot !JSExpression !JSAnnot !JSExpression
  - | JSCallExpressionSquare !JSExpression !JSAnnot !JSExpression !JSAnnot
  - | JSClassExpression !JSAnnot !JSIdent !JSClassHeritage !JSAnnot ![JSClassElement] !JSAnnot
  - | JSCommaExpression !JSExpression !JSAnnot !JSExpression
  - | JSExpressionBinary !JSExpression !JSBinOp !JSExpression
  - | JSExpressionParen !JSAnnot !JSExpression !JSAnnot
  - | JSExpressionPostfix !JSExpression !JSUnaryOp
  - | JSExpressionTernary !JSExpression !JSAnnot !JSExpression !JSAnnot !JSExpression
  - | JSArrowExpression !JSArrowParameterList !JSAnnot !JSStatement
  - | JSFunctionExpression !JSAnnot !JSIdent !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSBlock
  - | JSGeneratorExpression !JSAnnot !JSAnnot !JSIdent !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSBlock
  - | JSMemberDot !JSExpression !JSAnnot !JSExpression
  - | JSMemberExpression !JSExpression !JSAnnot !(JSCommaList JSExpression) !JSAnnot
  - | JSMemberNew !JSAnnot !JSExpression !JSAnnot !(JSCommaList JSExpression) !JSAnnot
  - | JSMemberSquare !JSExpression !JSAnnot !JSExpression !JSAnnot
  - | JSNewExpression !JSAnnot !JSExpression
  - | JSObjectLiteral !JSAnnot !JSObjectPropertyList !JSAnnot
  - | JSSpreadExpression !JSAnnot !JSExpression
  - | JSTemplateLiteral !(Maybe JSExpression) !JSAnnot !String ![JSTemplatePart]
  - | JSUnaryExpression !JSUnaryOp !JSExpression
  - | JSVarInitExpression !JSExpression !JSVarInitializer
  - | JSYieldExpression !JSAnnot !(Maybe JSExpression)
  - | JSYieldFromExpression !JSAnnot !JSAnnot !JSExpression
- data JSAnnot
  - = JSAnnot !TokenPosn ![CommentAnnotation]
  - | JSAnnotSpace
  - | JSNoAnnot
- data JSBinOp
  - = JSBinOpAnd !JSAnnot
  - | JSBinOpBitAnd !JSAnnot
  - | JSBinOpBitOr !JSAnnot
  - | JSBinOpBitXor !JSAnnot
  - | JSBinOpDivide !JSAnnot
  - | JSBinOpEq !JSAnnot
  - | JSBinOpGe !JSAnnot
  - | JSBinOpGt !JSAnnot
  - | JSBinOpIn !JSAnnot
  - | JSBinOpInstanceOf !JSAnnot
  - | JSBinOpLe !JSAnnot
  - | JSBinOpLsh !JSAnnot
  - | JSBinOpLt !JSAnnot
  - | JSBinOpMinus !JSAnnot
  - | JSBinOpMod !JSAnnot
  - | JSBinOpNeq !JSAnnot
  - | JSBinOpOf !JSAnnot
  - | JSBinOpOr !JSAnnot
  - | JSBinOpPlus !JSAnnot
  - | JSBinOpRsh !JSAnnot
  - | JSBinOpStrictEq !JSAnnot
  - | JSBinOpStrictNeq !JSAnnot
  - | JSBinOpTimes !JSAnnot
  - | JSBinOpUrsh !JSAnnot
- data JSBlock = JSBlock !JSAnnot ![JSStatement] !JSAnnot
- data JSUnaryOp
  - = JSUnaryOpDecr !JSAnnot
  - | JSUnaryOpDelete !JSAnnot
  - | JSUnaryOpIncr !JSAnnot
  - | JSUnaryOpMinus !JSAnnot
  - | JSUnaryOpNot !JSAnnot
  - | JSUnaryOpPlus !JSAnnot
  - | JSUnaryOpTilde !JSAnnot
  - | JSUnaryOpTypeof !JSAnnot
  - | JSUnaryOpVoid !JSAnnot
- data JSSemi
  - = JSSemi !JSAnnot
  - | JSSemiAuto
- data JSAssignOp
  - = JSAssign !JSAnnot
  - | JSTimesAssign !JSAnnot
  - | JSDivideAssign !JSAnnot
  - | JSModAssign !JSAnnot
  - | JSPlusAssign !JSAnnot
  - | JSMinusAssign !JSAnnot
  - | JSLshAssign !JSAnnot
  - | JSRshAssign !JSAnnot
  - | JSUrshAssign !JSAnnot
  - | JSBwAndAssign !JSAnnot
  - | JSBwXorAssign !JSAnnot
  - | JSBwOrAssign !JSAnnot
- data JSTryCatch
  - = JSCatch !JSAnnot !JSAnnot !JSExpression !JSAnnot !JSBlock
  - | JSCatchIf !JSAnnot !JSAnnot !JSExpression !JSAnnot !JSExpression !JSAnnot !JSBlock
- data JSTryFinally
  - = JSFinally !JSAnnot !JSBlock
  - | JSNoFinally
- data JSStatement
  - = JSStatementBlock !JSAnnot ![JSStatement] !JSAnnot !JSSemi
  - | JSBreak !JSAnnot !JSIdent !JSSemi
  - | JSLet !JSAnnot !(JSCommaList JSExpression) !JSSemi
  - | JSClass !JSAnnot !JSIdent !JSClassHeritage !JSAnnot ![JSClassElement] !JSAnnot !JSSemi
  - | JSConstant !JSAnnot !(JSCommaList JSExpression) !JSSemi
  - | JSContinue !JSAnnot !JSIdent !JSSemi
  - | JSDoWhile !JSAnnot !JSStatement !JSAnnot !JSAnnot !JSExpression !JSAnnot !JSSemi
  - | JSFor !JSAnnot !JSAnnot !(JSCommaList JSExpression) !JSAnnot !(JSCommaList JSExpression) !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSStatement
  - | JSForIn !JSAnnot !JSAnnot !JSExpression !JSBinOp !JSExpression !JSAnnot !JSStatement
  - | JSForVar !JSAnnot !JSAnnot !JSAnnot !(JSCommaList JSExpression) !JSAnnot !(JSCommaList JSExpression) !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSStatement
  - | JSForVarIn !JSAnnot !JSAnnot !JSAnnot !JSExpression !JSBinOp !JSExpression !JSAnnot !JSStatement
  - | JSForLet !JSAnnot !JSAnnot !JSAnnot !(JSCommaList JSExpression) !JSAnnot !(JSCommaList JSExpression) !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSStatement
  - | JSForLetIn !JSAnnot !JSAnnot !JSAnnot !JSExpression !JSBinOp !JSExpression !JSAnnot !JSStatement
  - | JSForLetOf !JSAnnot !JSAnnot !JSAnnot !JSExpression !JSBinOp !JSExpression !JSAnnot !JSStatement
  - | JSForConst !JSAnnot !JSAnnot !JSAnnot !(JSCommaList JSExpression) !JSAnnot !(JSCommaList JSExpression) !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSStatement
  - | JSForConstIn !JSAnnot !JSAnnot !JSAnnot !JSExpression !JSBinOp !JSExpression !JSAnnot !JSStatement
  - | JSForConstOf !JSAnnot !JSAnnot !JSAnnot !JSExpression !JSBinOp !JSExpression !JSAnnot !JSStatement
  - | JSForOf !JSAnnot !JSAnnot !JSExpression !JSBinOp !JSExpression !JSAnnot !JSStatement
  - | JSForVarOf !JSAnnot !JSAnnot !JSAnnot !JSExpression !JSBinOp !JSExpression !JSAnnot !JSStatement
  - | JSAsyncFunction !JSAnnot !JSAnnot !JSIdent !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSBlock !JSSemi
  - | JSFunction !JSAnnot !JSIdent !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSBlock !JSSemi
  - | JSGenerator !JSAnnot !JSAnnot !JSIdent !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSBlock !JSSemi
  - | JSIf !JSAnnot !JSAnnot !JSExpression !JSAnnot !JSStatement
  - | JSIfElse !JSAnnot !JSAnnot !JSExpression !JSAnnot !JSStatement !JSAnnot !JSStatement
  - | JSLabelled !JSIdent !JSAnnot !JSStatement
  - | JSEmptyStatement !JSAnnot
  - | JSExpressionStatement !JSExpression !JSSemi
  - | JSAssignStatement !JSExpression !JSAssignOp !JSExpression !JSSemi
  - | JSMethodCall !JSExpression !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSSemi
  - | JSReturn !JSAnnot !(Maybe JSExpression) !JSSemi
  - | JSSwitch !JSAnnot !JSAnnot !JSExpression !JSAnnot !JSAnnot ![JSSwitchParts] !JSAnnot !JSSemi
  - | JSThrow !JSAnnot !JSExpression !JSSemi
  - | JSTry !JSAnnot !JSBlock ![JSTryCatch] !JSTryFinally
  - | JSVariable !JSAnnot !(JSCommaList JSExpression) !JSSemi
  - | JSWhile !JSAnnot !JSAnnot !JSExpression !JSAnnot !JSStatement
  - | JSWith !JSAnnot !JSAnnot !JSExpression !JSAnnot !JSStatement !JSSemi
- data JSSwitchParts
  - = JSCase !JSAnnot !JSExpression !JSAnnot ![JSStatement]
  - | JSDefault !JSAnnot !JSAnnot ![JSStatement]
- data JSAST
  - = JSAstProgram ![JSStatement] !JSAnnot
  - | JSAstModule ![JSModuleItem] !JSAnnot
  - | JSAstStatement !JSStatement !JSAnnot
  - | JSAstExpression !JSExpression !JSAnnot
  - | JSAstLiteral !JSExpression !JSAnnot
- data CommentAnnotation
  - = CommentA TokenPosn String
  - | WhiteSpace TokenPosn String
  - | NoComment
- data TokenPosn = TokenPn !Int !Int !Int
- tokenPosnEmpty :: TokenPosn
- renderJS :: JSAST -> Builder
- renderToString :: JSAST -> String
- renderToText :: JSAST -> Text

# Documentation

parse #

Arguments

:: String | The input stream (Javascript source code).
-> String | The name of the Javascript source (filename or input device).
-> Either String JSAST | An error or maybe the abstract syntax tree (AST) of zero or more Javascript statements, plus comments.

Parse JavaScript Program (Script) Parse one compound statement, or a sequence of simple statements. Generally used for interactive input, such as from the command line of an interpreter. Return comments in addition to the parsed statements.

parseModule #

Arguments

:: String | The input stream (JavaScript source code).
-> String | The name of the JavaScript source (filename or input device).
-> Either String JSAST | An error or maybe the abstract syntax tree (AST) of zero or more JavaScript statements, plus comments.

Parse JavaScript module

readJs :: String -> JSAST #

readJsModule :: String -> JSAST #

parseFile :: FilePath -> IO JSAST #

Parse the given file. For UTF-8 support, make sure your locale is set such that "System.IO.localeEncoding" returns "utf8"

parseFileUtf8 :: FilePath -> IO JSAST #

Parse the given file, explicitly setting the encoding to UTF8 when reading it

showStripped :: JSAST -> String #

showStrippedMaybe :: Show a => Either a JSAST -> String #

# AST elements

data JSExpression #

Constructors

JSIdentifier !JSAnnot !String | Terminals
JSDecimal !JSAnnot !String |
JSLiteral !JSAnnot !String |
JSHexInteger !JSAnnot !String |
JSOctal !JSAnnot !String |
JSStringLiteral !JSAnnot !String |
JSRegEx !JSAnnot !String |
JSArrayLiteral | Non Terminals

Fields

- !JSAnnot
- ![JSArrayElement]
- !JSAnnot

  lb, contents, rb

JSAssignExpression !JSExpression !JSAssignOp !JSExpression | lhs, assignop, rhs
JSAwaitExpression !JSAnnot !JSExpression | await, expr
JSCallExpression !JSExpression !JSAnnot !(JSCommaList JSExpression) !JSAnnot | expr, bl, args, rb
JSCallExpressionDot !JSExpression !JSAnnot !JSExpression | expr, dot, expr
JSCallExpressionSquare !JSExpression !JSAnnot !JSExpression !JSAnnot | expr, [, expr, ]
JSClassExpression !JSAnnot !JSIdent !JSClassHeritage !JSAnnot ![JSClassElement] !JSAnnot | class, optional identifier, optional extends clause, lb, body, rb
JSCommaExpression !JSExpression !JSAnnot !JSExpression | expression components
JSExpressionBinary !JSExpression !JSBinOp !JSExpression | lhs, op, rhs
JSExpressionParen !JSAnnot !JSExpression !JSAnnot | lb,expression,rb
JSExpressionPostfix !JSExpression !JSUnaryOp | expression, operator
JSExpressionTernary !JSExpression !JSAnnot !JSExpression !JSAnnot !JSExpression | cond, ?, trueval, :, falseval
JSArrowExpression !JSArrowParameterList !JSAnnot !JSStatement | parameter list,arrow,block`
JSFunctionExpression !JSAnnot !JSIdent !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSBlock | fn,name,lb, parameter list,rb,block`
JSGeneratorExpression !JSAnnot !JSAnnot !JSIdent !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSBlock | fn,*,name,lb, parameter list,rb,block`
JSMemberDot !JSExpression !JSAnnot !JSExpression | firstpart, dot, name
JSMemberExpression !JSExpression !JSAnnot !(JSCommaList JSExpression) !JSAnnot |
JSMemberNew !JSAnnot !JSExpression !JSAnnot !(JSCommaList JSExpression) !JSAnnot | new, name, lb, args, rb
JSMemberSquare !JSExpression !JSAnnot !JSExpression !JSAnnot | firstpart, lb, expr, rb
JSNewExpression !JSAnnot !JSExpression | new, expr
JSObjectLiteral !JSAnnot !JSObjectPropertyList !JSAnnot | lbrace contents rbrace
JSSpreadExpression !JSAnnot !JSExpression |
JSTemplateLiteral !(Maybe JSExpression) !JSAnnot !String ![JSTemplatePart] | optional tag, lquot, head, parts
JSUnaryExpression !JSUnaryOp !JSExpression |
JSVarInitExpression !JSExpression !JSVarInitializer | identifier, initializer
JSYieldExpression !JSAnnot !(Maybe JSExpression) | yield, optional expr
JSYieldFromExpression !JSAnnot !JSAnnot !JSExpression | yield, *, expr

#### Instances

Instances details

Data JSExpression # |

Instance details

Defined in Language.JavaScript.Parser.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> JSExpression -> c JSExpression #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c JSExpression #

toConstr :: JSExpression -> Constr #

dataTypeOf :: JSExpression -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c JSExpression) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c JSExpression) #

gmapT :: (forall b. Data b => b -> b) -> JSExpression -> JSExpression #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> JSExpression -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> JSExpression -> r #

gmapQ :: (forall d. Data d => d -> u) -> JSExpression -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> JSExpression -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> JSExpression -> m JSExpression #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> JSExpression -> m JSExpression #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> JSExpression -> m JSExpression #

Show JSExpression # |
Instance details Defined in Language.JavaScript.Parser.AST Methods showsPrec :: Int -> JSExpression -> ShowS # show :: JSExpression -> String # showList :: [JSExpression] -> ShowS #
Eq JSExpression # |
Instance details Defined in Language.JavaScript.Parser.AST Methods (==) :: JSExpression -> JSExpression -> Bool # (/=) :: JSExpression -> JSExpression -> Bool #

data JSAnnot #

Constructors

JSAnnot !TokenPosn ![CommentAnnotation] | Annotation: position and comment/whitespace information
JSAnnotSpace | A single space character
JSNoAnnot | No annotation

#### Instances

Instances details

Data JSAnnot # |

Instance details

Defined in Language.JavaScript.Parser.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> JSAnnot -> c JSAnnot #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c JSAnnot #

toConstr :: JSAnnot -> Constr #

dataTypeOf :: JSAnnot -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c JSAnnot) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c JSAnnot) #

gmapT :: (forall b. Data b => b -> b) -> JSAnnot -> JSAnnot #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> JSAnnot -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> JSAnnot -> r #

gmapQ :: (forall d. Data d => d -> u) -> JSAnnot -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> JSAnnot -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> JSAnnot -> m JSAnnot #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> JSAnnot -> m JSAnnot #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> JSAnnot -> m JSAnnot #

Show JSAnnot # |
Instance details Defined in Language.JavaScript.Parser.AST Methods showsPrec :: Int -> JSAnnot -> ShowS # show :: JSAnnot -> String # showList :: [JSAnnot] -> ShowS #
Eq JSAnnot # |
Instance details Defined in Language.JavaScript.Parser.AST Methods (==) :: JSAnnot -> JSAnnot -> Bool # (/=) :: JSAnnot -> JSAnnot -> Bool #

data JSBinOp #

Constructors

JSBinOpAnd !JSAnnot |
JSBinOpBitAnd !JSAnnot |
JSBinOpBitOr !JSAnnot |
JSBinOpBitXor !JSAnnot |
JSBinOpDivide !JSAnnot |
JSBinOpEq !JSAnnot |
JSBinOpGe !JSAnnot |
JSBinOpGt !JSAnnot |
JSBinOpIn !JSAnnot |
JSBinOpInstanceOf !JSAnnot |
JSBinOpLe !JSAnnot |
JSBinOpLsh !JSAnnot |
JSBinOpLt !JSAnnot |
JSBinOpMinus !JSAnnot |
JSBinOpMod !JSAnnot |
JSBinOpNeq !JSAnnot |
JSBinOpOf !JSAnnot |
JSBinOpOr !JSAnnot |
JSBinOpPlus !JSAnnot |
JSBinOpRsh !JSAnnot |
JSBinOpStrictEq !JSAnnot |
JSBinOpStrictNeq !JSAnnot |
JSBinOpTimes !JSAnnot |
JSBinOpUrsh !JSAnnot |

#### Instances

Instances details

Data JSBinOp # |

Instance details

Defined in Language.JavaScript.Parser.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> JSBinOp -> c JSBinOp #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c JSBinOp #

toConstr :: JSBinOp -> Constr #

dataTypeOf :: JSBinOp -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c JSBinOp) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c JSBinOp) #

gmapT :: (forall b. Data b => b -> b) -> JSBinOp -> JSBinOp #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> JSBinOp -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> JSBinOp -> r #

gmapQ :: (forall d. Data d => d -> u) -> JSBinOp -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> JSBinOp -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> JSBinOp -> m JSBinOp #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> JSBinOp -> m JSBinOp #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> JSBinOp -> m JSBinOp #

Show JSBinOp # |
Instance details Defined in Language.JavaScript.Parser.AST Methods showsPrec :: Int -> JSBinOp -> ShowS # show :: JSBinOp -> String # showList :: [JSBinOp] -> ShowS #
Eq JSBinOp # |
Instance details Defined in Language.JavaScript.Parser.AST Methods (==) :: JSBinOp -> JSBinOp -> Bool # (/=) :: JSBinOp -> JSBinOp -> Bool #

data JSBlock #

Constructors

JSBlock !JSAnnot ![JSStatement] !JSAnnot | lbrace, stmts, rbrace

#### Instances

Instances details

Data JSBlock # |

Instance details

Defined in Language.JavaScript.Parser.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> JSBlock -> c JSBlock #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c JSBlock #

toConstr :: JSBlock -> Constr #

dataTypeOf :: JSBlock -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c JSBlock) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c JSBlock) #

gmapT :: (forall b. Data b => b -> b) -> JSBlock -> JSBlock #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> JSBlock -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> JSBlock -> r #

gmapQ :: (forall d. Data d => d -> u) -> JSBlock -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> JSBlock -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> JSBlock -> m JSBlock #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> JSBlock -> m JSBlock #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> JSBlock -> m JSBlock #

Show JSBlock # |
Instance details Defined in Language.JavaScript.Parser.AST Methods showsPrec :: Int -> JSBlock -> ShowS # show :: JSBlock -> String # showList :: [JSBlock] -> ShowS #
Eq JSBlock # |
Instance details Defined in Language.JavaScript.Parser.AST Methods (==) :: JSBlock -> JSBlock -> Bool # (/=) :: JSBlock -> JSBlock -> Bool #

data JSUnaryOp #

Constructors

JSUnaryOpDecr !JSAnnot |
JSUnaryOpDelete !JSAnnot |
JSUnaryOpIncr !JSAnnot |
JSUnaryOpMinus !JSAnnot |
JSUnaryOpNot !JSAnnot |
JSUnaryOpPlus !JSAnnot |
JSUnaryOpTilde !JSAnnot |
JSUnaryOpTypeof !JSAnnot |
JSUnaryOpVoid !JSAnnot |

#### Instances

Instances details

Data JSUnaryOp # |

Instance details

Defined in Language.JavaScript.Parser.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> JSUnaryOp -> c JSUnaryOp #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c JSUnaryOp #

toConstr :: JSUnaryOp -> Constr #

dataTypeOf :: JSUnaryOp -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c JSUnaryOp) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c JSUnaryOp) #

gmapT :: (forall b. Data b => b -> b) -> JSUnaryOp -> JSUnaryOp #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> JSUnaryOp -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> JSUnaryOp -> r #

gmapQ :: (forall d. Data d => d -> u) -> JSUnaryOp -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> JSUnaryOp -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> JSUnaryOp -> m JSUnaryOp #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> JSUnaryOp -> m JSUnaryOp #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> JSUnaryOp -> m JSUnaryOp #

Show JSUnaryOp # |
Instance details Defined in Language.JavaScript.Parser.AST Methods showsPrec :: Int -> JSUnaryOp -> ShowS # show :: JSUnaryOp -> String # showList :: [JSUnaryOp] -> ShowS #
Eq JSUnaryOp # |
Instance details Defined in Language.JavaScript.Parser.AST Methods (==) :: JSUnaryOp -> JSUnaryOp -> Bool # (/=) :: JSUnaryOp -> JSUnaryOp -> Bool #

data JSSemi #

Constructors

JSSemi !JSAnnot |
JSSemiAuto |

#### Instances

Instances details

Data JSSemi # |

Instance details

Defined in Language.JavaScript.Parser.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> JSSemi -> c JSSemi #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c JSSemi #

toConstr :: JSSemi -> Constr #

dataTypeOf :: JSSemi -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c JSSemi) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c JSSemi) #

gmapT :: (forall b. Data b => b -> b) -> JSSemi -> JSSemi #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> JSSemi -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> JSSemi -> r #

gmapQ :: (forall d. Data d => d -> u) -> JSSemi -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> JSSemi -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> JSSemi -> m JSSemi #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> JSSemi -> m JSSemi #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> JSSemi -> m JSSemi #

Show JSSemi # |
Instance details Defined in Language.JavaScript.Parser.AST Methods showsPrec :: Int -> JSSemi -> ShowS # show :: JSSemi -> String # showList :: [JSSemi] -> ShowS #
Eq JSSemi # |
Instance details Defined in Language.JavaScript.Parser.AST Methods (==) :: JSSemi -> JSSemi -> Bool # (/=) :: JSSemi -> JSSemi -> Bool #

data JSAssignOp #

Constructors

JSAssign !JSAnnot |
JSTimesAssign !JSAnnot |
JSDivideAssign !JSAnnot |
JSModAssign !JSAnnot |
JSPlusAssign !JSAnnot |
JSMinusAssign !JSAnnot |
JSLshAssign !JSAnnot |
JSRshAssign !JSAnnot |
JSUrshAssign !JSAnnot |
JSBwAndAssign !JSAnnot |
JSBwXorAssign !JSAnnot |
JSBwOrAssign !JSAnnot |

#### Instances

Instances details

Data JSAssignOp # |

Instance details

Defined in Language.JavaScript.Parser.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> JSAssignOp -> c JSAssignOp #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c JSAssignOp #

toConstr :: JSAssignOp -> Constr #

dataTypeOf :: JSAssignOp -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c JSAssignOp) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c JSAssignOp) #

gmapT :: (forall b. Data b => b -> b) -> JSAssignOp -> JSAssignOp #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> JSAssignOp -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> JSAssignOp -> r #

gmapQ :: (forall d. Data d => d -> u) -> JSAssignOp -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> JSAssignOp -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> JSAssignOp -> m JSAssignOp #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> JSAssignOp -> m JSAssignOp #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> JSAssignOp -> m JSAssignOp #

Show JSAssignOp # |
Instance details Defined in Language.JavaScript.Parser.AST Methods showsPrec :: Int -> JSAssignOp -> ShowS # show :: JSAssignOp -> String # showList :: [JSAssignOp] -> ShowS #
Eq JSAssignOp # |
Instance details Defined in Language.JavaScript.Parser.AST Methods (==) :: JSAssignOp -> JSAssignOp -> Bool # (/=) :: JSAssignOp -> JSAssignOp -> Bool #

data JSTryCatch #

Constructors

JSCatch !JSAnnot !JSAnnot !JSExpression !JSAnnot !JSBlock | catch,lb,ident,rb,block
JSCatchIf !JSAnnot !JSAnnot !JSExpression !JSAnnot !JSExpression !JSAnnot !JSBlock | catch,lb,ident,if,expr,rb,block

#### Instances

Instances details

Data JSTryCatch # |

Instance details

Defined in Language.JavaScript.Parser.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> JSTryCatch -> c JSTryCatch #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c JSTryCatch #

toConstr :: JSTryCatch -> Constr #

dataTypeOf :: JSTryCatch -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c JSTryCatch) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c JSTryCatch) #

gmapT :: (forall b. Data b => b -> b) -> JSTryCatch -> JSTryCatch #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> JSTryCatch -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> JSTryCatch -> r #

gmapQ :: (forall d. Data d => d -> u) -> JSTryCatch -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> JSTryCatch -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> JSTryCatch -> m JSTryCatch #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> JSTryCatch -> m JSTryCatch #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> JSTryCatch -> m JSTryCatch #

Show JSTryCatch # |
Instance details Defined in Language.JavaScript.Parser.AST Methods showsPrec :: Int -> JSTryCatch -> ShowS # show :: JSTryCatch -> String # showList :: [JSTryCatch] -> ShowS #
Eq JSTryCatch # |
Instance details Defined in Language.JavaScript.Parser.AST Methods (==) :: JSTryCatch -> JSTryCatch -> Bool # (/=) :: JSTryCatch -> JSTryCatch -> Bool #

data JSTryFinally #

Constructors

JSFinally !JSAnnot !JSBlock | finally,block
JSNoFinally |

#### Instances

Instances details

Data JSTryFinally # |

Instance details

Defined in Language.JavaScript.Parser.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> JSTryFinally -> c JSTryFinally #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c JSTryFinally #

toConstr :: JSTryFinally -> Constr #

dataTypeOf :: JSTryFinally -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c JSTryFinally) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c JSTryFinally) #

gmapT :: (forall b. Data b => b -> b) -> JSTryFinally -> JSTryFinally #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> JSTryFinally -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> JSTryFinally -> r #

gmapQ :: (forall d. Data d => d -> u) -> JSTryFinally -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> JSTryFinally -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> JSTryFinally -> m JSTryFinally #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> JSTryFinally -> m JSTryFinally #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> JSTryFinally -> m JSTryFinally #

Show JSTryFinally # |
Instance details Defined in Language.JavaScript.Parser.AST Methods showsPrec :: Int -> JSTryFinally -> ShowS # show :: JSTryFinally -> String # showList :: [JSTryFinally] -> ShowS #
Eq JSTryFinally # |
Instance details Defined in Language.JavaScript.Parser.AST Methods (==) :: JSTryFinally -> JSTryFinally -> Bool # (/=) :: JSTryFinally -> JSTryFinally -> Bool #

data JSStatement #

Constructors

JSStatementBlock !JSAnnot ![JSStatement] !JSAnnot !JSSemi | lbrace, stmts, rbrace, autosemi
JSBreak !JSAnnot !JSIdent !JSSemi | break,optional identifier, autosemi
JSLet !JSAnnot !(JSCommaList JSExpression) !JSSemi | const, decl, autosemi
JSClass !JSAnnot !JSIdent !JSClassHeritage !JSAnnot ![JSClassElement] !JSAnnot !JSSemi | class, name, optional extends clause, lb, body, rb, autosemi
JSConstant !JSAnnot !(JSCommaList JSExpression) !JSSemi | const, decl, autosemi
JSContinue !JSAnnot !JSIdent !JSSemi | continue, optional identifier,autosemi
JSDoWhile !JSAnnot !JSStatement !JSAnnot !JSAnnot !JSExpression !JSAnnot !JSSemi | do,stmt,while,lb,expr,rb,autosemi
JSFor !JSAnnot !JSAnnot !(JSCommaList JSExpression) !JSAnnot !(JSCommaList JSExpression) !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSStatement | for,lb,expr,semi,expr,semi,expr,rb.stmt
JSForIn !JSAnnot !JSAnnot !JSExpression !JSBinOp !JSExpression !JSAnnot !JSStatement | for,lb,expr,in,expr,rb,stmt
JSForVar !JSAnnot !JSAnnot !JSAnnot !(JSCommaList JSExpression) !JSAnnot !(JSCommaList JSExpression) !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSStatement | for,lb,var,vardecl,semi,expr,semi,expr,rb,stmt
JSForVarIn !JSAnnot !JSAnnot !JSAnnot !JSExpression !JSBinOp !JSExpression !JSAnnot !JSStatement | for,lb,var,vardecl,in,expr,rb,stmt
JSForLet !JSAnnot !JSAnnot !JSAnnot !(JSCommaList JSExpression) !JSAnnot !(JSCommaList JSExpression) !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSStatement | for,lb,var,vardecl,semi,expr,semi,expr,rb,stmt
JSForLetIn !JSAnnot !JSAnnot !JSAnnot !JSExpression !JSBinOp !JSExpression !JSAnnot !JSStatement | for,lb,var,vardecl,in,expr,rb,stmt
JSForLetOf !JSAnnot !JSAnnot !JSAnnot !JSExpression !JSBinOp !JSExpression !JSAnnot !JSStatement | for,lb,var,vardecl,in,expr,rb,stmt
JSForConst !JSAnnot !JSAnnot !JSAnnot !(JSCommaList JSExpression) !JSAnnot !(JSCommaList JSExpression) !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSStatement | for,lb,var,vardecl,semi,expr,semi,expr,rb,stmt
JSForConstIn !JSAnnot !JSAnnot !JSAnnot !JSExpression !JSBinOp !JSExpression !JSAnnot !JSStatement | for,lb,var,vardecl,in,expr,rb,stmt
JSForConstOf !JSAnnot !JSAnnot !JSAnnot !JSExpression !JSBinOp !JSExpression !JSAnnot !JSStatement | for,lb,var,vardecl,in,expr,rb,stmt
JSForOf !JSAnnot !JSAnnot !JSExpression !JSBinOp !JSExpression !JSAnnot !JSStatement | for,lb,expr,in,expr,rb,stmt
JSForVarOf !JSAnnot !JSAnnot !JSAnnot !JSExpression !JSBinOp !JSExpression !JSAnnot !JSStatement | for,lb,var,vardecl,in,expr,rb,stmt
JSAsyncFunction !JSAnnot !JSAnnot !JSIdent !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSBlock !JSSemi | fn,name, lb,parameter list,rb,block,autosemi
JSFunction !JSAnnot !JSIdent !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSBlock !JSSemi | fn,name, lb,parameter list,rb,block,autosemi
JSGenerator !JSAnnot !JSAnnot !JSIdent !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSBlock !JSSemi | fn,*,name, lb,parameter list,rb,block,autosemi
JSIf !JSAnnot !JSAnnot !JSExpression !JSAnnot !JSStatement | if,(,expr,),stmt
JSIfElse !JSAnnot !JSAnnot !JSExpression !JSAnnot !JSStatement !JSAnnot !JSStatement | if,(,expr,),stmt,else,rest
JSLabelled !JSIdent !JSAnnot !JSStatement | identifier,colon,stmt
JSEmptyStatement !JSAnnot |
JSExpressionStatement !JSExpression !JSSemi |
JSAssignStatement !JSExpression !JSAssignOp !JSExpression !JSSemi | lhs, assignop, rhs, autosemi
JSMethodCall !JSExpression !JSAnnot !(JSCommaList JSExpression) !JSAnnot !JSSemi |
JSReturn !JSAnnot !(Maybe JSExpression) !JSSemi | optional expression,autosemi
JSSwitch !JSAnnot !JSAnnot !JSExpression !JSAnnot !JSAnnot ![JSSwitchParts] !JSAnnot !JSSemi | switch,lb,expr,rb,caseblock,autosemi
JSThrow !JSAnnot !JSExpression !JSSemi | throw val autosemi
JSTry !JSAnnot !JSBlock ![JSTryCatch] !JSTryFinally | try,block,catches,finally
JSVariable !JSAnnot !(JSCommaList JSExpression) !JSSemi | var, decl, autosemi
JSWhile !JSAnnot !JSAnnot !JSExpression !JSAnnot !JSStatement | while,lb,expr,rb,stmt
JSWith !JSAnnot !JSAnnot !JSExpression !JSAnnot !JSStatement !JSSemi | with,lb,expr,rb,stmt list

#### Instances

Instances details

Data JSStatement # |

Instance details

Defined in Language.JavaScript.Parser.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> JSStatement -> c JSStatement #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c JSStatement #

toConstr :: JSStatement -> Constr #

dataTypeOf :: JSStatement -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c JSStatement) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c JSStatement) #

gmapT :: (forall b. Data b => b -> b) -> JSStatement -> JSStatement #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> JSStatement -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> JSStatement -> r #

gmapQ :: (forall d. Data d => d -> u) -> JSStatement -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> JSStatement -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> JSStatement -> m JSStatement #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> JSStatement -> m JSStatement #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> JSStatement -> m JSStatement #

Show JSStatement # |
Instance details Defined in Language.JavaScript.Parser.AST Methods showsPrec :: Int -> JSStatement -> ShowS # show :: JSStatement -> String # showList :: [JSStatement] -> ShowS #
Eq JSStatement # |
Instance details Defined in Language.JavaScript.Parser.AST Methods (==) :: JSStatement -> JSStatement -> Bool # (/=) :: JSStatement -> JSStatement -> Bool #

data JSSwitchParts #

Constructors

JSCase !JSAnnot !JSExpression !JSAnnot ![JSStatement] | expr,colon,stmtlist
JSDefault !JSAnnot !JSAnnot ![JSStatement] | colon,stmtlist

#### Instances

Instances details

Data JSSwitchParts # |

Instance details

Defined in Language.JavaScript.Parser.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> JSSwitchParts -> c JSSwitchParts #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c JSSwitchParts #

toConstr :: JSSwitchParts -> Constr #

dataTypeOf :: JSSwitchParts -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c JSSwitchParts) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c JSSwitchParts) #

gmapT :: (forall b. Data b => b -> b) -> JSSwitchParts -> JSSwitchParts #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> JSSwitchParts -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> JSSwitchParts -> r #

gmapQ :: (forall d. Data d => d -> u) -> JSSwitchParts -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> JSSwitchParts -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> JSSwitchParts -> m JSSwitchParts #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> JSSwitchParts -> m JSSwitchParts #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> JSSwitchParts -> m JSSwitchParts #

Show JSSwitchParts # |
Instance details Defined in Language.JavaScript.Parser.AST Methods showsPrec :: Int -> JSSwitchParts -> ShowS # show :: JSSwitchParts -> String # showList :: [JSSwitchParts] -> ShowS #
Eq JSSwitchParts # |
Instance details Defined in Language.JavaScript.Parser.AST Methods (==) :: JSSwitchParts -> JSSwitchParts -> Bool # (/=) :: JSSwitchParts -> JSSwitchParts -> Bool #

data JSAST #

Constructors

JSAstProgram ![JSStatement] !JSAnnot | source elements, trailing whitespace
JSAstModule ![JSModuleItem] !JSAnnot |
JSAstStatement !JSStatement !JSAnnot |
JSAstExpression !JSExpression !JSAnnot |
JSAstLiteral !JSExpression !JSAnnot |

#### Instances

Instances details

Data JSAST # |

Instance details

Defined in Language.JavaScript.Parser.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> JSAST -> c JSAST #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c JSAST #

toConstr :: JSAST -> Constr #

dataTypeOf :: JSAST -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c JSAST) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c JSAST) #

gmapT :: (forall b. Data b => b -> b) -> JSAST -> JSAST #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> JSAST -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> JSAST -> r #

gmapQ :: (forall d. Data d => d -> u) -> JSAST -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> JSAST -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> JSAST -> m JSAST #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> JSAST -> m JSAST #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> JSAST -> m JSAST #

Show JSAST # |
Instance details Defined in Language.JavaScript.Parser.AST Methods showsPrec :: Int -> JSAST -> ShowS # show :: JSAST -> String # showList :: [JSAST] -> ShowS #
Eq JSAST # |
Instance details Defined in Language.JavaScript.Parser.AST Methods (==) :: JSAST -> JSAST -> Bool # (/=) :: JSAST -> JSAST -> Bool #

data CommentAnnotation #

Constructors

CommentA TokenPosn String |
WhiteSpace TokenPosn String |
NoComment |

#### Instances

Instances details

Data CommentAnnotation # |

Instance details

Defined in Language.JavaScript.Parser.Token

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CommentAnnotation -> c CommentAnnotation #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CommentAnnotation #

toConstr :: CommentAnnotation -> Constr #

dataTypeOf :: CommentAnnotation -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CommentAnnotation) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CommentAnnotation) #

gmapT :: (forall b. Data b => b -> b) -> CommentAnnotation -> CommentAnnotation #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CommentAnnotation -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CommentAnnotation -> r #

gmapQ :: (forall d. Data d => d -> u) -> CommentAnnotation -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CommentAnnotation -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CommentAnnotation -> m CommentAnnotation #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CommentAnnotation -> m CommentAnnotation #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CommentAnnotation -> m CommentAnnotation #

Read CommentAnnotation # |
Instance details Defined in Language.JavaScript.Parser.Token Methods readsPrec :: Int -> ReadS CommentAnnotation # readList :: ReadS [CommentAnnotation] # readPrec :: ReadPrec CommentAnnotation # readListPrec :: ReadPrec [CommentAnnotation] #
Show CommentAnnotation # |
Instance details Defined in Language.JavaScript.Parser.Token Methods showsPrec :: Int -> CommentAnnotation -> ShowS # show :: CommentAnnotation -> String # showList :: [CommentAnnotation] -> ShowS #
Eq CommentAnnotation # |
Instance details Defined in Language.JavaScript.Parser.Token Methods (==) :: CommentAnnotation -> CommentAnnotation -> Bool # (/=) :: CommentAnnotation -> CommentAnnotation -> Bool #

data TokenPosn #

`TokenPosn` records the location of a token in the input text. It has three fields: the address (number of characters preceding the token), line number and column of a token within the file. Note: The lexer assumes the usual eight character tab stops.

Constructors

TokenPn !Int !Int !Int |

#### Instances

Instances details

Data TokenPosn # |

Instance details

Defined in Language.JavaScript.Parser.SrcLocation

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TokenPosn -> c TokenPosn #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TokenPosn #

toConstr :: TokenPosn -> Constr #

dataTypeOf :: TokenPosn -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TokenPosn) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TokenPosn) #

gmapT :: (forall b. Data b => b -> b) -> TokenPosn -> TokenPosn #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TokenPosn -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TokenPosn -> r #

gmapQ :: (forall d. Data d => d -> u) -> TokenPosn -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TokenPosn -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TokenPosn -> m TokenPosn #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TokenPosn -> m TokenPosn #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TokenPosn -> m TokenPosn #

Read TokenPosn # |
Instance details Defined in Language.JavaScript.Parser.SrcLocation Methods readsPrec :: Int -> ReadS TokenPosn # readList :: ReadS [TokenPosn] # readPrec :: ReadPrec TokenPosn # readListPrec :: ReadPrec [TokenPosn] #
Show TokenPosn # |
Instance details Defined in Language.JavaScript.Parser.SrcLocation Methods showsPrec :: Int -> TokenPosn -> ShowS # show :: TokenPosn -> String # showList :: [TokenPosn] -> ShowS #
Eq TokenPosn # |
Instance details Defined in Language.JavaScript.Parser.SrcLocation Methods (==) :: TokenPosn -> TokenPosn -> Bool # (/=) :: TokenPosn -> TokenPosn -> Bool #

tokenPosnEmpty :: TokenPosn #

# Pretty Printing

renderJS :: JSAST -> Builder #

renderToString :: JSAST -> String #

renderToText :: JSAST -> Text #