packages feed

WebBits 2.0 → 2.1

raw patch · 4 files changed

+47/−22 lines, 4 filesdep ~parsec

Dependency ranges changed: parsec

Files

LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2009, Arjun Guha, Claudiu Saftoiu, and Spiridon Eliopoulos+Copyright (c) 2007--2011, Brown University and Claudiu Saftoiu All Rights Reserved.  Redistribution and use in source and binary forms, with or without
WebBits.cabal view
@@ -1,8 +1,7 @@ Name:           WebBits-Version:        2.0+Version:        2.1 Cabal-Version:	>= 1.2.3-Copyright:      Copyright (c) 2007-2009 Arjun Guha, Claudiu Saftoiu, -                and Spiridon Eliopoulos+Copyright:      Copyright (c) 2007-2011 Brown University and Claudiu Saftoiu License:        BSD3 License-file:   LICENSE Author:         Arjun Guha, Claudiu Saftoiu, and Spiridon Eliopoulos@@ -22,7 +21,7 @@   Build-Depends:     base >= 4 && < 5,     mtl >= 1.1.0.1,-    parsec < 3.0.0,+    parsec < 3.2.0,     pretty >= 0.1,     containers >= 0.1,     syb >= 0.1
src/BrownPLT/JavaScript/Lexer.hs view
@@ -34,6 +34,7 @@                  "[", "]", "{", "}", "(", ")","</","instanceof"]                  True -- case-sensitive             +lex :: T.TokenParser st lex = T.makeTokenParser javascriptDef  -- everything but commaSep and semiSep
src/BrownPLT/JavaScript/Parser.hs view
@@ -35,6 +35,7 @@ type StatementParser state = CharParser state ParsedStatement type ExpressionParser state = CharParser state ParsedExpression +identifier :: CharParser st (Id SourcePos) identifier =   liftM2 Id getPosition Lexer.identifier @@ -376,8 +377,10 @@   let parseFlags = do         flags <- many (oneOf "mgi")         return $ \f -> f ('g' `elem` flags) ('i' `elem` flags) -  let parseEscape = char '\\' >> anyChar-  let parseChar = noneOf "/"+  let parseEscape :: CharParser st Char+      parseEscape = char '\\' >> anyChar+  let parseChar :: CharParser st Char+      parseChar = noneOf "/"   let parseRe = (char '/' >> return "") <|>                  (do char '\\'                     ch <- anyChar -- TOOD: too lenient@@ -542,22 +545,44 @@  exprTable:: [[Operator Char st ParsedExpression]] exprTable = -  [-   [makeInfixExpr "*" OpMul, makeInfixExpr "/" OpDiv, makeInfixExpr "%" OpMod],-   [makeInfixExpr "+" OpAdd, makeInfixExpr "-" OpSub],-   [makeInfixExpr "<<" OpLShift, makeInfixExpr ">>" OpSpRShift,-    makeInfixExpr ">>>" OpZfRShift],-   [makeInfixExpr "<" OpLT, makeInfixExpr "<=" OpLEq, makeInfixExpr ">" OpGT,-    makeInfixExpr ">=" OpGEq, -    makeInfixExpr "instanceof" OpInstanceof, makeInfixExpr "in" OpIn],-   [makeInfixExpr "&" OpBAnd], -   [makeInfixExpr "^" OpBXor], -   [makeInfixExpr "|" OpBOr],-   [makeInfixExpr "&&" OpLAnd],-   [makeInfixExpr "||" OpLOr],  -   [makeInfixExpr "==" OpEq, makeInfixExpr "!=" OpNEq,-    makeInfixExpr "===" OpStrictEq, makeInfixExpr "!==" OpStrictNEq]+  [ [ makeInfixExpr "==" OpEq+    , makeInfixExpr "!=" OpNEq+    , makeInfixExpr "===" OpStrictEq+    , makeInfixExpr "!==" OpStrictNEq     ]++  , [ makeInfixExpr "||" OpLOr ]++  , [ makeInfixExpr "&&" OpLAnd ]+  +  , [ makeInfixExpr "|" OpBOr ]++  , [ makeInfixExpr "^" OpBXor ]++  , [ makeInfixExpr "&" OpBAnd ]++  , [ makeInfixExpr "<" OpLT+    , makeInfixExpr "<=" OpLEq+    , makeInfixExpr ">" OpGT+    , makeInfixExpr ">=" OpGEq+    , makeInfixExpr "instanceof" OpInstanceof+    , makeInfixExpr "in" OpIn+    ]++  , [ makeInfixExpr "<<" OpLShift+    , makeInfixExpr ">>" OpSpRShift+    , makeInfixExpr ">>>" OpZfRShift+    ]++  , [ makeInfixExpr "+" OpAdd+    , makeInfixExpr "-" OpSub+    ]++  , [ makeInfixExpr "*" OpMul+    , makeInfixExpr "/" OpDiv+    , makeInfixExpr "%" OpMod+    ]+  ]  parseExpression' =    buildExpressionParser exprTable parsePrefixedExpr <?> "simple expression"