WebBits 2.1 → 2.2
raw patch · 5 files changed
+29/−18 lines, 5 filesnew-uploader
Files
- WebBits.cabal +18/−9
- src/BrownPLT/JavaScript/Environment.hs +2/−2
- src/BrownPLT/JavaScript/Parser.hs +2/−2
- src/BrownPLT/JavaScript/PrettyPrint.hs +6/−4
- src/BrownPLT/JavaScript/Syntax.hs +1/−1
WebBits.cabal view
@@ -1,19 +1,28 @@ Name: WebBits-Version: 2.1-Cabal-Version: >= 1.2.3-Copyright: Copyright (c) 2007-2011 Brown University and Claudiu Saftoiu+Version: 2.2+Cabal-Version: >= 1.6+Copyright: Copyright (c) 2007-2011 Brown University, Claudiu Saftoiu, Arjun Guha, Spiridon Eliopoulos, Copyright (c) 2012 Arjun Guha and Andrey Chudnov License: BSD3 License-file: LICENSE-Author: Arjun Guha, Claudiu Saftoiu, and Spiridon Eliopoulos-Maintainer: Arjun Guha <arjun@cs.brown.edu>-Homepage: http://www.cs.brown.edu/research/plt/+Author: Arjun Guha, Claudiu Saftoiu, Spiridon Eliopoulos and Andrey Chudnov+Maintainer: Andrey Chudnov <oss@chudnov.com>+Homepage: http://github.com/brownplt/webbits+Bug-reports: http://github.com/brownplt/webbits/issues Stability: provisional+Tested-with: GHC==7.0.4, GHC==7.4.1 Category: Language Build-Type: Custom Synopsis: JavaScript analysis tools-Description:+Description: WebBits is a collection of libraries for working with JavaScript, contains a parser, a pretty-printer and a lexical environment analyser. The original author of the package is the PLT group of Brown University (http:\/\/www.cs.brown.edu\/research\/plt\/). Changes since version 2.1: the syntax of the try-catch-finally statement has been changed in accordance to the ECMAScript specification -- now it only has at most one catch clause. The original test-suite needs updating to support the current test system: patches are welcome. - WebBits is a collection of libraries for working with JavaScript.+Source-repository head+ type: git+ location: git://github.com/brownplt/webbits.git++Source-repository this+ type: git+ location: git://github.com/brownplt/webbits.git+ tag: WebBits-2.2 Library Hs-Source-Dirs:@@ -28,7 +37,7 @@ ghc-options: -fwarn-incomplete-patterns Extensions: - Generics DeriveDataTypeable+ DeriveDataTypeable Exposed-Modules: BrownPLT.JavaScript BrownPLT.JavaScript.Lexer
src/BrownPLT/JavaScript/Environment.hs view
@@ -114,8 +114,8 @@ ForInStmt _ fii e s -> unions [forInInit fii, expr e, stmt s] ForStmt _ fi me1 me2 s -> unions [forInit fi, maybe empty expr me1, maybe empty expr me2, stmt s]- TryStmt _ s catches ms ->- unions [stmt s, unions $ map catchClause catches, maybe empty stmt ms]+ TryStmt _ s catch ms ->+ unions [stmt s, maybe empty catchClause catch, maybe empty stmt ms] ThrowStmt _ e -> expr e ReturnStmt _ me -> maybe empty expr me WithStmt _ e s -> unions [expr e, stmt s]
src/BrownPLT/JavaScript/Parser.hs view
@@ -198,10 +198,10 @@ in do reserved "try" pos <- getPosition guarded <- parseStatement- catches <- many parseCatchClause+ catch <- optionMaybe parseCatchClause finally <- (reserved "finally" >> liftM Just parseStatement) <|> (return Nothing)- return (TryStmt pos guarded catches finally)+ return (TryStmt pos guarded catch finally) parseThrowStmt:: StatementParser st parseThrowStmt = do
src/BrownPLT/JavaScript/PrettyPrint.hs view
@@ -57,8 +57,10 @@ text "default:" $$ (nest 2 (semiSep ss)) -catchClause :: CatchClause a -> Doc-catchClause (CatchClause _ id s) = text "catch" <+> (parens.pp) id <+> inBlock s+catchClause :: Maybe (CatchClause a) -> Doc+catchClause Nothing = empty+catchClause (Just (CatchClause _ id s)) = + text "catch" <+> (parens.pp) id <+> inBlock s varDecl :: VarDecl a -> Doc@@ -93,8 +95,8 @@ text "for" <+> parens (forInit init <> semi <+> mexpr incr <> semi <+> mexpr test) $$ stmt body- TryStmt _ stmt catches finally ->- text "try" $$ inBlock stmt $$ (vcat (map catchClause catches)) $$+ TryStmt _ stmt catch finally ->+ text "try" $$ inBlock stmt $$ catchClause catch $$ ppFinally where ppFinally = case finally of Nothing -> empty
src/BrownPLT/JavaScript/Syntax.hs view
@@ -121,7 +121,7 @@ (Maybe (Expression a)) -- test (Maybe (Expression a)) -- increment (Statement a) -- body- | TryStmt a (Statement a) {-body-} [CatchClause a] {-catches-}+ | TryStmt a (Statement a) {-body-} (Maybe (CatchClause a)) (Maybe (Statement a)) {-finally-} | ThrowStmt a (Expression a) | ReturnStmt a (Maybe (Expression a))