Oy      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  Safe-Inferred  Safe-Inferred1The parser type, parametrised by the stream type s and the  return value a  Safe-Inferred     Safe-InferreduStatements, spec 12. function f(x, y, z) {...} , spec 13  var x, y=42; , spec 12.2  with (o) stmt , spec 12.10  return expr; , spec 12.9  throw expr; , spec 12.13 !#try stmt catch(x) stmt finally stmt , spec 12.14 ""ForStmt a init test increment body, for (init; test,  increment) body , spec 12.6 #for (x in o) stmt , spec 12.6 $ lab: stmt , spec 12.12 % continue lab; , spec 12.7 & break lab; , spec 12.8 'do stmt while (e); , spec 12.6 (while (e) do stmt , spec 12.6 )switch (e) clauses , spec 12.11 *if (e) stmt1 else stmt2 , spec 12.5 + if (e) stmt , spec 12.5 ,expr; , spec 12.4 -; , spec 12.3 .{stmts} , spec 12.1 /for..in initializer, spec 12.6 0foo.baz, foo[bar], z 1 var x2for initializer, spec 12.6 3 expr4  var x, y=425empty 6"A variable declaration, spec 12.2 7  var x = e;8Catch clause, spec 12.14 9 catch (x) {...}:Case clauses, spec 12.11 ; default: stmts;< case e: stmts;=Expressions, see spec 11 >function f (x,y,z) {...}, spec 11.2.5, 13 ?f(x,y,z), spec 11.2.3 funcexprs are optionally named @e1, e2 , spec 11.14 Ae1 @=e2 , spec 11.13 B e1 ? e2 : e3 , spec 11.12 Ce1@e22, spec 11.5, 11.6, 11.7, 11.8, 11.9, 11.10, 11.11 D++x, x--! etc., spec 11.3, 11.4.4, 11.4.5 E@e(, spec 11.4 (excluding 11.4.4, 111.4.5) F new foo(bar), spec 11.2.2 Gfoo[bar, spec 11.2.1 Hfoo.bar, spec 11.2.1 Ifoo, spec 11.1.2 Jthis, spec 11.1.1 K{foo:"bar" , baz: 42}, spec 11.1.5 L[1,2,3], spec 11.1.4 Mnull, spec 11.1.3, 7.8 Ntrue, spec 11.1.3, 7.8 O42, spec 11.1.3, 7.8 P41.99999, spec 11.1.3, 7.8 Q-RegexpLit a regexp global? case_insensitive? -- regular " expression, see spec 11.1.3, 7.8 R"foo", spec 11.1.3, 7.8 S*Left-hand side expressions: see spec 11.2 T foo[bar]U foo.barVvariable reference, foo W9Property names in an object initializer: see spec 11.1.5 Xproperty name is an integer, 42 Yproperty name is a string, "foo" Z property name is an identifier, foo [;Prefix operators: see spec 11.4 (excluding 11.4.4, 11.4.5) \ delete] void^ typeof_ -` +a ~b !c:Unary assignment operators: see spec 11.3, 11.4.4, 11.4.5 d x--e x++f --xg ++xh%Assignment operators: see spec 11.13 i |=j ^=k &=l >>>=m >>=n <<=o %=p /=q *=r -=s +=tsimple assignment, = u%Infix operators: see spec 11.5-11.11 v +w |x ^y &z >>>{ >>| <<} -~ % / * || && !=== === != ==  instanceof in >= > <= < A script in <script> ... </script> tags. +extracts statements from a JavaScript type Returns  if the statement is an IterationStatement  according to spec 12.6. { !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~z !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~z.-,+*)('&%$#"! :<;892543/1067=RQPONMLKJIHGFEDCBA@?>u~}|{zyxwvhtsrqponmlkji[ba`_^]\WZYXcgfedSVUT.-,+*)('&%$#"! /1025436789:<;=RQPONMLKJIHGFEDCBA@?>SVUTWZYX[ba`_^]\cgfedh tsrqponmlkjiu~}|{zyxwv Safe-Inferred2A class of pretty-printable ECMAScript AST nodes. )Pretty-print an ECMAScript AST node. Use  or  to  convert  to . DEPRECATED: Use  instead! Renders a JavaScript - program as a document, the show instance of  will pretty-print  it automatically DEPRECATED: Use  instead! Renders a list of  statements as a  DEPRECATED: Use  instead! Renders a list of  statements as a  KEscapes a regular expression so that it can be parsed correctly afterwards ppRelationalExpression True is RelationalExpression,  ppRelationalExpression False is RelationalExpressionNoIn 2     0      Safe-Inferred ?Things that have annotations -- for example, nodes in a syntax  tree /Returns the annotation of the root of the tree .Sets the annotation of the root of the tree  Removes annotations from a tree >Changes all the labels in the tree to another one, given by a  function. @add an extra field to the AST labels (the label would look like   (a, b) ) remove an extra field BAssigns unique numeric (Int) ids to each node in the AST. Returns $ a pair: the tree annotated with UID's and the last ID that was  assigned. :Modify the annotation of the root node of the syntax tree  starting id  tree root   Safe-Inferred @checks if the label is not yet on the stack, if it is -- throws 1 an error; otherwise it pushes it onto the stack 5The parser that parses a single ECMAScript statement DCreates a decimal value from a whole, fractional and exponent part. ,A parser that parses ECMAScript expressions ,A parser that parses an ECMAScript program. ,Parse from a stream given a parser, same as   F in Parsec. We can use this to parse expressions or statements alone,  not just whole programs. $A convenience function that takes a  and tries to parse  it as an ECMAScript program: $ parseFromString = parse program "" @A convenience function that takes a filename and tries to parse A the file contents an ECMAScript program, it fails with an error  message if it can't. ?Read a JavaScript program from file an parse it into a list of  statements )Parse a JavaScript program from a string ;Parse a JavaScript source string into a list of statements V !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZThe parser to use Name of the source file the stream to parse, usually a  JavaScript source to parse  file name  file name source file name JavaScript source to parse JavaScript source V !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZNone;Fixes labels so that labeled breaks and continues refer to E existing labeled statements, enclosing them; also, reduces the size C of the label set. Assumes that the program has a proper syntactic  structure, i.e.  s = True. 'choose n elements from a list randomly 9A predicate that tells us whether a program has a fixable/correct  label-break/5continue structure. The predicate imposes syntactic B restrictions on the break, continue and labeled statements as in  the ECMA spec BImposes relaxed restrictions on break and continue per ECMAScript A 5 spec (page 92): any continue without a label should be nested ? within an iteration stmt, any continue with a label should be > nested in a labeled statement (not necessarily with the same D label); any break statement without a label should be nested in an C iteration or switch stmt, any break statement with a label should A be nested in a labeled statement (not necessarily with the same  label). ARemoves duplicate labels from nested labeled statements in order B to impose restrictions on labeled statements as per ECMAScript 5 C spec (page 95): nested labeled statements cannot have duplicating  labels. %Selects a random element of the list Changes labels of break/*continue so that they refer to one of the  enclosing labels '[\]^_`abcdefghi'[\]^_`abcdefghiNonejklmjklm Safe-InferredFThe statically-determinate lexical structure of a JavaScript program. nEIntermediate data structure that contains locally declared names and  all references to identifers. nopqrstuvwxyz{|}~enclosing environment !local environment and references #environment and global definitions browser/testing environment nopqrstuvwxyz{|}~ None+Labels are either strings (identifiers) or empty (see 12.12 of  the spec) 9Annotates statements with their label sets; example use: +let jsa = reannotate (\a -> (a, Set.empty))Iin annotateLabelSets jsa snd (\labs (a, ls) -> (a, labs `Set.union` ls)) 12 ECMA262: the production  Identifier :  Statement is  evaluated by adding  Identifier to the label ser of  Statement  and then evluating  Statement . If the LabelledStatement itsef E has a non-empty label set, these labels are also added to the label  set of  Statement2 before evaluating it. ... Prior to evaluation of  a LabelledStatement, the contained  Statement is regarded as 0 possessing an empty label set, unless it is an IterationStatement  or a SwitchStatement-, in which case it is regarded as possessing / a label set consisting of the single element, empty. annotation read function annotation write function the script to annotate   Safe-Inferred Safe-Inferred !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHHIIJKJLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~          !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~~e    language-ecmascript-0.15.2Language.ECMAScript3.SyntaxLanguage.ECMAScript3.ParserLanguage.ECMAScript3.Lexer Language.ECMAScript3.PrettyPrint'Language.ECMAScript3.Syntax.Annotations%Language.ECMAScript3.Syntax.Arbitrary&Language.ECMAScript3.Syntax.QuasiQuote)Language.ECMAScript3.Analysis.Environment'Language.ECMAScript3.Analysis.LabelSetsLanguage.ECMAScript3.SourceDiff!Language.ECMAScript3.Parser.State Language.ECMAScript3.Parser.Type Text.ParsecparseLanguage.ECMAScript3 parsec-3.1.3Text.Parsec.Pos SourcePosParseridentifierStart identifierreservedoperator reservedOp charLiteral stringLiteralnaturalintegerfloatnaturalOrFloatdecimal hexadecimaloctalsymbol whiteSpaceparensbracessquaressemicommacolondotbracketslexeme Statement FunctionStmt VarDeclStmtWithStmt ReturnStmt ThrowStmtTryStmtForStmt ForInStmt LabelledStmt ContinueStmt BreakStmt DoWhileStmt WhileStmt SwitchStmt IfSingleStmtIfStmtExprStmt EmptyStmt BlockStmt ForInInit ForInLValForInVarForInitExprInitVarInitNoInitVarDecl CatchClause CaseClause CaseDefault ExpressionFuncExprCallExprListExpr AssignExprCondExpr InfixExprUnaryAssignExpr PrefixExprNewExpr BracketRefDotRefVarRefThisRef ObjectLitArrayLitNullLitBoolLitIntLitNumLit RegexpLit StringLitLValueLBracketLDotLVarPropPropNum PropStringPropIdPrefixOp PrefixDelete PrefixVoid PrefixTypeof PrefixMinus PrefixPlus PrefixBNot PrefixLNot UnaryAssignOp PostfixDec PostfixInc PrefixDec PrefixIncAssignOp OpAssignBOr OpAssignBXor OpAssignBAndOpAssignZfRShiftOpAssignSpRShiftOpAssignLShift OpAssignMod OpAssignDiv OpAssignMul OpAssignSub OpAssignAddOpAssignInfixOpOpAddOpBOrOpBXorOpBAnd OpZfRShift OpSpRShiftOpLShiftOpSubOpModOpDivOpMulOpLOrOpLAnd OpStrictNEq OpStrictEqOpNEqOpEq OpInstanceofOpInOpGEqOpGTOpLEqOpLTId JavaScriptScript unJavaScriptunIdisIterationStmtPPppPretty prettyPrint javaScriptrenderStatementsrenderExpression HasAnnotation getAnnotation setAnnotationremoveAnnotations reannotateaddExtraAnnotationFieldremoveExtraAnnotationFieldassignUniqueIdswithAnnotationExpressionParserStatementParserParsedExpressionParsedStatementparseBlockStmtparseStatement statementparseObjectLitparseSimpleExpr' assignExprparseExpression expression parseScriptprogramparseFromString parseFromFileparseJavaScriptFromFileparseScriptFromString parseString LabelSubstMSGencshrinksGen recursive rarbitrary rrarbitrary atLeastOfSizelistOfNnonEmptyString regexpBody nonNegativestringOfLengthemptyStmtShrinkemptyConstantPool fixLabels rChooseElemisProgramFixableisBreakContinueFixableremoveDuplicateLabelsselectRandomElementfixBreakContinueLabels isSwitchStmtjsexprjsstmtjsEnvTreeenv localVarsLabel EmptyLabelannotateLabelSetsjsDiff ParserState javascriptDeflexghc-prim GHC.TypesTrue$fDefaultSourcePos$fDefaultJavaScriptpretty-1.1.1.0Text.PrettyPrint.HughesPJrenderbaseGHC.ShowshowDocGHC.BaseString regexpEscapeppRelationalExpressioninBlockasBlock ppVarDecljsEscapeppPrimaryExpressionppMemberExpressionppCallExpression ppObjInDotRef ppArgumentsppLHSExpressionppPostfixExpressionppUnaryExpressionppMultiplicativeExpressionppAdditiveExpressionppShiftExpressionppEqualityExpressionppBitwiseANDExpressionppBitwiseXORExpressionppBitwiseORExpressionppLogicalANDExpressionppLogicalORExpressionppConditionalExpressionppAssignmentExpression ppExpressionmaybe$fPPa $fPrettyId $fPrettyProp$fPrettyPrefixOp$fPrettyAssignOp$fPrettyInfixOp$fPrettyCaseClause$fPrettyVarDecl$fPrettyLValue$fPrettyForInInit$fPrettyForInit$fPrettyCatchClause$fPrettyStatement$fPrettyExpression $fPretty[]$fPrettyJavaScript$fHasAnnotationId$fHasAnnotationCatchClause$fHasAnnotationCaseClause$fHasAnnotationProp$fHasAnnotationVarDecl$fHasAnnotationLValue$fHasAnnotationStatement$fHasAnnotationExpression pushLabel mkDecimalinitialParserStatepopLabel clearLabelswithFreshLabelStack parseIfStmtparseSwitchStmtparseWhileStmtparseDoWhileStmtparseContinueStmtparseBreakStmtparseEmptyStmtparseLabelledStmtparseExpressionStmtparseForInStmt parseForStmt parseTryStmtparseThrowStmtparseReturnStmt parseWithStmt parseVarDeclparseVarDeclStmtparseFunctionStmt parseThisRef parseNullLit parseBoolLit parseVarRef parseArrayLit parseFuncExpr escapeChars allEscapesparseEscapeCharparseAsciiHexCharparseUnicodeHexChar isWhitespaceparseStringLit'parseStringLitparseRegexpLithexLit exponentPartjparserdecLitintLen parseNumLitwithPosdotReffuncApp bracketRefparseParenExprparseExprForNew parseNewExprparseSimpleExprparseSimpleExprForNew makeInfixExprparsePrefixedExpr exprTableparseExpression'asLValuelvalueunaryAssignExprparseTernaryExpr'parseTernaryExprassignOp parseListExpr$fArbitraryJavaScript$fArbitraryStatement$fArbitraryVarDecl$fArbitraryCatchClause$fArbitraryForInit$fArbitraryForInInit$fArbitraryExpression$fArbitraryLValue$fArbitraryProp$fArbitraryCaseClause $fArbitraryId$fArbitraryPrefixOp$fArbitraryUnaryAssignOp$fArbitraryInfixOp$fArbitraryAssignOp quoteJSExpr quoteJSStmtquoteJS quoteCommonPartial partialLocalspartialReferences partialNestedemptyrefdeclnestunions javascriptexpr caseClause catchClausevarDeclforInit forInInitstmt makeEnvTreeannotateStatementannotateFuncStmtBodiesannotateFuncExprBodiesid2Label