From: Robert Griesemer Date: Mon, 16 Oct 2023 16:08:51 +0000 (-0700) Subject: spec: explain eval order of binary operator examples with comments X-Git-Tag: go1.22rc1~592 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=aa05674b1df8b5e49bf702068e7ec3d33c957d3e;p=gostls13.git 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 --- 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)