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

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

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

readJsModule :: String -> JSAST Source #

parseFile :: FilePath -> IO JSAST Source #

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

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

showStripped :: JSAST -> String Source #

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

# AST elements

data JSExpression Source #

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

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

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

toConstr :: JSExpression -> Constr Source #

dataTypeOf :: JSExpression -> DataType Source #

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

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

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

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

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

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

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

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

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

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

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

data JSAnnot Source #

Constructors

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

#### Instances

Instances details

Data JSAnnot Source # |

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

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

toConstr :: JSAnnot -> Constr Source #

dataTypeOf :: JSAnnot -> DataType Source #

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

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

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

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

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

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

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

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

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

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

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

data JSBinOp Source #

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

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

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

toConstr :: JSBinOp -> Constr Source #

dataTypeOf :: JSBinOp -> DataType Source #

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

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

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

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

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

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

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

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

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

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

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

data JSBlock Source #

Constructors

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

#### Instances

Instances details

Data JSBlock Source # |

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

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

toConstr :: JSBlock -> Constr Source #

dataTypeOf :: JSBlock -> DataType Source #

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

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

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

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

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

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

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

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

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

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

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

data JSUnaryOp Source #

Constructors

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

#### Instances

Instances details

Data JSUnaryOp Source # |

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

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

toConstr :: JSUnaryOp -> Constr Source #

dataTypeOf :: JSUnaryOp -> DataType Source #

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

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

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

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

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

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

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

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

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

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

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

data JSSemi Source #

Constructors

JSSemi !JSAnnot |
JSSemiAuto |

#### Instances

Instances details

Data JSSemi Source # |

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

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

toConstr :: JSSemi -> Constr Source #

dataTypeOf :: JSSemi -> DataType Source #

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

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

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

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

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

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

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

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

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

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

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

data JSAssignOp Source #

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

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

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

toConstr :: JSAssignOp -> Constr Source #

dataTypeOf :: JSAssignOp -> DataType Source #

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

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

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

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

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

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

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

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

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

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

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

data JSTryCatch Source #

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

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

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

toConstr :: JSTryCatch -> Constr Source #

dataTypeOf :: JSTryCatch -> DataType Source #

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

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

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

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

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

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

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

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

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

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

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

data JSTryFinally Source #

Constructors

JSFinally !JSAnnot !JSBlock | finally,block
JSNoFinally |

#### Instances

Instances details

Data JSTryFinally Source # |

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

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

toConstr :: JSTryFinally -> Constr Source #

dataTypeOf :: JSTryFinally -> DataType Source #

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

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

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

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

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

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

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

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

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

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

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

data JSStatement Source #

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

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

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

toConstr :: JSStatement -> Constr Source #

dataTypeOf :: JSStatement -> DataType Source #

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

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

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

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

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

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

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

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

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

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

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

data JSSwitchParts Source #

Constructors

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

#### Instances

Instances details

Data JSSwitchParts Source # |

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

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

toConstr :: JSSwitchParts -> Constr Source #

dataTypeOf :: JSSwitchParts -> DataType Source #

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

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

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

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

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

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

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

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

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

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

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

data JSAST Source #

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

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

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

toConstr :: JSAST -> Constr Source #

dataTypeOf :: JSAST -> DataType Source #

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

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

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

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

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

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

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

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

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

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

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

data CommentAnnotation Source #

Constructors

CommentA TokenPosn String |
WhiteSpace TokenPosn String |
NoComment |

#### Instances

Instances details

Data CommentAnnotation Source # |

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

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

toConstr :: CommentAnnotation -> Constr Source #

dataTypeOf :: CommentAnnotation -> DataType Source #

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

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

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

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

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

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

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

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

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

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

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

data TokenPosn Source #

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

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

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

toConstr :: TokenPosn -> Constr Source #

dataTypeOf :: TokenPosn -> DataType Source #

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

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

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

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

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

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

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

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

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

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

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

tokenPosnEmpty :: TokenPosn Source #

# Pretty Printing

renderJS :: JSAST -> Builder Source #

renderToString :: JSAST -> String Source #

renderToText :: JSAST -> Text Source #