language-ecmascript-0.19.1.0: JavaScript parser and pretty-printer library

Safe HaskellNone
LanguageHaskell2010

Language.ECMAScript3.Syntax

Contents

Description

ECMAScript 3 syntax. Spec refers to the ECMA-262 specification, 3rd edition.

Synopsis

Documentation

data JavaScript a Source #

Constructors

Script a [Statement a]

A script in <script> ... </script> tags.

Instances
Functor JavaScript Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fmap :: (a -> b) -> JavaScript a -> JavaScript b #

(<$) :: a -> JavaScript b -> JavaScript a #

Foldable JavaScript Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fold :: Monoid m => JavaScript m -> m #

foldMap :: Monoid m => (a -> m) -> JavaScript a -> m #

foldr :: (a -> b -> b) -> b -> JavaScript a -> b #

foldr' :: (a -> b -> b) -> b -> JavaScript a -> b #

foldl :: (b -> a -> b) -> b -> JavaScript a -> b #

foldl' :: (b -> a -> b) -> b -> JavaScript a -> b #

foldr1 :: (a -> a -> a) -> JavaScript a -> a #

foldl1 :: (a -> a -> a) -> JavaScript a -> a #

toList :: JavaScript a -> [a] #

null :: JavaScript a -> Bool #

length :: JavaScript a -> Int #

elem :: Eq a => a -> JavaScript a -> Bool #

maximum :: Ord a => JavaScript a -> a #

minimum :: Ord a => JavaScript a -> a #

sum :: Num a => JavaScript a -> a #

product :: Num a => JavaScript a -> a #

Traversable JavaScript Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> JavaScript a -> f (JavaScript b) #

sequenceA :: Applicative f => JavaScript (f a) -> f (JavaScript a) #

mapM :: Monad m => (a -> m b) -> JavaScript a -> m (JavaScript b) #

sequence :: Monad m => JavaScript (m a) -> m (JavaScript a) #

