Parser
class Parser(compilerEnv: CompilerEnvirons = CompilerEnvirons(), errorReporter: ErrorReporter = compilerEnv.errorReporter)
The JavaScript parser, based on the SpiderMonkey sources jsparse.c and jsparse.h.
It produces an AstRoot parse tree that mirrors the source exactly: no tree rewriting happens here, so the tree stays useful for IDEs and pretty-printers.
A Parser is single use. Calling parse twice throws.
Not ported: the Reader-based source path (D-2) and the E4X methods, so defaultXmlNamespace, xmlInitializer, attributeAccess and the XML branches of propertyName and memberExprTail report "XML not available" instead of parsing E4X syntax.
Constructors
Link copied to clipboard
constructor(compilerEnv: CompilerEnvirons = CompilerEnvirons(), errorReporter: ErrorReporter = compilerEnv.errorReporter)
Types
Link copied to clipboard
interface CurrentPositionReporter
Where the parser is right now, for an error message that wants to point at it.
Link copied to clipboard
Exception used to unwind out of a failed parse.