summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG5
-rw-r--r--LICENSE2
-rw-r--r--language-ecmascript.cabal8
-rw-r--r--src/Language/ECMAScript3/Syntax/Arbitrary.hs16
4 files changed, 26 insertions, 5 deletions
diff --git a/CHANGELOG b/CHANGELOG
index a9973f0..b005d88 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,9 @@
Version change log.
+=0.17.0.2=
+Fixed a bug in the Arbitrary instance: no longer generating empty list expressions. Dependency bounds update.
+
+=0.17.0.1=
+Dependency bounds update.
=0.17=
Added helper functions for code generation (see Language.ECMAScript3.Syntax.CodeGen). Bug fixes to the Arbitrary instances.
diff --git a/LICENSE b/LICENSE
index 7369370..c53d40b 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,5 +1,5 @@
Copyright (c) 2007--2012, Brown University, 2008-2012 Claudiu Saftoiu,
-2012-2015 Stevens Institute of Technology.
+2012-2016 Stevens Institute of Technology.
All Rights Reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/language-ecmascript.cabal b/language-ecmascript.cabal
index ea0b4b9..5192723 100644
--- a/language-ecmascript.cabal
+++ b/language-ecmascript.cabal
@@ -1,8 +1,8 @@
Name: language-ecmascript
-Version: 0.17.0.1
+Version: 0.17.0.2
Cabal-Version: >= 1.10
Copyright: (c) 2007-2012 Brown University, (c) 2008-2010 Claudiu Saftoiu,
- (c) 2012-2015 Stevens Institute of Technology
+ (c) 2012-2016 Stevens Institute of Technology
License: BSD3
License-file: LICENSE
Author: Andrey Chudnov, Arjun Guha, Spiridon Aristides Eliopoulos,
@@ -29,7 +29,7 @@ Source-repository head
Source-repository this
type: git
location: git://github.com/jswebtools/language-ecmascript.git
- tag: 0.17.0.1
+ tag: 0.17.0.2
Library
Hs-Source-Dirs:
@@ -85,7 +85,7 @@ Test-Suite test
containers == 0.*,
directory >= 1.2 && < 1.3,
filepath >= 1.3 && < 1.5,
- HUnit >= 1.2 && < 1.3,
+ HUnit >= 1.2 && < 1.4,
QuickCheck >= 2.5 && < 3,
data-default-class >= 0.0.1 && < 0.1,
test-framework >= 0.8 && < 0.9,
diff --git a/src/Language/ECMAScript3/Syntax/Arbitrary.hs b/src/Language/ECMAScript3/Syntax/Arbitrary.hs
index d48140c..87a5a8e 100644
--- a/src/Language/ECMAScript3/Syntax/Arbitrary.hs
+++ b/src/Language/ECMAScript3/Syntax/Arbitrary.hs
@@ -184,6 +184,8 @@ instance (Data a) => Fixable (JavaScript a) where
:: Id a -> Gen (Id a))
>=>transformBiM (fixUpFunExpr
:: Expression a -> Gen (Expression a))
+ >=>transformBiM (fixUpListExpr
+ :: Expression a -> Gen (Expression a))
>=>transformBiM (fixUpFunStmt
:: Statement a -> Gen (Statement a))
>=>transformBiM (return . fixLValue
@@ -193,42 +195,49 @@ instance (Data a) => Fixable (JavaScript a) where
instance (Data a) => Fixable (Expression a) where
fixUp = (fixUpFunExpr . transformBi (identifierFixup :: Id a -> Id a))
>=>transformBiM (fixUpFunExpr :: Expression a -> Gen (Expression a))
+ >=>transformBiM (fixUpListExpr :: Expression a -> Gen (Expression a))
>=>transformBiM (fixUpFunStmt :: Statement a -> Gen (Statement a))
>=>transformBiM (return . fixLValue :: LValue a -> Gen (LValue a))
instance (Data a) => Fixable (Statement a) where
fixUp = (fixUpFunStmt . transformBi (identifierFixup :: Id a -> Id a))
>=>transformBiM (fixUpFunExpr :: Expression a -> Gen (Expression a))
+ >=>transformBiM (fixUpListExpr :: Expression a -> Gen (Expression a))
>=>transformBiM (fixUpFunStmt :: Statement a -> Gen (Statement a))
>=>transformBiM (return . fixLValue :: LValue a -> Gen (LValue a))
instance (Data a) => Fixable (CaseClause a) where
fixUp = transformBiM (return . identifierFixup :: Id a -> Gen (Id a))
>=>transformBiM (fixUpFunExpr :: Expression a -> Gen (Expression a))
+ >=>transformBiM (fixUpListExpr :: Expression a -> Gen (Expression a))
>=>transformBiM (fixUpFunStmt :: Statement a -> Gen (Statement a))
>=>transformBiM (return . fixLValue :: LValue a -> Gen (LValue a))
instance (Data a) => Fixable (CatchClause a) where
fixUp = transformBiM (return . identifierFixup :: Id a -> Gen (Id a))
>=>transformBiM (fixUpFunExpr :: Expression a -> Gen (Expression a))
+ >=>transformBiM (fixUpListExpr :: Expression a -> Gen (Expression a))
>=>transformBiM (fixUpFunStmt :: Statement a -> Gen (Statement a))
>=>transformBiM (return . fixLValue :: LValue a -> Gen (LValue a))
instance (Data a) => Fixable (ForInit a) where
fixUp = transformBiM (return . identifierFixup :: Id a -> Gen (Id a))
>=>transformBiM (fixUpFunExpr :: Expression a -> Gen (Expression a))
+ >=>transformBiM (fixUpListExpr :: Expression a -> Gen (Expression a))
>=>transformBiM (fixUpFunStmt :: Statement a -> Gen (Statement a))
>=>transformBiM (return . fixLValue :: LValue a -> Gen (LValue a))
instance (Data a) => Fixable (ForInInit a) where
fixUp = transformBiM (return . identifierFixup :: Id a -> Gen (Id a))
>=>transformBiM (fixUpFunExpr :: Expression a -> Gen (Expression a))
+ >=>transformBiM (fixUpListExpr :: Expression a -> Gen (Expression a))
>=>transformBiM (fixUpFunStmt :: Statement a -> Gen (Statement a))
>=>transformBiM (return . fixLValue :: LValue a -> Gen (LValue a))
instance (Data a) => Fixable (VarDecl a) where
fixUp = transformBiM (return . identifierFixup :: Id a -> Gen (Id a))
>=>transformBiM (fixUpFunExpr :: Expression a -> Gen (Expression a))
+ >=>transformBiM (fixUpListExpr :: Expression a -> Gen (Expression a))
>=>transformBiM (fixUpFunStmt :: Statement a -> Gen (Statement a))
>=>transformBiM (return . fixLValue :: LValue a -> Gen (LValue a))
@@ -238,12 +247,14 @@ instance Fixable (Id a) where
instance (Data a) => Fixable (Prop a) where
fixUp = transformBiM (return . identifierFixup :: Id a -> Gen (Id a))
>=>transformBiM (fixUpFunExpr :: Expression a -> Gen (Expression a))
+ >=>transformBiM (fixUpListExpr :: Expression a -> Gen (Expression a))
>=>transformBiM (fixUpFunStmt :: Statement a -> Gen (Statement a))
>=>transformBiM (return . fixLValue :: LValue a -> Gen (LValue a))
instance (Data a) => Fixable (LValue a) where
fixUp = transformBiM (return . identifierFixup :: Id a -> Gen (Id a))
>=>transformBiM (fixUpFunExpr :: Expression a -> Gen (Expression a))
+ >=>transformBiM (fixUpListExpr :: Expression a -> Gen (Expression a))
>=>transformBiM (fixUpFunStmt :: Statement a -> Gen (Statement a))
>=>transformBiM (return . fixLValue :: LValue a -> Gen (LValue a))
>=>(return . fixLValue)
@@ -259,6 +270,11 @@ fixUpFunExpr e = case e of
FuncExpr a mid params body -> liftM (FuncExpr a mid params) $ fixBreakContinue body
_ -> return e
+fixUpListExpr :: (Data a) => Expression a -> Gen (Expression a)
+fixUpListExpr e = case e of
+ ListExpr a [] -> return $ NullLit a
+ _ -> return e
+
fixUpFunStmt :: (Data a) => Statement a -> Gen (Statement a)
fixUpFunStmt s = case s of
FunctionStmt a id params body -> liftM (FunctionStmt a id params) $ fixBreakContinue body