Safe Haskell | None |
---|---|
Language | Haskell98 |
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
- | JSCallExpression !JSExpression !JSAnnot !(JSCommaList JSExpression) !JSAnnot
- | JSCallExpressionDot !JSExpression !JSAnnot !JSExpression
- | JSCallExpressionSquare !JSExpression !JSAnnot !JSExpression !JSAnnot
- | JSCommaExpression !JSExpression !JSAnnot !JSExpression
- | JSExpressionBinary !JSExpression !JSBinOp !JSExpression
- | JSExpressionParen !JSAnnot !JSExpression !JSAnnot
- | JSExpressionPostfix !JSExpression !JSUnaryOp
- | JSExpressionTernary !JSExpression !JSAnnot !JSExpression !JSAnnot !JSExpression
- | JSArrowExpression !JSAnnot !(JSCommaList JSIdent) !JSAnnot !JSAnnot !JSStatement
- | JSFunctionExpression !JSAnnot !JSIdent !JSAnnot !(JSCommaList JSIdent) !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
- | JSUnaryExpression !JSUnaryOp !JSExpression
- | JSVarInitExpression !JSExpression !JSVarInitializer
- data JSAnnot
- data JSBinOp
- = JSBinOpAnd !JSAnnot
- | JSBinOpAs !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
- data JSSemi
- = JSSemi !JSAnnot
- | JSSemiAuto
- data JSAssignOp
- data JSTryCatch
- data JSTryFinally
- data JSStatement
- = JSStatementBlock !JSAnnot ![JSStatement] !JSAnnot !JSSemi
- | JSBreak !JSAnnot !JSIdent !JSSemi
- | JSLet !JSAnnot !(JSCommaList JSExpression) !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
- | JSForOf !JSAnnot !JSAnnot !JSExpression !JSBinOp !JSExpression !JSAnnot !JSStatement
- | JSForVarOf !JSAnnot !JSAnnot !JSAnnot !JSExpression !JSBinOp !JSExpression !JSAnnot !JSStatement
- | JSFunction !JSAnnot !JSIdent !JSAnnot !(JSCommaList JSIdent) !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
- data CommentAnnotation
- data TokenPosn = TokenPn !Int !Int !Int
- tokenPosnEmpty :: TokenPosn
- renderJS :: JSAST -> Builder
- renderToString :: JSAST -> String
- renderToText :: JSAST -> Text
Documentation
:: 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.
:: 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
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 #
AST elements
data JSExpression Source #
Instances
Eq JSExpression Source # | |
Defined in Language.JavaScript.Parser.AST (==) :: JSExpression -> JSExpression -> Bool # (/=) :: JSExpression -> JSExpression -> Bool # | |
Data JSExpression Source # | |
Defined in Language.JavaScript.Parser.AST 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 :: (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 Source # | |
Defined in Language.JavaScript.Parser.AST showsPrec :: Int -> JSExpression -> ShowS # show :: JSExpression -> String # showList :: [JSExpression] -> ShowS # |
JSAnnot !TokenPosn ![CommentAnnotation] | Annotation: position and comment/whitespace information |
JSAnnotSpace | A single space character |
JSNoAnnot | No annotation |
Instances
Eq JSAnnot Source # | |
Data JSAnnot Source # | |
Defined in Language.JavaScript.Parser.AST 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 :: (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 Source # | |
Instances
Eq JSBinOp Source # | |
Data JSBinOp Source # | |
Defined in Language.JavaScript.Parser.AST 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 :: (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 Source # | |
JSBlock !JSAnnot ![JSStatement] !JSAnnot | lbrace, stmts, rbrace |
Instances
Eq JSBlock Source # | |
Data JSBlock Source # | |
Defined in Language.JavaScript.Parser.AST 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 :: (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 Source # | |
Instances
Eq JSUnaryOp Source # | |
Data JSUnaryOp Source # | |
Defined in Language.JavaScript.Parser.AST 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 :: (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 Source # | |
Instances
Eq JSSemi Source # | |
Data JSSemi Source # | |
Defined in Language.JavaScript.Parser.AST 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 :: (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 Source # | |
data JSAssignOp Source #
Instances
Eq JSAssignOp Source # | |
Defined in Language.JavaScript.Parser.AST (==) :: JSAssignOp -> JSAssignOp -> Bool # (/=) :: JSAssignOp -> JSAssignOp -> Bool # | |
Data JSAssignOp Source # | |
Defined in Language.JavaScript.Parser.AST 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 :: (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 Source # | |
Defined in Language.JavaScript.Parser.AST showsPrec :: Int -> JSAssignOp -> ShowS # show :: JSAssignOp -> String # showList :: [JSAssignOp] -> ShowS # |
data JSTryCatch Source #
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
Eq JSTryCatch Source # | |
Defined in Language.JavaScript.Parser.AST (==) :: JSTryCatch -> JSTryCatch -> Bool # (/=) :: JSTryCatch -> JSTryCatch -> Bool # | |
Data JSTryCatch Source # | |
Defined in Language.JavaScript.Parser.AST 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 :: (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 Source # | |
Defined in Language.JavaScript.Parser.AST showsPrec :: Int -> JSTryCatch -> ShowS # show :: JSTryCatch -> String # showList :: [JSTryCatch] -> ShowS # |
data JSTryFinally Source #
JSFinally !JSAnnot !JSBlock | finally,block |
JSNoFinally |
Instances
Eq JSTryFinally Source # | |
Defined in Language.JavaScript.Parser.AST (==) :: JSTryFinally -> JSTryFinally -> Bool # (/=) :: JSTryFinally -> JSTryFinally -> Bool # | |
Data JSTryFinally Source # | |
Defined in Language.JavaScript.Parser.AST 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 :: (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 Source # | |
Defined in Language.JavaScript.Parser.AST showsPrec :: Int -> JSTryFinally -> ShowS # show :: JSTryFinally -> String # showList :: [JSTryFinally] -> ShowS # |
data JSStatement Source #
Instances
Eq JSStatement Source # | |
Defined in Language.JavaScript.Parser.AST (==) :: JSStatement -> JSStatement -> Bool # (/=) :: JSStatement -> JSStatement -> Bool # | |
Data JSStatement Source # | |
Defined in Language.JavaScript.Parser.AST 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 :: (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 Source # | |
Defined in Language.JavaScript.Parser.AST showsPrec :: Int -> JSStatement -> ShowS # show :: JSStatement -> String # showList :: [JSStatement] -> ShowS # |
data JSSwitchParts Source #
JSCase !JSAnnot !JSExpression !JSAnnot ![JSStatement] | expr,colon,stmtlist |
JSDefault !JSAnnot !JSAnnot ![JSStatement] | colon,stmtlist |
Instances
JSAstProgram ![JSStatement] !JSAnnot | source elements, trailing whitespace |
JSAstModule ![JSModuleItem] !JSAnnot | |
JSAstStatement !JSStatement !JSAnnot | |
JSAstExpression !JSExpression !JSAnnot | |
JSAstLiteral !JSExpression !JSAnnot |
Instances
Eq JSAST Source # | |
Data JSAST Source # | |
Defined in Language.JavaScript.Parser.AST 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 # 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 :: (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 Source # | |
data CommentAnnotation Source #
Instances
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.
Instances
Eq TokenPosn Source # | |
Data TokenPosn Source # | |
Defined in Language.JavaScript.Parser.SrcLocation 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 :: (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 Source # | |
Show TokenPosn Source # | |
Pretty Printing
renderToString :: JSAST -> String Source #
renderToText :: JSAST -> Text Source #