new Compiler(tree)
Represents a Compiler.
Parameters:
| Name | Type | Description |
|---|---|---|
tree |
Tree | A template Tree to compile. |
- Source:
Methods
-
(static) Compiler#compileConditional(node) → {string}
-
Compiles a conditional into JavaScript.
Parameters:
Name Type Description nodeobject The conditional node to compile. - Source:
Returns:
The compiled JavaScript source string value.- Type
- string
-
(static) Compiler#compileExtend(node) → {string}
-
Compiles a render into JavaScript.
Parameters:
Name Type Description nodeobject The partial node to compile. - Source:
Returns:
The compiled JavaScript source string value.- Type
- string
-
(static) Compiler#compileLoop(node) → {string}
-
Compiles a loop into JavaScript.
Parameters:
Name Type Description nodeobject The loop node to compile. - Source:
Returns:
The compiled JavaScript source string value.- Type
- string
-
(static) Compiler#compilePartial(node) → {string}
-
Compiles a partial into JavaScript.
Parameters:
Name Type Description nodeobject The partial node to compile. - Source:
Returns:
The compiled JavaScript source string value.- Type
- string
-
(static) Compiler#compileProperty(node) → {string}
-
Compiles a property into JavaScript.
Parameters:
Name Type Description nodeobject The property node to compile. - Source:
Returns:
The compiled JavaScript source string value.- Type
- string
-
(static) Compiler#process(nodes, keyVal) → {string}
-
A recursively called method to detect how to compile each Node in the Tree.
Parameters:
Name Type Description nodesarray An Array of Tree nodes to process. keyValarray An optional array of meta condition keys. - Source:
Returns:
Joined compiled nodes representing the template body.- Type
- string