Module: lib/runtime

Classes

BareScriptParserError
BareScriptRuntimeError

Methods

(static) barescriptLintScript(script, globalsopt, nullable) → {Array.<string>}

Lint a BareScript model

Parameters:
Name Type Attributes Default Description
script Object

The BareScript model

globals Object <optional>
<nullable>
null

The script global variables

Source:
Returns:

The array of lint warning strings

Type
Array.<string>

(static) barescriptParseExpression(exprText, lineNumberopt, nullable, scriptNameopt, nullable, arrayLiteralsopt) → {Object}

Parse a BareScript expression

Parameters:
Name Type Attributes Default Description
exprText string

The expression text

lineNumber number <optional>
<nullable>
null

The script line number

scriptName string <optional>
<nullable>
null

The script name

arrayLiterals boolean <optional>
false

If True, allow parsing of array literals

Source:
Throws:
Returns:
Type
Object

(static) barescriptParseScript(scriptText, startLineNumberopt, scriptNameopt, nullable) → {Object}

Parse a BareScript script

Parameters:
Name Type Attributes Default Description
scriptText string | Array.<string>

The script text

startLineNumber number <optional>
1

The script's starting line number

scriptName string <optional>
<nullable>
null

The script name

Source:
Throws:
Returns:
Type
Object

(static) evaluateExpression(expr, optionsopt, nullable, localsopt, nullable, builtinsopt)

Evaluate an expression model

Parameters:
Name Type Attributes Default Description
expr Object

The expression model

options Object <optional>
<nullable>
null

The script execution options

locals Object <optional>
<nullable>
null

The local variables

builtins boolean <optional>
true

If true, include the built-in expression functions

Source:
Throws:
Returns:

The expression result

(static) executeScript(script, optionsopt)

Execute a BareScript model

Parameters:
Name Type Attributes Default Description
script Object

The BareScript model

options Object <optional>
{}

The script execution options

Source:
Throws:
Returns:

The script result