Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix rule name for while syntax
The grammar rule names should be called `.syntax`.

This also removes the existing `expr.loop.while.syntax` rule since it
would otherwise be a duplicate rule name. Repeating the syntax in
English doesn't really add much here, and we have been leaning towards
not having these kinds of rules.
  • Loading branch information
ehuss committed Feb 16, 2026
commit a7fa544c62e5b1be5dbf2bb62eaa7628228b2626
5 changes: 1 addition & 4 deletions src/expressions/loop-expr.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,14 @@ A `loop` expression containing associated [`break` expression(s)](#break-express
r[expr.loop.while]
## Predicate loops

r[expr.loop.while.grammar]
r[expr.loop.while.syntax]
```grammar,expressions
PredicateLoopExpression -> `while` Conditions BlockExpression
```

r[expr.loop.while.intro]
A `while` loop expression allows repeating the evaluation of a block while a set of conditions remain true.

r[expr.loop.while.syntax]
The syntax of a `while` expression is a sequence of one or more condition operands separated by `&&`, followed by a [BlockExpression].

r[expr.loop.while.condition]
Condition operands must be either an [Expression] with a [boolean type] or a conditional `let` match. If all of the condition operands evaluate to `true` and all of the `let` patterns successfully match their [scrutinee]s, then the loop body block executes.

Expand Down