-
Notifications
You must be signed in to change notification settings - Fork 336
Closed
Labels
wgslWebGPU Shading Language IssuesWebGPU Shading Language Issues
Milestone
Description
This is a very elaborate set of rules:
When a break statement is placed such that it would exit from a loop’s § 7.3.8 Continuing Statement, then:
The break statement must appear as either:
The only statement in the if clause of an if statement that has:
no else clause or an empty else clause
no elseif clauses
The only statement in the else clause of an if statement that has an empty if clause and no elseif clauses.
That if statement must appear last in the continuing clause.
It's basically "no break
inside continue
, unless at the very end behind an if
".
Would it make sense to express this via language syntax instead?
var a: i32 = 2;
var i: i32 = 0;
loop {
let step: i32 = 1;
if (i % 2 == 0) { continue; }
a = a * 2;
continuing {
i = i + step;
} unless (i>=4); // <--- HERE
}
Metadata
Metadata
Assignees
Labels
wgslWebGPU Shading Language IssuesWebGPU Shading Language Issues