Skip to content

Commit

Permalink
[doc] explain how case clauses with multiple selectors are supported
Browse files Browse the repository at this point in the history
  • Loading branch information
teoxoy committed Nov 17, 2022
1 parent 4988a9a commit e0185d1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,11 @@ pub enum Statement {
reject: Block,
},
/// Conditionally executes one of multiple blocks, based on the value of the selector.
///
/// Some backends don't support fallthrough (HLSL due to FXC, WGSL).
/// However, a case clause with multiple selectors (and one body) gets translated as
/// a sequence of [`SwitchCase`]s with all but the last one having no body and marked
/// as fallthrough (which can get translated directly to all backends).
Switch {
selector: Handle<Expression>, //int
cases: Vec<SwitchCase>,
Expand Down

0 comments on commit e0185d1

Please sign in to comment.