Class: Compiler

compiler. Compiler

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
node object 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
node object 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
node object 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
node object 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
node object 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
nodes array An Array of Tree nodes to process.
keyVal array An optional array of meta condition keys.
Source:
Returns:
Joined compiled nodes representing the template body.
Type
string