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

Safe HaskellNone
LanguageHaskell2010

Language.ECMAScript3.Syntax.CodeGen

Description

Utility combinator functions for simplifying writing programmatic generation of ECMAScript code. Recommended to use together with the -XOverloadedStrings GHC extension.

Synopsis

Documentation

propId :: Default a => Id a -> Prop a Source

var :: Default a => Id a -> Expression a Source

func :: Default a => Id a -> [Id a] -> [Statement a] -> Expression a Source

lambda :: Default a => [Id a] -> [Statement a] -> Expression a Source

function :: Default a => Id a -> [Id a] -> [Statement a] -> Statement a Source

id2string :: Id a -> Expression a Source

Convert an identifier to a String literal

lv2e :: LValue a -> Expression a Source

Helper function to convert LValues to expressions

e2lv :: Expression a -> LValue a Source

Convert an expression to an l-value. May fail with an error