The Fabl parser understands many of the same prefix and infix operators as JavaScript. Here is a comma-separated list of the Fabl operators:
+,-,*,/,!,++,--,==,!=,<,<=,>,>=,&&,||,.,..,:
Several JavaScript operators, eg << and >>, are not present in the current Fabl release, but will be added in future.
The operators ++ and -- may appear only as postfix operators not in prefix position. That is,
var int x,y; y = x++;
is legal, but not
y = ++x;
Prefix variants of ++,-- will be added in a future release
Most of these operators have an equivalent function name; for example "x+y" is exactly equivalent to "plus(x,y)" and "!x" to "not(x)". The programmer is free to define new polymorphic variants of the function name associated with an operator, thereby extending the functionality of the operator. For example,
string function not(string x)
{
return "not("+x+")";
}
!"abc";
-->not(abc)
The equivalences are:
| + | plus |
| * | times |
| - | difference |
| / | quotient |
| ++ | plus_plus |
| -- | minus_minus |
| == | equal |
| != | not_equal |
| < | lessp |
| <= | leq |
| > | greaterp |
| >= | geq |
| && | and |
| || | or |
| ! | not |