Reference

Class

RiScript

Name

evaluate

Description Parses and executes a RiScript string. Available as either a static or instance function.
Example
// Static

RiScript.evaluate("He was [happy | sad | indifferent]");
RiScript.evaluate("He was [happy | sad | $emo]", context);

// Instance

riscript.evaluate("He was [happy | sad | indifferent]");
riscript.evaluate("He was [happy | sad | $emo]", context);
Parameters
Stringthe input
Object
the context for any referenced variables or functions (optional)
Object
)
(optional) options

{boolean} options.trace:
if true, output verbose log to console for debugging (default=false)

{boolean} options.onepass:
if true, run only one pass through engine(default=false)

{boolean} options.v2Compatible:
if true, use RiScript v2-compatible syntax (default=false)
Returns
Stringthe result of the evaluation
Syntax
riscript.evaluate(string);
riscript.evaluate(string, context);
Platform Java / JavaScript