-
Notifications
You must be signed in to change notification settings - Fork 8
Syntax
For help understanding a BNF spec, read this.
String ::= TEXT | [' "] RAWTEXT [' "]
Variable ::= @varname ; if the varname
is invalid, it will be treated as string
Conditional ::= ( Literal BIN_OP Literal *( BIN_PREC Conditional ) ) ; a basic binary conditional
Operation ::= [unsafe] FN(1#Literal) ; a regular function called with arguments inside parenthesis. Might contain an unsafe
before itself.
Cycle ::= 1*Operation
Target ::= Conditional { Cycle *(; Cycle ) }
Voila_script ::= 1*Target
Voila's syntax is composed of a binary conditional statement, followed by the operations, delimited within curly brackets. These are separated into cycles. A cycle is an iteration between all directory files, the operations in every cycle are executed if the file matches the conditional. Operations do execute in parallel, and cycles do execute consecutively. Cycles are separated with ;
, and operations' arguments are separated with ,
. Variables' prefix is @
, and its value changes to the file that is evaluating. Everything within quotes ('
or "
) will be directly treated as raw and won't evaluate to any variable or other token. For a more intuitive explanation, go to the "Examples" section.
This might seem a little confusing, but just keep reading, and you'll see how everything becomes saner.