PArrows-0.1: Arrow parser combinators similar to ParsecSource codeContentsIndex
Text.ParserCombinators.PArrow.ToJavaScript
Synopsis
data JSCompiler
data JSFun
newJSCompiler :: String -> IO (JSCompiler, JSFun -> String)
compileJS :: JSCompiler -> MD i o -> IO JSFun
dumpBodies :: JSCompiler -> IO [(JSFun, String)]
Documentation
data JSCompiler Source
JSCompiler encapsulates the state of the JavaScript compiler.
data JSFun Source
JSFun encapsulates a reference to a JavaScript function.
newJSCompiler :: String -> IO (JSCompiler, JSFun -> String)Source
Create a new JavaScript compiler using the suplied string as prefix. Returns the compiler and a function for showing function references.
compileJS :: JSCompiler -> MD i o -> IO JSFunSource
Compile a parser into JavaScript. Returns a reference to the top-level Parsing function. The generated javascript function expects a String and a starting index for parsing. The result will be either the index of the rightmost character matched or -1 if the parser failed.
dumpBodies :: JSCompiler -> IO [(JSFun, String)]Source
Dump all bodies of generated JavaScript functions.
Produced by Haddock version 2.3.0