Add some parenthesis.

With the upcoming expression changes we need to put parenthesis around
boolean expressions which mix `&&` and `||`.

Bug: tint:1633
Change-Id: I7a304e5a23998d9977630c2d4466312be7ae169e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/99862
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
dan sinclair 2022-08-22 15:59:34 +00:00 committed by Dawn LUCI CQ
parent e76521153f
commit 96a7d5a6bd
1 changed files with 4 additions and 4 deletions

View File

@ -1639,7 +1639,7 @@ fn f() {
var b = true; var b = true;
var c = true; var c = true;
var d = true; var d = true;
let r = b && a(0) || c && a(1) && c && d || a(2); let r = (b && a(0)) || (c && a(1) && c && d) || a(2);
} }
)"; )";
@ -1869,7 +1869,7 @@ fn a(i : i32) -> bool {
fn f() { fn f() {
var b = true; var b = true;
let r = bool(a(0)) && bool(a(1) && b) || bool(a(2) && a(3)); let r = (bool(a(0)) && bool(a(1) && b)) || bool(a(2) && a(3));
} }
)"; )";
@ -1916,7 +1916,7 @@ fn a(i : i32) -> i32 {
fn f() { fn f() {
var b = true; var b = true;
let r = bool(a(0)) && bool(a(1)) || b; let r = (bool(a(0)) && bool(a(1))) || b;
} }
)"; )";
@ -1994,7 +1994,7 @@ fn a(i : i32) -> bool {
fn f() { fn f() {
var b = true; var b = true;
let r = all(a(0)) && all(a(1) && b) || all(a(2) && a(3)); let r = (all(a(0)) && all(a(1) && b)) || all(a(2) && a(3));
} }
)"; )";