-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | javascript parser for es6 and es7. -- -- Please see the README on Github at -- https://github.com/diasbruno/language-js#README.md @package language-js @version 0.1.0 module Language.JS.Common parens :: Stream s m Char => ParsecT s u m a -> ParsecT s u m a braces :: Stream s m Char => ParsecT s u m a -> ParsecT s u m a angles :: Stream s m Char => ParsecT s u m a -> ParsecT s u m a brackets :: Stream s m Char => ParsecT s u m a -> ParsecT s u m a semi :: Stream s m Char => ParsecT s u m String comma :: Stream s m Char => ParsecT s u m String dot :: Stream s m Char => ParsecT s u m String colon :: Stream s m Char => ParsecT s u m String dotSep :: Stream s m Char => ParsecT s u m a -> ParsecT s u m [a] commaSep :: Stream s m Char => ParsecT s u m a -> ParsecT s u m [a] semiSep :: Stream s m Char => ParsecT s u m a -> ParsecT s u m [a] commaSep1 :: Stream s m Char => ParsecT s u m a -> ParsecT s u m [a] semiSep1 :: Stream s m Char => ParsecT s u m a -> ParsecT s u m [a] whiteSpaces :: Stream s m Char => ParsecT s u m String lexeme :: Stream s m Char => ParsecT s u m a -> ParsecT s u m a keywordB :: Stream s m Char => String -> ParsecT s u m String -- | reserved words reservedWords :: [String] module Language.JS.Types data ObjectProperty OPI :: Expression -> ObjectProperty OPKV :: Expression -> Expression -> ObjectProperty OP :: Expression -> ObjectProperty OPM :: Expression -> ObjectProperty type IsPrefix = Bool data SwitchCase Case :: Expression -> SwitchCase DefaultCase :: SwitchCase type ExpressionOpt = Maybe Expression type StatementOpt = Maybe Statement data ForStyle ForIn :: BindExpression -> Expression -> ForStyle ForInV :: String -> BindExpression -> Expression -> ForStyle ForOf :: BindExpression -> Expression -> ForStyle ForOfV :: String -> BindExpression -> Expression -> ForStyle ForRegular :: (Maybe BindExpression) -> ExpressionOpt -> ExpressionOpt -> ForStyle -- | import and export binds * as identifier A, ... {x,...} data ImportClause Namespace :: Expression -> ImportClause DefaultName :: Expression -> ImportClause BindNames :: [Expression] -> ImportClause data BindExpression BindVar :: Expression -> (Maybe Expression) -> BindExpression BindPattern :: Expression -> (Maybe Expression) -> BindExpression BindRest :: Expression -> BindExpression data Expression LThis :: Expression LNull :: Expression LI :: String -> Expression LN :: String -> Expression LS :: String -> Expression LTS :: String -> Expression LB :: Bool -> Expression RegExp :: String -> String -> Expression UnaryUpdate :: String -> IsPrefix -> Expression -> Expression Unary :: String -> Expression -> Expression Spread :: Expression -> Expression LA :: [Expression] -> Expression LO :: [ObjectProperty] -> Expression LP :: Expression -> Expression Condition :: Expression -> Expression -> Expression -> Expression Assignment :: String -> Expression -> Expression -> Expression Operation :: String -> Expression -> Expression -> Expression Function :: ExpressionOpt -> [BindExpression] -> Statement -> Expression Arrow :: (Either BindExpression [BindExpression]) -> Statement -> Expression Class :: ExpressionOpt -> ExpressionOpt -> Statement -> Expression ClassProperty :: Expression -> Expression -> Expression PropertyMethod :: Expression -> [BindExpression] -> Statement -> Expression ClassStatic :: Expression -> Expression ClassGetMethod :: Expression -> Expression ClassSetMethod :: Expression -> Expression Async :: Expression -> Expression Dot :: Expression -> Expression -> Expression Acc :: Expression -> Expression -> Expression FCall :: Expression -> [Expression] -> Expression New :: Expression -> Expression Comma :: Expression -> Expression -> Expression Empty :: Expression Comment :: String -> Expression MultilineComment :: String -> Expression data Statement SExp :: Expression -> Statement SImportFile :: Expression -> Statement SImport :: (Either ImportClause [ImportClause]) -> Expression -> Statement SRExport :: Expression -> Expression -> Statement SExport :: Statement -> Statement SExportDefault :: Expression -> Statement SC :: String -> ExpressionOpt -> Statement -> Statement SF :: String -> [BindExpression] -> Statement -> Statement SVariable :: String -> [BindExpression] -> Statement SWhile :: [Expression] -> Statement -> Statement SDoWhile :: Statement -> [Expression] -> Statement SFor :: ForStyle -> Statement -> Statement SLabel :: Expression -> Statement -> Statement SDebugger :: Statement SContinue :: ExpressionOpt -> Statement SBreak :: ExpressionOpt -> Statement SBlock :: [Statement] -> Statement SIf :: Expression -> Statement -> StatementOpt -> Statement SSwitch :: Expression -> [Statement] -> Statement SCase :: [SwitchCase] -> [Statement] -> Statement SThrow :: Expression -> Statement STry :: Statement -> Statement -> StatementOpt -> Statement SCatch :: ExpressionOpt -> Statement -> Statement SFinally :: Statement -> Statement SReturn :: Expression -> Statement SWith :: Expression -> Statement -> Statement instance GHC.Show.Show Language.JS.Types.SwitchCase instance GHC.Show.Show Language.JS.Types.ForStyle instance GHC.Show.Show Language.JS.Types.ImportClause instance GHC.Show.Show Language.JS.Types.ObjectProperty instance GHC.Show.Show Language.JS.Types.BindExpression instance GHC.Show.Show Language.JS.Types.Expression instance GHC.Show.Show Language.JS.Types.Statement module Language.JS.Operators opNotFollowedBy :: (Show a, Stream s m Char) => String -> ParsecT s u m a -> ParsecT s u m String table :: Stream s m Char => Bool -> ParsecT s u m Expression -> [[Operator s u m Expression]] operationExp :: Stream s m Char => Bool -> ParsecT s u m Expression -> ParsecT s u m Expression -> ParsecT s u m Expression module Language.JS.Parser -- | identifier identifier :: () => ParsecT String u Identity [Char] identB :: () => ParsecT String u Identity Expression -- | numbers numberB :: () => ParsecT String u Identity Expression -- | booleans boolB :: () => ParsecT String u Identity Expression -- | this thisB :: () => ParsecT String u Identity Expression -- | null nullB :: () => ParsecT String u Identity Expression stringA :: Stream s m Char => (a -> b) -> Char -> (Char -> ParsecT s u m a) -> ParsecT s u m b -- | strings literal stringB :: () => ParsecT String u Identity Expression -- | template strings templateStringB :: () => ParsecT String u Identity Expression regexB :: (Stream s m Char) => ParsecT s u m Expression -- | array literal arrayB :: () => ParsecT String u Identity Expression -- | parenthesis expression parensB :: () => ParsecT String u Identity Expression checkSpread :: Stream s m Char => (b -> b) -> ParsecT s u m b -> ParsecT s u m b formalParameter :: () => ParsecT String u Identity BindExpression -- | function expression functionDeclB :: () => ParsecT String u Identity Expression -- | arrow expression (function) afunctionB :: () => ParsecT String u Identity Expression functionB :: () => ParsecT String u Identity Expression propertyMethodDef :: () => ParsecT String u Identity Expression classStaticDef :: () => ParsecT String u Identity Expression classGetSetMethodDef :: () => ParsecT String u Identity Expression asyncMethodDef :: () => ParsecT String u Identity Expression classPropertyDef :: () => ParsecT String u Identity Expression classB :: () => ParsecT String u Identity Expression -- | key and/or value property pair kvB :: () => ParsecT String u Identity ObjectProperty -- | object literal objectB :: () => ParsecT String u Identity Expression dotMember :: () => Expression -> ParsecT String u Identity Expression accessor :: () => Expression -> ParsecT String u Identity Expression callExp :: () => Expression -> ParsecT String u Identity Expression -- | new newB :: () => ParsecT String u Identity Maybe a memberExp :: () => Maybe Expression -> ParsecT String u Identity Expression literals :: () => ParsecT String u Identity Expression primaryExp :: () => ParsecT String u Identity Expression maybeSemi :: () => ParsecT String u Identity () emptyExp :: () => ParsecT String u Identity Expression leftHandSideExp :: () => ParsecT String u Identity Expression -- | expressions expressions :: () => ParsecT String u Identity Expression comment :: () => ParsecT String u Identity Expression multilineComment :: () => ParsecT String u Identity Expression expressionNonEmpty :: () => Bool -> ParsecT String u Identity Expression toStatement :: Expression -> Statement importNamespaceClause :: () => ParsecT String u Identity ImportClause importBindClause :: () => ParsecT String u Identity ImportClause importDefaultNameClause :: () => ParsecT String u Identity ImportClause importManyClauses :: () => ParsecT String u Identity [ImportClause] importClauses :: () => ParsecT String u Identity Either ImportClause [ImportClause] importFileStatement :: () => ParsecT String u Identity Statement importStatement :: () => ParsecT String u Identity Statement importStatements :: () => ParsecT String u Identity Statement reexportStatement :: () => ParsecT String u Identity Statement exportDefaultStatement :: () => ParsecT String u Identity Statement exportStatement :: () => ParsecT String u Identity Statement exportStatements :: () => ParsecT String u Identity Statement continueStatement :: () => ParsecT String u Identity Statement breakStatement :: () => ParsecT String u Identity Statement blockStatement :: Stream s m Char => ParsecT s u m Statement -> ParsecT s u m Statement ifStatement :: () => ParsecT String u Identity Statement catchB :: () => ParsecT String u Identity Statement finallyB :: () => ParsecT String u Identity Statement tryStatement :: () => ParsecT String u Identity Statement throwStatement :: () => ParsecT String u Identity Statement returnStatement :: () => ParsecT String u Identity Statement bindVar :: () => ParsecT String u Identity BindExpression bindPatternDecl :: () => ParsecT String u Identity BindExpression bindSpread :: () => ParsecT String u Identity BindExpression bindExpression :: () => ParsecT String u Identity BindExpression constVariableStatement :: () => ParsecT String u Identity Statement notConstVariableStatement :: () => ParsecT String u Identity Statement variableStatement :: () => ParsecT String u Identity Statement caseClause :: () => ParsecT String u Identity SwitchCase caseCase :: () => ParsecT String u Identity Statement caseBlock :: () => ParsecT String u Identity [Statement] switchStatement :: () => ParsecT String u Identity Statement debuggerStatement :: () => ParsecT String u Identity Statement breakableStatement :: () => ParsecT String u Identity Statement whileStatement :: () => ParsecT String u Identity Statement doWhileStatement :: () => ParsecT String u Identity Statement forInVStyle :: () => ParsecT String u Identity ForStyle forOfVStyle :: () => ParsecT String u Identity ForStyle forInStyle :: () => ParsecT String u Identity ForStyle forOfStyle :: () => ParsecT String u Identity ForStyle forRegularStyle :: () => ParsecT String u Identity ForStyle forStyle :: () => ParsecT String u Identity ForStyle forStatement :: () => ParsecT String u Identity Statement iterationStatement :: () => ParsecT String u Identity Statement withStatement :: () => ParsecT String u Identity Statement labelledStatement :: () => ParsecT String u Identity Statement statements :: () => ParsecT String u Identity Statement topLevelStatements :: () => ParsecT String u Identity Statement -- | parser parseJs :: () => ParsecT String u Identity [Statement] parse :: String -> String -> Either ParseError [Statement] parseFromFile :: String -> IO (Either ParseError [Statement])