-
Notifications
You must be signed in to change notification settings - Fork 0
Jump Instructions
The jump instruction skips all tokens until a concrete target token is found.
Jumps are intended for comments and string literals - cases where the content between delimiters is irrelevant to the grammar and may contain tokens (like brackets) that would confuse the parser.
Prefer Sub-bodies over jumps for all other cases. A jump skips over everything until the target token, which can quickly lead to problems if the target token appears earlier than expected or is missing entirely.
| Use Case | Recommended |
|---|---|
Comments (//, /* */) |
Jump |
String literals ('...', "...") |
Jump |
| Structured content (blocks, parameters, expressions) | Sub-body |
-->> stopToken
Rule: The target must be a concrete literal - e.g.,
\n,),;,BEGIN,*/.The syntax
-->> <| a <||> b |>is supported - the jump stops at whichever alternative is found first. However, the or-statement must not contain an empty branch, since the jump needs a concrete token to stop at.
| Pattern | Matches |
|---|---|
// -->> \n |
Single-line comment: from // to end of line |
/* -->> */ |
Block comment: from /* to */
|
' -->> ' |
String literal: from ' to '
|
<*comment_line*> // -->> \n <*>
<*comment_block*> /* -->> */ <*>
Next: Variables - Capturing tokens and controlling scope.
- 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