Precedence terminology (#3465)

This commit is contained in:
josh11b
2023-12-06 23:10:33 +00:00
committed by GitHub
parent 9b194a31c9
commit fa07b52b8b
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -5,11 +5,12 @@
// AUTOUPDATE
fn F(n: i32) {
// Type operators and unary operators are lower precedence than `as`.
// Type operators and unary operators are higher precedence than `as`.
-n as const i32;
&n as i32*;
// `as` is lower precedence than relational comparisons and logical operators.
// `as` is higher precedence than relational comparisons and
// logical operators.
if (1 as i32 < 2 as i32 and true as bool and false as bool) {}
}
+1 -1
View File
@@ -6,7 +6,7 @@
fn F(p: i32*) {
// Numeric, bitwise, and bit-shift binary operators are lower precedence than
// Numeric and bitwise unary operators, which are lower precedence than
// numeric and bitwise unary operators, which are lower precedence than
// dereference.
-*p + ^*p;
-*p | ^*p;