mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Precedence terminology (#3465)
This commit is contained in:
+3
-2
@@ -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) {}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user