Eq a => Eq (JavaScript a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

(==) :: JavaScript a -> JavaScript a -> Bool #

(/=) :: JavaScript a -> JavaScript a -> Bool #

Data a => Data (JavaScript a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> JavaScript a -> c (JavaScript a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (JavaScript a) #

toConstr :: JavaScript a -> Constr #

dataTypeOf :: JavaScript a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (JavaScript a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (JavaScript a)) #

gmapT :: (forall b. Data b => b -> b) -> JavaScript a -> JavaScript a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> JavaScript a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> JavaScript a -> r #

gmapQ :: (forall d. Data d => d -> u) -> JavaScript a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> JavaScript a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> JavaScript a -> m (JavaScript a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> JavaScript a -> m (JavaScript a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> JavaScript a -> m (JavaScript a) #

Ord a => Ord (JavaScript a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Show a => Show (JavaScript a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Default a => Default (JavaScript a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

def :: JavaScript a #

Pretty (JavaScript a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

unJavaScript :: JavaScript a -> [Statement a] Source #

extracts statements from a JavaScript type

data Statement a Source #

Statements, spec 12.

Constructors

BlockStmt a [Statement a]

{stmts}, spec 12.1

EmptyStmt a

;, spec 12.3

ExprStmt a (Expression a)

expr;, spec 12.4

IfStmt a (Expression a) (Statement a) (Statement a)

if (e) stmt, spec 12.5

IfSingleStmt a (Expression a) (Statement a)

if (e) stmt1 else stmt2, spec 12.5

SwitchStmt a (Expression a) [CaseClause a]

switch (e) clauses, spec 12.11

WhileStmt a (Expression a) (Statement a)

while (e) do stmt, spec 12.6

DoWhileStmt a (Statement a) (Expression a)

do stmt while (e);, spec 12.6

BreakStmt a (Maybe (Id a))

break lab;, spec 12.8

ContinueStmt a (Maybe (Id a))

continue lab;, spec 12.7

LabelledStmt a (Id a) (Statement a)

lab: stmt, spec 12.12

ForInStmt a (ForInInit a) (Expression a) (Statement a)

for (x in o) stmt, spec 12.6

ForStmt a (ForInit a) (Maybe (Expression a)) (Maybe (Expression a)) (Statement a)

ForStmt a init test increment body, for (init; test, increment) body, spec 12.6

TryStmt a (Statement a) (Maybe (CatchClause a)) (Maybe (Statement a))

try stmt catch(x) stmt finally stmt, spec 12.14

ThrowStmt a (Expression a)

throw expr;, spec 12.13

ReturnStmt a (Maybe (Expression a))

return expr;, spec 12.9

WithStmt a (Expression a) (Statement a)

with (o) stmt, spec 12.10

VarDeclStmt a [VarDecl a]

var x, y=42;, spec 12.2

FunctionStmt a (Id a) [Id a] [Statement a]

function f(x, y, z) {...}, spec 13

Instances
Functor Statement Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fmap :: (a -> b) -> Statement a -> Statement b #

(<$) :: a -> Statement b -> Statement a #

Foldable Statement Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fold :: Monoid m => Statement m -> m #

foldMap :: Monoid m => (a -> m) -> Statement a -> m #

foldr :: (a -> b -> b) -> b -> Statement a -> b #

foldr' :: (a -> b -> b) -> b -> Statement a -> b #

foldl :: (b -> a -> b) -> b -> Statement a -> b #

foldl' :: (b -> a -> b) -> b -> Statement a -> b #

foldr1 :: (a -> a -> a) -> Statement a -> a #

foldl1 :: (a -> a -> a) -> Statement a -> a #

toList :: Statement a -> [a] #

null :: Statement a -> Bool #

length :: Statement a -> Int #

elem :: Eq a => a -> Statement a -> Bool #

maximum :: Ord a => Statement a -> a #

minimum :: Ord a => Statement a -> a #

sum :: Num a => Statement a -> a #

product :: Num a => Statement a -> a #

Traversable Statement Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> Statement a -> f (Statement b) #

sequenceA :: Applicative f => Statement (f a) -> f (Statement a) #

mapM :: Monad m => (a -> m b) -> Statement a -> m (Statement b) #

sequence :: Monad m => Statement (m a) -> m (Statement a) #

HasAnnotation Statement Source # 
Instance details

Defined in Language.ECMAScript3.Syntax.Annotations

Eq a => Eq (Statement a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

(==) :: Statement a -> Statement a -> Bool #

(/=) :: Statement a -> Statement a -> Bool #

Data a => Data (Statement a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Statement a -> c (Statement a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Statement a) #

toConstr :: Statement a -> Constr #

dataTypeOf :: Statement a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Statement a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Statement a)) #

gmapT :: (forall b. Data b => b -> b) -> Statement a -> Statement a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Statement a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Statement a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Statement a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Statement a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Statement a -> m (Statement a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Statement a -> m (Statement a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Statement a -> m (Statement a) #

Ord a => Ord (Statement a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Show a => Show (Statement a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Pretty [Statement a] Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Methods

prettyPrint :: [Statement a] -> Doc Source #

Pretty (Statement a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

isIterationStmt :: Statement a -> Bool Source #

Returns True if the statement is an IterationStatement according to spec 12.6.

data CaseClause a Source #

Case clauses, spec 12.11

Constructors

CaseClause a (Expression a) [Statement a]
case e: stmts;
CaseDefault a [Statement a]
default: stmts;
Instances
Functor CaseClause Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fmap :: (a -> b) -> CaseClause a -> CaseClause b #

(<$) :: a -> CaseClause b -> CaseClause a #

Foldable CaseClause Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fold :: Monoid m => CaseClause m -> m #

foldMap :: Monoid m => (a -> m) -> CaseClause a -> m #

foldr :: (a -> b -> b) -> b -> CaseClause a -> b #

foldr' :: (a -> b -> b) -> b -> CaseClause a -> b #

foldl :: (b -> a -> b) -> b -> CaseClause a -> b #

foldl' :: (b -> a -> b) -> b -> CaseClause a -> b #

foldr1 :: (a -> a -> a) -> CaseClause a -> a #

foldl1 :: (a -> a -> a) -> CaseClause a -> a #

toList :: CaseClause a -> [a] #

null :: CaseClause a -> Bool #

length :: CaseClause a -> Int #

elem :: Eq a => a -> CaseClause a -> Bool #

maximum :: Ord a => CaseClause a -> a #

minimum :: Ord a => CaseClause a -> a #

sum :: Num a => CaseClause a -> a #

product :: Num a => CaseClause a -> a #

Traversable CaseClause Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> CaseClause a -> f (CaseClause b) #

sequenceA :: Applicative f => CaseClause (f a) -> f (CaseClause a) #

mapM :: Monad m => (a -> m b) -> CaseClause a -> m (CaseClause b) #

sequence :: Monad m => CaseClause (m a) -> m (CaseClause a) #

HasAnnotation CaseClause Source # 
Instance details

Defined in Language.ECMAScript3.Syntax.Annotations

Eq a => Eq (CaseClause a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

(==) :: CaseClause a -> CaseClause a -> Bool #

(/=) :: CaseClause a -> CaseClause a -> Bool #

Data a => Data (CaseClause a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CaseClause a -> c (CaseClause a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (CaseClause a) #

toConstr :: CaseClause a -> Constr #

dataTypeOf :: CaseClause a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (CaseClause a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (CaseClause a)) #

gmapT :: (forall b. Data b => b -> b) -> CaseClause a -> CaseClause a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CaseClause a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CaseClause a -> r #

gmapQ :: (forall d. Data d => d -> u) -> CaseClause a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CaseClause a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CaseClause a -> m (CaseClause a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CaseClause a -> m (CaseClause a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CaseClause a -> m (CaseClause a) #

Ord a => Ord (CaseClause a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Show a => Show (CaseClause a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Pretty (CaseClause a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

data CatchClause a Source #

Catch clause, spec 12.14

Constructors

CatchClause a (Id a) (Statement a)
catch (x) {...}
Instances
Functor CatchClause Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fmap :: (a -> b) -> CatchClause a -> CatchClause b #

(<$) :: a -> CatchClause b -> CatchClause a #

Foldable CatchClause Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fold :: Monoid m => CatchClause m -> m #

foldMap :: Monoid m => (a -> m) -> CatchClause a -> m #

foldr :: (a -> b -> b) -> b -> CatchClause a -> b #

foldr' :: (a -> b -> b) -> b -> CatchClause a -> b #

foldl :: (b -> a -> b) -> b -> CatchClause a -> b #

foldl' :: (b -> a -> b) -> b -> CatchClause a -> b #

foldr1 :: (a -> a -> a) -> CatchClause a -> a #

foldl1 :: (a -> a -> a) -> CatchClause a -> a #

toList :: CatchClause a -> [a] #

null :: CatchClause a -> Bool #

length :: CatchClause a -> Int #

elem :: Eq a => a -> CatchClause a -> Bool #

maximum :: Ord a => CatchClause a -> a #

minimum :: Ord a => CatchClause a -> a #

sum :: Num a => CatchClause a -> a #

product :: Num a => CatchClause a -> a #

Traversable CatchClause Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> CatchClause a -> f (CatchClause b) #

sequenceA :: Applicative f => CatchClause (f a) -> f (CatchClause a) #

mapM :: Monad m => (a -> m b) -> CatchClause a -> m (CatchClause b) #

sequence :: Monad m => CatchClause (m a) -> m (CatchClause a) #

HasAnnotation CatchClause Source # 
Instance details

Defined in Language.ECMAScript3.Syntax.Annotations

Eq a => Eq (CatchClause a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Data a => Data (CatchClause a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CatchClause a -> c (CatchClause a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (CatchClause a) #

toConstr :: CatchClause a -> Constr #

dataTypeOf :: CatchClause a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (CatchClause a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (CatchClause a)) #

gmapT :: (forall b. Data b => b -> b) -> CatchClause a -> CatchClause a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CatchClause a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CatchClause a -> r #

gmapQ :: (forall d. Data d => d -> u) -> CatchClause a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CatchClause a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CatchClause a -> m (CatchClause a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CatchClause a -> m (CatchClause a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CatchClause a -> m (CatchClause a) #

Ord a => Ord (CatchClause a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Show a => Show (CatchClause a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Pretty (CatchClause a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

data ForInit a Source #

for initializer, spec 12.6

Constructors

NoInit

empty

VarInit [VarDecl a]
var x, y=42
ExprInit (Expression a)
expr
Instances
Functor ForInit Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fmap :: (a -> b) -> ForInit a -> ForInit b #

(<$) :: a -> ForInit b -> ForInit a #

Foldable ForInit Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fold :: Monoid m => ForInit m -> m #

foldMap :: Monoid m => (a -> m) -> ForInit a -> m #

foldr :: (a -> b -> b) -> b -> ForInit a -> b #

foldr' :: (a -> b -> b) -> b -> ForInit a -> b #

foldl :: (b -> a -> b) -> b -> ForInit a -> b #

foldl' :: (b -> a -> b) -> b -> ForInit a -> b #

foldr1 :: (a -> a -> a) -> ForInit a -> a #

foldl1 :: (a -> a -> a) -> ForInit a -> a #

toList :: ForInit a -> [a] #

null :: ForInit a -> Bool #

length :: ForInit a -> Int #

elem :: Eq a => a -> ForInit a -> Bool #

maximum :: Ord a => ForInit a -> a #

minimum :: Ord a => ForInit a -> a #

sum :: Num a => ForInit a -> a #

product :: Num a => ForInit a -> a #

Traversable ForInit Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> ForInit a -> f (ForInit b) #

sequenceA :: Applicative f => ForInit (f a) -> f (ForInit a) #

mapM :: Monad m => (a -> m b) -> ForInit a -> m (ForInit b) #

sequence :: Monad m => ForInit (m a) -> m (ForInit a) #

Eq a => Eq (ForInit a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

(==) :: ForInit a -> ForInit a -> Bool #

(/=) :: ForInit a -> ForInit a -> Bool #

Data a => Data (ForInit a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ForInit a -> c (ForInit a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ForInit a) #

toConstr :: ForInit a -> Constr #

dataTypeOf :: ForInit a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ForInit a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ForInit a)) #

gmapT :: (forall b. Data b => b -> b) -> ForInit a -> ForInit a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ForInit a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ForInit a -> r #

gmapQ :: (forall d. Data d => d -> u) -> ForInit a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ForInit a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ForInit a -> m (ForInit a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ForInit a -> m (ForInit a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ForInit a -> m (ForInit a) #

Ord a => Ord (ForInit a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

compare :: ForInit a -> ForInit a -> Ordering #

(<) :: ForInit a -> ForInit a -> Bool #

(<=) :: ForInit a -> ForInit a -> Bool #

(>) :: ForInit a -> ForInit a -> Bool #

(>=) :: ForInit a -> ForInit a -> Bool #

max :: ForInit a -> ForInit a -> ForInit a #

min :: ForInit a -> ForInit a -> ForInit a #

Show a => Show (ForInit a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

showsPrec :: Int -> ForInit a -> ShowS #

show :: ForInit a -> String #

showList :: [ForInit a] -> ShowS #

Pretty (ForInit a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Methods

prettyPrint :: ForInit a -> Doc Source #

data ForInInit a Source #

for..in initializer, spec 12.6

Constructors

ForInVar (Id a)
var x
ForInLVal (LValue a)

foo.baz, foo[bar], z

Instances
Functor ForInInit Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fmap :: (a -> b) -> ForInInit a -> ForInInit b #

(<$) :: a -> ForInInit b -> ForInInit a #

Foldable ForInInit Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fold :: Monoid m => ForInInit m -> m #

foldMap :: Monoid m => (a -> m) -> ForInInit a -> m #

foldr :: (a -> b -> b) -> b -> ForInInit a -> b #

foldr' :: (a -> b -> b) -> b -> ForInInit a -> b #

foldl :: (b -> a -> b) -> b -> ForInInit a -> b #

foldl' :: (b -> a -> b) -> b -> ForInInit a -> b #

foldr1 :: (a -> a -> a) -> ForInInit a -> a #

foldl1 :: (a -> a -> a) -> ForInInit a -> a #

toList :: ForInInit a -> [a] #

null :: ForInInit a -> Bool #

length :: ForInInit a -> Int #

elem :: Eq a => a -> ForInInit a -> Bool #

maximum :: Ord a => ForInInit a -> a #

minimum :: Ord a => ForInInit a -> a #

sum :: Num a => ForInInit a -> a #

product :: Num a => ForInInit a -> a #

Traversable ForInInit Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> ForInInit a -> f (ForInInit b) #

sequenceA :: Applicative f => ForInInit (f a) -> f (ForInInit a) #

mapM :: Monad m => (a -> m b) -> ForInInit a -> m (ForInInit b) #

sequence :: Monad m => ForInInit (m a) -> m (ForInInit a) #

Eq a => Eq (ForInInit a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

(==) :: ForInInit a -> ForInInit a -> Bool #

(/=) :: ForInInit a -> ForInInit a -> Bool #

Data a => Data (ForInInit a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ForInInit a -> c (ForInInit a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ForInInit a) #

toConstr :: ForInInit a -> Constr #

dataTypeOf :: ForInInit a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ForInInit a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ForInInit a)) #

gmapT :: (forall b. Data b => b -> b) -> ForInInit a -> ForInInit a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ForInInit a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ForInInit a -> r #

gmapQ :: (forall d. Data d => d -> u) -> ForInInit a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ForInInit a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ForInInit a -> m (ForInInit a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ForInInit a -> m (ForInInit a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ForInInit a -> m (ForInInit a) #

Ord a => Ord (ForInInit a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Show a => Show (ForInInit a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Pretty (ForInInit a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

data VarDecl a Source #

A variable declaration, spec 12.2

Constructors

VarDecl a (Id a) (Maybe (Expression a))
var x = e;
Instances
Functor VarDecl Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fmap :: (a -> b) -> VarDecl a -> VarDecl b #

(<$) :: a -> VarDecl b -> VarDecl a #

Foldable VarDecl Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fold :: Monoid m => VarDecl m -> m #

foldMap :: Monoid m => (a -> m) -> VarDecl a -> m #

foldr :: (a -> b -> b) -> b -> VarDecl a -> b #

foldr' :: (a -> b -> b) -> b -> VarDecl a -> b #

foldl :: (b -> a -> b) -> b -> VarDecl a -> b #

foldl' :: (b -> a -> b) -> b -> VarDecl a -> b #

foldr1 :: (a -> a -> a) -> VarDecl a -> a #

foldl1 :: (a -> a -> a) -> VarDecl a -> a #

toList :: VarDecl a -> [a] #

null :: VarDecl a -> Bool #

length :: VarDecl a -> Int #

elem :: Eq a => a -> VarDecl a -> Bool #

maximum :: Ord a => VarDecl a -> a #

minimum :: Ord a => VarDecl a -> a #

sum :: Num a => VarDecl a -> a #

product :: Num a => VarDecl a -> a #

Traversable VarDecl Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> VarDecl a -> f (VarDecl b) #

sequenceA :: Applicative f => VarDecl (f a) -> f (VarDecl a) #

mapM :: Monad m => (a -> m b) -> VarDecl a -> m (VarDecl b) #

sequence :: Monad m => VarDecl (m a) -> m (VarDecl a) #

HasAnnotation VarDecl Source # 
Instance details

Defined in Language.ECMAScript3.Syntax.Annotations

Eq a => Eq (VarDecl a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

(==) :: VarDecl a -> VarDecl a -> Bool #

(/=) :: VarDecl a -> VarDecl a -> Bool #

Data a => Data (VarDecl a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> VarDecl a -> c (VarDecl a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (VarDecl a) #

toConstr :: VarDecl a -> Constr #

dataTypeOf :: VarDecl a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (VarDecl a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (VarDecl a)) #

gmapT :: (forall b. Data b => b -> b) -> VarDecl a -> VarDecl a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> VarDecl a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> VarDecl a -> r #

gmapQ :: (forall d. Data d => d -> u) -> VarDecl a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> VarDecl a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> VarDecl a -> m (VarDecl a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> VarDecl a -> m (VarDecl a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> VarDecl a -> m (VarDecl a) #

Ord a => Ord (VarDecl a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

compare :: VarDecl a -> VarDecl a -> Ordering #

(<) :: VarDecl a -> VarDecl a -> Bool #

(<=) :: VarDecl a -> VarDecl a -> Bool #

(>) :: VarDecl a -> VarDecl a -> Bool #

(>=) :: VarDecl a -> VarDecl a -> Bool #

max :: VarDecl a -> VarDecl a -> VarDecl a #

min :: VarDecl a -> VarDecl a -> VarDecl a #

Show a => Show (VarDecl a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

showsPrec :: Int -> VarDecl a -> ShowS #

show :: VarDecl a -> String #

showList :: [VarDecl a] -> ShowS #

Pretty (VarDecl a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Methods

prettyPrint :: VarDecl a -> Doc Source #

data Expression a Source #

Expressions, see spec 11

Constructors

StringLit a String

"foo", spec 11.1.3, 7.8

RegexpLit a String Bool Bool

RegexpLit a regexp global? case_insensitive? -- regular expression, see spec 11.1.3, 7.8

NumLit a Double

41.99999, spec 11.1.3, 7.8

IntLit a Int

42, spec 11.1.3, 7.8

BoolLit a Bool

true, spec 11.1.3, 7.8

NullLit a

null, spec 11.1.3, 7.8

ArrayLit a [Expression a]

[1,2,3], spec 11.1.4

ObjectLit a [(Prop a, Expression a)]

{foo:"bar", baz: 42}, spec 11.1.5

ThisRef a

this, spec 11.1.1

VarRef a (Id a)

foo, spec 11.1.2

DotRef a (Expression a) (Id a)

foo.bar, spec 11.2.1

BracketRef a (Expression a) (Expression a)

foo[bar, spec 11.2.1

NewExpr a (Expression a) [Expression a]

new foo(bar), spec 11.2.2

PrefixExpr a PrefixOp (Expression a)

@e, spec 11.4 (excluding 11.4.4, 111.4.5)

UnaryAssignExpr a UnaryAssignOp (LValue a)

++x, x-- etc., spec 11.3, 11.4.4, 11.4.5

InfixExpr a InfixOp (Expression a) (Expression a)

e1@e2, spec 11.5, 11.6, 11.7, 11.8, 11.9, 11.10, 11.11

CondExpr a (Expression a) (Expression a) (Expression a)

e1 ? e2 : e3, spec 11.12

AssignExpr a AssignOp (LValue a) (Expression a)

e1 @=e2, spec 11.13

ListExpr a [Expression a]

e1, e2, spec 11.14

CallExpr a (Expression a) [Expression a]

f(x,y,z), spec 11.2.3 funcexprs are optionally named

FuncExpr a (Maybe (Id a)) [Id a] [Statement a]

function f (x,y,z) {...}, spec 11.2.5, 13

Instances
Functor Expression Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fmap :: (a -> b) -> Expression a -> Expression b #

(<$) :: a -> Expression b -> Expression a #

Foldable Expression Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fold :: Monoid m => Expression m -> m #

foldMap :: Monoid m => (a -> m) -> Expression a -> m #

foldr :: (a -> b -> b) -> b -> Expression a -> b #

foldr' :: (a -> b -> b) -> b -> Expression a -> b #

foldl :: (b -> a -> b) -> b -> Expression a -> b #

foldl' :: (b -> a -> b) -> b -> Expression a -> b #

foldr1 :: (a -> a -> a) -> Expression a -> a #

foldl1 :: (a -> a -> a) -> Expression a -> a #

toList :: Expression a -> [a] #

null :: Expression a -> Bool #

length :: Expression a -> Int #

elem :: Eq a => a -> Expression a -> Bool #

maximum :: Ord a => Expression a -> a #

minimum :: Ord a => Expression a -> a #

sum :: Num a => Expression a -> a #

product :: Num a => Expression a -> a #

Traversable Expression Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> Expression a -> f (Expression b) #

sequenceA :: Applicative f => Expression (f a) -> f (Expression a) #

mapM :: Monad m => (a -> m b) -> Expression a -> m (Expression b) #

sequence :: Monad m => Expression (m a) -> m (Expression a) #

HasAnnotation Expression Source # 
Instance details

Defined in Language.ECMAScript3.Syntax.Annotations

Eq a => Eq (Expression a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

(==) :: Expression a -> Expression a -> Bool #

(/=) :: Expression a -> Expression a -> Bool #

Data a => Data (Expression a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Expression a -> c (Expression a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Expression a) #

toConstr :: Expression a -> Constr #

dataTypeOf :: Expression a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Expression a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Expression a)) #

gmapT :: (forall b. Data b => b -> b) -> Expression a -> Expression a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Expression a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Expression a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Expression a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Expression a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Expression a -> m (Expression a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Expression a -> m (Expression a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Expression a -> m (Expression a) #

Ord a => Ord (Expression a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Show a => Show (Expression a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Default a => IsString (Expression a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax.CodeGen

Methods

fromString :: String -> Expression a #

Pretty (Expression a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

data InfixOp Source #

Infix operators: see spec 11.5-11.11

Instances
Enum InfixOp Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Eq InfixOp Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

(==) :: InfixOp -> InfixOp -> Bool #

(/=) :: InfixOp -> InfixOp -> Bool #

Data InfixOp Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> InfixOp -> c InfixOp #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c InfixOp #

toConstr :: InfixOp -> Constr #

dataTypeOf :: InfixOp -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c InfixOp) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c InfixOp) #

gmapT :: (forall b. Data b => b -> b) -> InfixOp -> InfixOp #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> InfixOp -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> InfixOp -> r #

gmapQ :: (forall d. Data d => d -> u) -> InfixOp -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> InfixOp -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> InfixOp -> m InfixOp #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> InfixOp -> m InfixOp #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> InfixOp -> m InfixOp #

Ord InfixOp Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Show InfixOp Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Pretty InfixOp Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

data AssignOp Source #

Assignment operators: see spec 11.13

Instances
Eq AssignOp Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Data AssignOp Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AssignOp -> c AssignOp #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c AssignOp #

toConstr :: AssignOp -> Constr #

dataTypeOf :: AssignOp -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c AssignOp) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AssignOp) #

gmapT :: (forall b. Data b => b -> b) -> AssignOp -> AssignOp #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AssignOp -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AssignOp -> r #

gmapQ :: (forall d. Data d => d -> u) -> AssignOp -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> AssignOp -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> AssignOp -> m AssignOp #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AssignOp -> m AssignOp #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AssignOp -> m AssignOp #

Ord AssignOp Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Show AssignOp Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Pretty AssignOp Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

data Id a Source #

Constructors

Id a String 
Instances
Functor Id Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fmap :: (a -> b) -> Id a -> Id b #

(<$) :: a -> Id b -> Id a #

Foldable Id Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fold :: Monoid m => Id m -> m #

foldMap :: Monoid m => (a -> m) -> Id a -> m #

foldr :: (a -> b -> b) -> b -> Id a -> b #

foldr' :: (a -> b -> b) -> b -> Id a -> b #

foldl :: (b -> a -> b) -> b -> Id a -> b #

foldl' :: (b -> a -> b) -> b -> Id a -> b #

foldr1 :: (a -> a -> a) -> Id a -> a #

foldl1 :: (a -> a -> a) -> Id a -> a #

toList :: Id a -> [a] #

null :: Id a -> Bool #

length :: Id a -> Int #

elem :: Eq a => a -> Id a -> Bool #

maximum :: Ord a => Id a -> a #

minimum :: Ord a => Id a -> a #

sum :: Num a => Id a -> a #

product :: Num a => Id a -> a #

Traversable Id Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> Id a -> f (Id b) #

sequenceA :: Applicative f => Id (f a) -> f (Id a) #

mapM :: Monad m => (a -> m b) -> Id a -> m (Id b) #

sequence :: Monad m => Id (m a) -> m (Id a) #

HasAnnotation Id Source # 
Instance details

Defined in Language.ECMAScript3.Syntax.Annotations

Methods

getAnnotation :: Id b -> b Source #

setAnnotation :: b -> Id b -> Id b Source #

Eq a => Eq (Id a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

(==) :: Id a -> Id a -> Bool #

(/=) :: Id a -> Id a -> Bool #

Data a => Data (Id a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Id a -> c (Id a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Id a) #

toConstr :: Id a -> Constr #

dataTypeOf :: Id a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Id a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Id a)) #

gmapT :: (forall b. Data b => b -> b) -> Id a -> Id a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Id a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Id a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Id a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Id a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Id a -> m (Id a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Id a -> m (Id a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Id a -> m (Id a) #

Ord a => Ord (Id a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

compare :: Id a -> Id a -> Ordering #

(<) :: Id a -> Id a -> Bool #

(<=) :: Id a -> Id a -> Bool #

(>) :: Id a -> Id a -> Bool #

(>=) :: Id a -> Id a -> Bool #

max :: Id a -> Id a -> Id a #

min :: Id a -> Id a -> Id a #

Show a => Show (Id a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

showsPrec :: Int -> Id a -> ShowS #

show :: Id a -> String #

showList :: [Id a] -> ShowS #

Default a => IsString (Id a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax.CodeGen

Methods

fromString :: String -> Id a #

Pretty (Id a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Methods

prettyPrint :: Id a -> Doc Source #

data PrefixOp Source #

Prefix operators: see spec 11.4 (excluding 11.4.4, 11.4.5)

Instances
Eq PrefixOp Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Data PrefixOp Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PrefixOp -> c PrefixOp #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PrefixOp #

toConstr :: PrefixOp -> Constr #

dataTypeOf :: PrefixOp -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PrefixOp) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PrefixOp) #

gmapT :: (forall b. Data b => b -> b) -> PrefixOp -> PrefixOp #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PrefixOp -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PrefixOp -> r #

gmapQ :: (forall d. Data d => d -> u) -> PrefixOp -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PrefixOp -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PrefixOp -> m PrefixOp #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PrefixOp -> m PrefixOp #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PrefixOp -> m PrefixOp #

Ord PrefixOp Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Show PrefixOp Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Pretty PrefixOp Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

data Prop a Source #

Property names in an object initializer: see spec 11.1.5

Constructors

PropId a (Id a)

property name is an identifier, foo

PropString a String

property name is a string, "foo"

PropNum a Integer

property name is an integer, 42

Instances
Functor Prop Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fmap :: (a -> b) -> Prop a -> Prop b #

(<$) :: a -> Prop b -> Prop a #

Foldable Prop Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fold :: Monoid m => Prop m -> m #

foldMap :: Monoid m => (a -> m) -> Prop a -> m #

foldr :: (a -> b -> b) -> b -> Prop a -> b #

foldr' :: (a -> b -> b) -> b -> Prop a -> b #

foldl :: (b -> a -> b) -> b -> Prop a -> b #

foldl' :: (b -> a -> b) -> b -> Prop a -> b #

foldr1 :: (a -> a -> a) -> Prop a -> a #

foldl1 :: (a -> a -> a) -> Prop a -> a #

toList :: Prop a -> [a] #

null :: Prop a -> Bool #

length :: Prop a -> Int #

elem :: Eq a => a -> Prop a -> Bool #

maximum :: Ord a => Prop a -> a #

minimum :: Ord a => Prop a -> a #

sum :: Num a => Prop a -> a #

product :: Num a => Prop a -> a #

Traversable Prop Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> Prop a -> f (Prop b) #

sequenceA :: Applicative f => Prop (f a) -> f (Prop a) #

mapM :: Monad m => (a -> m b) -> Prop a -> m (Prop b) #

sequence :: Monad m => Prop (m a) -> m (Prop a) #

HasAnnotation Prop Source # 
Instance details

Defined in Language.ECMAScript3.Syntax.Annotations

Methods

getAnnotation :: Prop b -> b Source #

setAnnotation :: b -> Prop b -> Prop b Source #

Eq a => Eq (Prop a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

(==) :: Prop a -> Prop a -> Bool #

(/=) :: Prop a -> Prop a -> Bool #

Data a => Data (Prop a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Prop a -> c (Prop a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Prop a) #

toConstr :: Prop a -> Constr #

dataTypeOf :: Prop a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Prop a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Prop a)) #

gmapT :: (forall b. Data b => b -> b) -> Prop a -> Prop a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Prop a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Prop a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Prop a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Prop a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Prop a -> m (Prop a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Prop a -> m (Prop a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Prop a -> m (Prop a) #

Ord a => Ord (Prop a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

compare :: Prop a -> Prop a -> Ordering #

(<) :: Prop a -> Prop a -> Bool #

(<=) :: Prop a -> Prop a -> Bool #

(>) :: Prop a -> Prop a -> Bool #

(>=) :: Prop a -> Prop a -> Bool #

max :: Prop a -> Prop a -> Prop a #

min :: Prop a -> Prop a -> Prop a #

Show a => Show (Prop a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

showsPrec :: Int -> Prop a -> ShowS #

show :: Prop a -> String #

showList :: [Prop a] -> ShowS #

Default a => IsString (Prop a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax.CodeGen

Methods

fromString :: String -> Prop a #

Pretty (Prop a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Methods

prettyPrint :: Prop a -> Doc Source #

data UnaryAssignOp Source #

Unary assignment operators: see spec 11.3, 11.4.4, 11.4.5

Instances
Eq UnaryAssignOp Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Data UnaryAssignOp Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UnaryAssignOp -> c UnaryAssignOp #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UnaryAssignOp #

toConstr :: UnaryAssignOp -> Constr #

dataTypeOf :: UnaryAssignOp -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UnaryAssignOp) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UnaryAssignOp) #

gmapT :: (forall b. Data b => b -> b) -> UnaryAssignOp -> UnaryAssignOp #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UnaryAssignOp -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UnaryAssignOp -> r #

gmapQ :: (forall d. Data d => d -> u) -> UnaryAssignOp -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UnaryAssignOp -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UnaryAssignOp -> m UnaryAssignOp #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UnaryAssignOp -> m UnaryAssignOp #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UnaryAssignOp -> m UnaryAssignOp #

Ord UnaryAssignOp Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Show UnaryAssignOp Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

data LValue a Source #

Left-hand side expressions: see spec 11.2

Constructors

LVar a String

variable reference, foo

LDot a (Expression a) String
foo.bar
LBracket a (Expression a) (Expression a)
foo[bar]
Instances
Functor LValue Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fmap :: (a -> b) -> LValue a -> LValue b #

(<$) :: a -> LValue b -> LValue a #

Foldable LValue Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

fold :: Monoid m => LValue m -> m #

foldMap :: Monoid m => (a -> m) -> LValue a -> m #

foldr :: (a -> b -> b) -> b -> LValue a -> b #

foldr' :: (a -> b -> b) -> b -> LValue a -> b #

foldl :: (b -> a -> b) -> b -> LValue a -> b #

foldl' :: (b -> a -> b) -> b -> LValue a -> b #

foldr1 :: (a -> a -> a) -> LValue a -> a #

foldl1 :: (a -> a -> a) -> LValue a -> a #

toList :: LValue a -> [a] #

null :: LValue a -> Bool #

length :: LValue a -> Int #

elem :: Eq a => a -> LValue a -> Bool #

maximum :: Ord a => LValue a -> a #

minimum :: Ord a => LValue a -> a #

sum :: Num a => LValue a -> a #

product :: Num a => LValue a -> a #

Traversable LValue Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> LValue a -> f (LValue b) #

sequenceA :: Applicative f => LValue (f a) -> f (LValue a) #

mapM :: Monad m => (a -> m b) -> LValue a -> m (LValue b) #

sequence :: Monad m => LValue (m a) -> m (LValue a) #

HasAnnotation LValue Source # 
Instance details

Defined in Language.ECMAScript3.Syntax.Annotations

Methods

getAnnotation :: LValue b -> b Source #

setAnnotation :: b -> LValue b -> LValue b Source #

Eq a => Eq (LValue a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

(==) :: LValue a -> LValue a -> Bool #

(/=) :: LValue a -> LValue a -> Bool #

Data a => Data (LValue a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LValue a -> c (LValue a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (LValue a) #

toConstr :: LValue a -> Constr #

dataTypeOf :: LValue a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (LValue a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (LValue a)) #

gmapT :: (forall b. Data b => b -> b) -> LValue a -> LValue a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LValue a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LValue a -> r #

gmapQ :: (forall d. Data d => d -> u) -> LValue a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> LValue a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> LValue a -> m (LValue a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LValue a -> m (LValue a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LValue a -> m (LValue a) #

Ord a => Ord (LValue a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

compare :: LValue a -> LValue a -> Ordering #

(<) :: LValue a -> LValue a -> Bool #

(<=) :: LValue a -> LValue a -> Bool #

(>) :: LValue a -> LValue a -> Bool #

(>=) :: LValue a -> LValue a -> Bool #

max :: LValue a -> LValue a -> LValue a #

min :: LValue a -> LValue a -> LValue a #

Show a => Show (LValue a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

showsPrec :: Int -> LValue a -> ShowS #

show :: LValue a -> String #

showList :: [LValue a] -> ShowS #

Default a => IsString (LValue a) Source # 
Instance details

Defined in Language.ECMAScript3.Syntax.CodeGen

Methods

fromString :: String -> LValue a #

Pretty (LValue a) Source # 
Instance details

Defined in Language.ECMAScript3.PrettyPrint

Methods

prettyPrint :: LValue a -> Doc Source #

data SourcePos #

The abstract data type SourcePos represents source positions. It contains the name of the source (i.e. file name), a line number and a column number. SourcePos is an instance of the Show, Eq and Ord class.

Instances
Eq SourcePos 
Instance details

Defined in Text.Parsec.Pos

Data SourcePos 
Instance details

Defined in Text.Parsec.Pos

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourcePos -> c SourcePos #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourcePos #

toConstr :: SourcePos -> Constr #

dataTypeOf :: SourcePos -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SourcePos) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SourcePos) #

gmapT :: (forall b. Data b => b -> b) -> SourcePos -> SourcePos #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourcePos -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourcePos -> r #

gmapQ :: (forall d. Data d => d -> u) -> SourcePos -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SourcePos -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos #

Ord SourcePos 
Instance details

Defined in Text.Parsec.Pos

Show SourcePos 
Instance details

Defined in Text.Parsec.Pos

Default SourcePos Source # 
Instance details

Defined in Language.ECMAScript3.Syntax

Methods

def :: SourcePos #

isValid :: forall a. (Data a, Typeable a) => JavaScript a -> Bool Source #

The ECMAScript standard defines certain syntactic restrictions on programs (or, more precisely, statements) that aren't easily enforced in the AST datatype. These restrictions have to do with labeled statements and break/continue statement, as well as identifier names. Thus, it is possible to manually generate AST's that correspond to syntactically incorrect programs. Use this predicate to check if an JavaScript AST corresponds to a syntactically correct ECMAScript program.

isValidIdentifier :: Id a -> Bool Source #

Checks if an identifier name is valid according to the spec

isValidIdentifierName :: String -> Bool Source #

Checks if the String represents a valid identifier name

isReservedWord :: String -> Bool Source #

Checks if a string is in the list of reserved ECMAScript words

isValidIdStart :: Char -> Bool Source #

Checks if a character is valid at the start of an identifier

isValidIdPart :: Char -> Bool Source #

Checks if a character is valid in an identifier part

data EnclosingStatement Source #

Constructors

EnclosingIter [Label]

The enclosing statement is an iteration statement

EnclosingSwitch [Label]

The enclosing statement is a switch statement

EnclosingOther [Label]

The enclosing statement is some other statement. Note, EnclosingOther is never pushed if the current labelSet is empty, so the list of labels in this constructor should always be non-empty

pushLabel :: Monad m => Id b -> StateT ([Label], [EnclosingStatement]) m a -> StateT ([Label], [EnclosingStatement]) m a Source #

pushEnclosing :: Monad m => ([Label] -> EnclosingStatement) -> StateT ([Label], [EnclosingStatement]) m a -> StateT ([Label], [EnclosingStatement]) m a Source #

class HasLabelSet a where Source #

Methods

getLabelSet :: a -> [Label] Source #

setLabelSet :: [Label] -> a -> a Source #

Orphan instances

Default SourcePos Source # 
Instance details

Methods

def :: SourcePos #