LexiconFormatter

baja/obj/Format~ LexiconFormatter

new LexiconFormatter()

Source:
Implements:

Methods

canFormat(script) → {boolean}

Source:
Implements:
Parameters:
Name Type Description
script string

the current bit of script being evaluated.

Returns:

true if this matcher can perform a Format replacement on the given string

Type
boolean

doFormat(script, formatContext, suggestError) → {string|Promise.<string>}

Source:
Implements:
Parameters:
Name Type Description
script string

the current bit of script being evaluated. This is the out.value in
%out.value%. Will be called multiple times for formats with multiple scripts. BFormat.java
confusingly calls this "id".

formatContext baja.Format~FormatContext
suggestError function

if this formatter is not capable of correctly formatting the
script, it can call this given function with an error to be inserted into the formatted string
explaining why.

Returns:
Type
string | Promise.<string>