| Safe Haskell | None |
|---|
Language.PureScript.CodeGen.JS.AST
Description
Data types for the intermediate simplified-Javascript AST
- data JS
- = JSNumericLiteral (Either Integer Double)
- | JSStringLiteral String
- | JSBooleanLiteral Bool
- | JSUnary UnaryOperator JS
- | JSBinary BinaryOperator JS JS
- | JSArrayLiteral [JS]
- | JSIndexer JS JS
- | JSObjectLiteral [(String, JS)]
- | JSAccessor String JS
- | JSFunction (Maybe Ident) [Ident] JS
- | JSApp JS [JS]
- | JSVar Ident
- | JSConditional JS JS JS
- | JSBlock [JS]
- | JSVariableIntroduction Ident (Maybe JS)
- | JSAssignment JSAssignment JS
- | JSWhile JS JS
- | JSFor Ident JS JS JS
- | JSIfElse JS JS (Maybe JS)
- | JSReturn JS
- | JSThrow JS
- | JSTypeOf JS
- | JSLabel String JS
- | JSBreak String
- | JSContinue String
- | JSRaw String
- data JSAssignment
Documentation
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) |
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 |