Skip to content

Navigation Menu

Sign up

Expressions (WIP)

SReject edited this page Feb 9, 2020 · 15 revisions

Expressions are plain-text entered into Firebot that may or may not have special text-sequences that get replaced. Expressions are comprised of escape tokens text, quoted text, and functions that are explained in detail below

TODO: [Current List of Supported Functions]()

Escape Tokens

Escape tokens are sequences of characters that get replaced with an underlying value.

Sequence Result Notes
\\ \ only needed to be escaped if followed by $, ", [, ]
\$ $ Use to escape what would otherwise be treated as a function start in text
\" " Use to specify a literal double-quote in text and quoted text
\[ [ Use just after a function to include a literal opening bracket
\] ] Use within a function's argument to insert a literal closing bracket

Text

Within expressions any text that is not an escape token, quoted text, or part of a function is treated as literal text("as is").

Examples

Expression Result Notes
text text
\"text "text literal " followed by text
\$text $text literal $ followed by text
\text \text literal \ followed by text
\\text \\text literal \ followed by text. This is a poor example as the backslash may but does not need to be escaped in this case

Quoted Text

Quoted text is replaced with the content within the quotes.

Quoted text begins and ends with a ". Within quoted text escape sequences are processed but all other text is treat as is. This means that functions will not be processed within quoted text.

If quoted text is started but a closing " is not found, an error will occur.

See Escape Tokens if you need a literal double-quote in your output.

Examples

Expression Result Notes
"text" text
"$text" $text Literal $ followed by text
"\"text" "text Literal " followed by text
"c:\$f" c:\$f Neither the \ nor $ needed to be escaped
"text\\" text\ text followed by a literal \
$var[" text "] The first argument passed to $var will have one leading and one trailing space

Functions

Functions are tokens within the expression that return a result which replaces the function token.

Functions begin with a $ followed by alphanumeric characters. If the function accepts arguments(parameters), the token is followed by an [, 0 or more comma-separated arguments, then a ]. Each argument can consist of text tokens, quoted tokens, escape tokens, functions or a combination there of.

Within a function's arguments block, white space directly after the [ is ignored, white space directly before and after a comma separator is ignore and white space before the ] is ignored: $var[ a , b ] is treated as $var[a,b]. If you wish to preserve said white space use quoted text: $var[" a "," b "]

The current list of supported functions can be found here

Examples

To Do

Concatenation

To Do

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /