Skip to content

Or Statements

Benedict Albrecht edited this page Jun 2, 2026 · 4 revisions

Or Statements

Or statements define alternative paths - the parser matches one of the listed options.


Syntax

<| optionA <||> optionB <||> ... |>

Example

A function with an optional visibility modifier:

<:function:> <| private <||> public <||> |> function <<name>> ( ) { <---> } <:>
Input Matched Option
private function myFunc () { } private
public function myFunc () { } public
function myFunc () { } (empty - optional)

Tip: An empty option before |> makes the entire or-block optional (zero occurrences accepted).


Next: Repeat Statements - Matching a pattern zero or more times.

Clone this wiki locally