-
Notifications
You must be signed in to change notification settings - Fork 0
Or Statements
Benedict Albrecht edited this page Jun 2, 2026
·
4 revisions
Or statements define alternative paths - the parser matches one of the listed options.
<| optionA <||> optionB <||> ... |>
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).
The Basics grammar uses or-statements in several places:
| Object | Or-statement | Alternatives |
|---|---|---|
import |
<| <<name:up>> <||> { <<name:up>> } |> |
Direct import (import X) or destructured import (import { X }) |
import |
<| ; <||> \n |> |
Import ends with semicolon or newline |
class / function
|
<| , <||> <<NAME:down>> |> |
Parameter preceded by comma, or first parameter (no comma) |
In the Test_Repo, import { C2 } from './bridgeTest2.txt' matches the { <<name:up>> } branch, while import C3 from '../refFile.txt' would match the <<name:up>> branch.
Next: Repeat Statements - Matching a pattern zero or more times.
- Getting Started
- Sign-Up
- Home Screen
- Creating Your First Template
- Template Editor
- Application Navigation
- Syntax Overview
- Workflow: End-to-End
- Workflow: Test with simpleDemo
- Workflow: Build Template from angularTemp
- Demo Repositories
- Template
- Workbench
- GitHub Integration
- GitHub App Installation
- GitHub Repository Setup
- GitHub Re-linking
- Settings
- Overview
- Declarations
- Types
- Scoping