Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document which expressions are in scope for a break_if expression. #2326

Merged
merged 1 commit into from
May 25, 2023
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
14 changes: 8 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1597,14 +1597,16 @@ pub enum Statement {
/// The `continuing` block and its substatements must not contain `Return`
/// or `Kill` statements, or any `Break` or `Continue` statements targeting
/// this loop. (It may have `Break` and `Continue` statements targeting
/// loops or switches nested within the `continuing` block.)
/// loops or switches nested within the `continuing` block.) Expressions
/// emitted in `body` are in scope in `continuing`.
///
/// If present, `break_if` is an expression which is evaluated after the
/// continuing block. If its value is true, control continues after the
/// `Loop` statement, rather than branching back to the top of body as
/// usual. The `break_if` expression corresponds to a "break if" statement
/// in WGSL, or a loop whose back edge is an `OpBranchConditional`
/// instruction in SPIR-V.
/// continuing block. Expressions emitted in `body` or `continuing` are
/// considered to be in scope. If the expression's value is true, control
/// continues after the `Loop` statement, rather than branching back to the
/// top of body as usual. The `break_if` expression corresponds to a "break
/// if" statement in WGSL, or a loop whose back edge is an
/// `OpBranchConditional` instruction in SPIR-V.
///
/// [`Break`]: Statement::Break
/// [`Continue`]: Statement::Continue
Expand Down