From aa05674b1df8b5e49bf702068e7ec3d33c957d3e Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Mon, 16 Oct 2023 09:08:51 -0700 Subject: [PATCH] spec: explain eval order of binary operator examples with comments Fixes #63525. Change-Id: Ie9aa4dd47c025cd593e576c6e8de1774e1d1e302 Reviewed-on: https://go-review.googlesource.com/c/go/+/535775 Reviewed-by: Robert Griesemer Reviewed-by: Ian Lance Taylor TryBot-Bypass: Robert Griesemer Auto-Submit: Robert Griesemer Reviewed-by: Keith Randall Reviewed-by: Keith Randall --- doc/go_spec.html | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index 09e2b6c97c..38130a3cc9 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -4826,12 +4826,13 @@ For instance, x / y * z is the same as (x / y) * z.

-+x
-23 + 3*x[i]
-x <= f()
-^a >> b
-f() || g()
-x == y+1 && <-chanInt > 0
++x                         // x
+42 + a - b                 // (42 + a) - b
+23 + 3*x[i]                // 23 + (3 * x[i])
+x <= f()                   // x <= f()
+^a >> b                    // (^a) >> b
+f() || g()                 // f() || g()
+x == y+1 && <-chanInt > 0  // (x == (y+1)) && ((<-chanInt) > 0)
 
-- 2.44.0