Global

Members

(constant) AND :string

Source:
Type:
  • string

(constant) BOOL :string

Source:
Type:
  • string

(constant) ECHO :string

Source:
Type:
  • string

(constant) ELIF :string

Source:
Type:
  • string

(constant) ELSE :string

Source:
Type:
  • string

(constant) EMPTY :string

Source:
Type:
  • string

(constant) END :string

Source:
Type:
  • string

(constant) EOF :string

Source:
Type:
  • string

(constant) EQ :string

Source:
Type:
  • string

(constant) FOREACH :string

Source:
Type:
  • string

(constant) GT :string

Source:
Type:
  • string

(constant) IDENT :string

Source:
Type:
  • string

(constant) IF :string

Source:
Type:
  • string

(constant) IN :string

Source:
Type:
  • string

(constant) NEQ :string

Source:
Type:
  • string

(constant) NOT :string

Source:
Type:
  • string

(constant) NUM :string

Source:
Type:
  • string

(constant) OR :string

Source:
Type:
  • string

(constant) STR :string

Source:
Type:
  • string

(constant) TOKEN_PREFIX :string

Source:
Type:
  • string

Methods

arrayToString(arr:) → {string}

Render an array of AST values using each value's toString output.
Source:
Parameters:
Name Type Description
arr: Array.<*> values to stringify
Returns:
Type:
string
array representation for debug output

compile(source:, optionsopt, options["parser:debug"]opt, options["compiler:debug"]opt) → {Object}

Compile a Jazz template into an executable program.
Source:
Parameters:
Name Type Attributes Description
source: string template source text
options Object <optional>
optional compiler and parser options
Name Type Attributes Description
filename string <optional>
filename used for error reporting
options["parser:debug"] boolean <optional>
enable parser debug mode
options["compiler:debug"] boolean <optional>
enable compiler debug mode
Returns:
Type:
Object
compiled program with process(namespace, cb)

createCompiler() → {CompilerJS}

Create a default JavaScript compiler.
Source:
Returns:
Type:
CompilerJS
compiler instance

createParser(scanner:) → {Parser}

Create a parser instance from scanner.
Source:
Parameters:
Name Type Description
scanner: Object scanner instance
Returns:
Type:
Parser
parser instance

createScanner(source:, filenameopt) → {Scanner}

Create a scanner instance from source input.
Source:
Parameters:
Name Type Attributes Description
source: string template source text
filename string <optional>
template filename for error reporting
Returns:
Type:
Scanner
scanner instance

ident(source:, index:) → {string}

Parse an identifier token value from source.
Source:
Parameters:
Name Type Description
source: string source string
index: number source offset
Returns:
Type:
string
parsed identifier

inArray(value:, arr:) → {boolean}

Check whether a value exists in an array.
Source:
Parameters:
Name Type Description
value: * value to locate
arr: Array.<*> source array
Returns:
Type:
boolean
true when value exists in array

isIdentChar(char:) → {boolean}

Determine whether a character is a valid identifier character.
Source:
Parameters:
Name Type Description
char: string | undefined character to evaluate
Returns:
Type:
boolean
true when character is valid for identifiers

keyword(name:, source:, index:) → {boolean}

Check if source at index starts with a keyword boundary.
Source:
Parameters:
Name Type Description
name: string keyword name
source: string source string
index: number source offset
Returns:
Type:
boolean
true when a full keyword match is found

num(source:, index:) → {string}

Parse a numeric token value from source.
Source:
Parameters:
Name Type Description
source: string source string
index: number source offset
Returns:
Type:
string
parsed numeric literal text

str(source:, index:) → {string}

Parse a quoted string token value from source.
Source:
Parameters:
Name Type Description
source: string source string
index: number source offset at opening quote
Returns:
Type:
string
parsed string value