Provides a variety of different parsing tools for foundry ink. These assist in converting story text into actions performed by foundry or by installed modules.
Methods
(static) parseAltText(text, namesopt) → {undefined|Object}
Parses statements written in the form of DATA--ALTTEXT. This syntax is
intended for use when data contains some text to show in the ink story once
the data has been parsed out, so that text can be included in a compact
format.
Parameters:
| Name | Type | Attributes | Default | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
text |
String | the text to be parsed |
|||||||||||
names |
Object |
<optional> |
{ data: 'data', alttext: 'alttext' }
|
maps each of the regex groups to a name of your choosing, if specified. Properties
|
Returns:
the result of parsing. When the parse has
failed, this will be undefined. Otherwise, it will be an object
containing a named field for each element in the names parameter.
- Type
- undefined | Object
(static) parseInline(text, namesopt) → {undefined|Object}
Parses statements written in the form of COMMAND (TYPE): ARGUMENT. While
writing a script, it is common to use inline statements to tag character
dialogue, or to indicate scene/shot transitions. This syntax is intended for
the ink story to control foundry.
Parameters:
| Name | Type | Attributes | Default | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
text |
String | the text to be parsed |
||||||||||||||
names |
Object |
<optional> |
{ command: 'command', type: 'type', argument: 'argument' }
|
maps each of the regex groups to a name of your choosing, if specified. Properties
|
Returns:
the result of parsing. When the parse has
failed, this will be undefined. Otherwise, it will be an object
containing a named field for each element in the names parameter.
- Type
- undefined | Object
(static) parseInterface(text, namesopt) → {undefined|Object}
Parses statements written in the form of INTERFACE>>DATA. This syntax is
intended for use when the ink story needs to wait for foundry to do
something, such as fire a hook, before it is time to resume the story.
Parameters:
| Name | Type | Attributes | Default | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
text |
String | the text to be parsed |
|||||||||||
names |
Object |
<optional> |
{ interface: 'interface', data: 'data' }
|
maps each of the regex groups to a name of your choosing, if specified. Properties
|
Returns:
the result of parsing. When the parse has
failed, this will be undefined. Otherwise, it will be an object
containing a named field for each element in the names parameter.
- Type
- undefined | Object