purescript-0.3.6: PureScript Programming Language Compiler

Safe HaskellNone

Language.PureScript.CodeGen.JS.AST

Description

Data types for the intermediate simplified-Javascript AST

Synopsis

Documentation

data JS Source

Data type for simplified Javascript expressions

Constructors

JSNumericLiteral (Either Integer Double)

A numeric literal

JSStringLiteral String

A string literal

JSBooleanLiteral Bool

A boolean literal

JSUnary UnaryOperator JS

A unary operator application

JSBinary BinaryOperator JS JS

A binary operator application

JSArrayLiteral [JS]

An array literal

JSIndexer JS JS

An array indexer expression

JSObjectLiteral [(String, JS)]

An object literal

JSAccessor String JS

An object property accessor expression

JSFunction (Maybe Ident) [Ident] JS

A function introduction (optional name, arguments, body)

JSApp JS [JS]

Function application

JSVar Ident

Variable

JSConditional JS JS JS

Conditional expression

JSBlock [JS]

A block of expressions in braces

JSVariableIntroduction Ident (Maybe JS)

A variable introduction and optional initialization

JSAssignment JSAssignment JS

A variable assignment

JSWhile JS JS

While loop

JSFor Ident JS JS JS

For loop

JSIfElse JS JS (Maybe JS)

If-then-else statement

JSReturn JS

Return statement

JSThrow JS

Throw statement

JSTypeOf JS

Type-Of operator

JSLabel String JS

Labelled statement

JSBreak String

Break statement

JSContinue String

Continue statement

JSRaw String

Raw Javascript (generated when parsing fails for an inline foreign import declaration)

Instances

data JSAssignment Source

Data type for expressions which can appear on the left hand side of an assignment

Constructors

JSAssignVariable Ident

Assign a variable

JSAssignProperty String JSAssignment

Assign an object property