Loop syntax, unrolling, etc...
Loops can appear in expressions and in rules in the PRS language. A rule-loop can be written as:
The loop-var is declared with a identifier, and may be referenced in the body rules. The rule-loop is repeatedly expanded using the values spanned by the range. (The range may be written implicitly or explicitly.) If the range evaluates empty, then the body is skipped during unrolling. Rule-loops may be nested, i.e., they may contain other loops. The current limit for the size of an expression is 65535 sub-expressions.
An expression-loop is written as:
Interpret the following:
(
&:i:0: x[i])
-> y-
(
|:i:0: x[i])
-> y-
z
& (
&:i:0: x[i])
-> y-
z
& (
|:i:0: x[i])
-> y-
z
| (
&:i:0: x[i])
-> y-
z
| (
|:i:0: x[i])
-> y-