module Language.JS.Types where
data ObjectProperty = OPI Expression
| OPKV Expression Expression
| OP Expression
| OPM Expression
deriving (Int -> ObjectProperty -> ShowS
[ObjectProperty] -> ShowS
ObjectProperty -> String
(Int -> ObjectProperty -> ShowS)
-> (ObjectProperty -> String)
-> ([ObjectProperty] -> ShowS)
-> Show ObjectProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ObjectProperty] -> ShowS
$cshowList :: [ObjectProperty] -> ShowS
show :: ObjectProperty -> String
$cshow :: ObjectProperty -> String
showsPrec :: Int -> ObjectProperty -> ShowS
$cshowsPrec :: Int -> ObjectProperty -> ShowS
Show)
type IsPrefix = Bool
data SwitchCase = Case Expression | DefaultCase
deriving (Int -> SwitchCase -> ShowS
[SwitchCase] -> ShowS
SwitchCase -> String
(Int -> SwitchCase -> ShowS)
-> (SwitchCase -> String)
-> ([SwitchCase] -> ShowS)
-> Show SwitchCase
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SwitchCase] -> ShowS
$cshowList :: [SwitchCase] -> ShowS
show :: SwitchCase -> String
$cshow :: SwitchCase -> String
showsPrec :: Int -> SwitchCase -> ShowS
$cshowsPrec :: Int -> SwitchCase -> ShowS
Show)
type ExpressionOpt = Maybe Expression
type StatementOpt = Maybe Statement
data ForStyle = ForIn BindExpression Expression
| ForInV String BindExpression Expression
| ForOf BindExpression Expression
| ForOfV String BindExpression Expression
| ForRegular (Maybe BindExpression) ExpressionOpt ExpressionOpt
deriving (Int -> ForStyle -> ShowS
[ForStyle] -> ShowS
ForStyle -> String
(Int -> ForStyle -> ShowS)
-> (ForStyle -> String) -> ([ForStyle] -> ShowS) -> Show ForStyle
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ForStyle] -> ShowS
$cshowList :: [ForStyle] -> ShowS
show :: ForStyle -> String
$cshow :: ForStyle -> String
showsPrec :: Int -> ForStyle -> ShowS
$cshowsPrec :: Int -> ForStyle -> ShowS
Show)
data ImportClause = Namespace Expression
| DefaultName Expression
| BindNames [Expression]
deriving (Int -> ImportClause -> ShowS
[ImportClause] -> ShowS
ImportClause -> String
(Int -> ImportClause -> ShowS)
-> (ImportClause -> String)
-> ([ImportClause] -> ShowS)
-> Show ImportClause
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportClause] -> ShowS
$cshowList :: [ImportClause] -> ShowS
show :: ImportClause -> String
$cshow :: ImportClause -> String
showsPrec :: Int -> ImportClause -> ShowS
$cshowsPrec :: Int -> ImportClause -> ShowS
Show)
data BindExpression = BindVar Expression (Maybe Expression)
| BindPattern Expression (Maybe Expression)
| BindRest Expression
deriving (Int -> BindExpression -> ShowS
[BindExpression] -> ShowS
BindExpression -> String
(Int -> BindExpression -> ShowS)
-> (BindExpression -> String)
-> ([BindExpression] -> ShowS)
-> Show BindExpression
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BindExpression] -> ShowS
$cshowList :: [BindExpression] -> ShowS
show :: BindExpression -> String
$cshow :: BindExpression -> String
showsPrec :: Int -> BindExpression -> ShowS
$cshowsPrec :: Int -> BindExpression -> ShowS
Show)
data TemplateString = TString String
| TExpression Expression
deriving (Int -> TemplateString -> ShowS
[TemplateString] -> ShowS
TemplateString -> String
(Int -> TemplateString -> ShowS)
-> (TemplateString -> String)
-> ([TemplateString] -> ShowS)
-> Show TemplateString
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TemplateString] -> ShowS
$cshowList :: [TemplateString] -> ShowS
show :: TemplateString -> String
$cshow :: TemplateString -> String
showsPrec :: Int -> TemplateString -> ShowS
$cshowsPrec :: Int -> TemplateString -> ShowS
Show)
data Expression =
LThis
| LNull
| LI String
| LN String
| LS String
| LTS [TemplateString]
| LB Bool
| RegExp String String
| UnaryUpdate String IsPrefix Expression
| Unary String Expression
| Spread Expression
| Elision
| LA [Expression]
| LO [ObjectProperty]
| LP Expression
| Condition Expression Expression Expression
| Assignment String Expression Expression
| Operation String Expression Expression
| Function ExpressionOpt [BindExpression] Statement
| Arrow (Either BindExpression [BindExpression]) Statement
| Class ExpressionOpt ExpressionOpt Statement
| ClassProperty Expression Expression
| PropertyMethod Expression [BindExpression] Statement
| ClassStatic Expression
| ClassGetMethod Expression
| ClassSetMethod Expression
| Async Expression
| Dot Expression Expression
| Acc Expression Expression
| FCall Expression [Expression]
| New Expression
| Comma Expression Expression
| Empty
| String
| String
deriving (Int -> Expression -> ShowS
[Expression] -> ShowS
Expression -> String
(Int -> Expression -> ShowS)
-> (Expression -> String)
-> ([Expression] -> ShowS)
-> Show Expression
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Expression] -> ShowS
$cshowList :: [Expression] -> ShowS
show :: Expression -> String
$cshow :: Expression -> String
showsPrec :: Int -> Expression -> ShowS
$cshowsPrec :: Int -> Expression -> ShowS
Show)
data Statement = SExp Expression
| SImportFile Expression
| SImport (Either ImportClause [ImportClause]) Expression
| SRExport Expression Expression
| SExport Statement
| SExportDefault Expression
| SC String ExpressionOpt Statement
| SF String [BindExpression] Statement
| SVariable String [BindExpression]
| SWhile [Expression] Statement
| SDoWhile Statement [Expression]
| SFor ForStyle Statement
| SLabel Expression Statement
| SDebugger
| SContinue ExpressionOpt
| SBreak ExpressionOpt
| SBlock [Statement]
| SIf Expression Statement StatementOpt
| SSwitch Expression [Statement]
| SCase [SwitchCase] [Statement]
| SThrow Expression
| STry Statement Statement StatementOpt
| SCatch ExpressionOpt Statement
| SFinally Statement
| SReturn Expression
| SWith Expression Statement
deriving (Int -> Statement -> ShowS
[Statement] -> ShowS
Statement -> String
(Int -> Statement -> ShowS)
-> (Statement -> String)
-> ([Statement] -> ShowS)
-> Show Statement
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Statement] -> ShowS
$cshowList :: [Statement] -> ShowS
show :: Statement -> String
$cshow :: Statement -> String
showsPrec :: Int -> Statement -> ShowS
$cshowsPrec :: Int -> Statement -> ShowS
Show)