Members
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.
Parameters:
| Name | Type | Attributes | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
source: |
string
|
template source text | |||||||||
options |
Object
|
<optional> |
optional compiler and parser options
|
||||||||
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)
createParser(scanner:) → {Parser}
Create a parser instance from scanner.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
scanner: |
Object
|
scanner 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 |
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