]> Cypherpunks repositories - gostls13.git/commitdiff
spec: fix EBNF for slice syntax
authorRobert Griesemer <gri@golang.org>
Tue, 23 Feb 2016 18:42:06 +0000 (10:42 -0800)
committerRobert Griesemer <gri@golang.org>
Tue, 23 Feb 2016 19:18:25 +0000 (19:18 +0000)
The () parentheses grouped wrongly. Removed them completely in
favor of separate 2- and 3-index slice alternatives which is
clearer.

Fixes #14477.

Change-Id: I0b7521ac912130d9ea8740b8793b3b88e2609418
Reviewed-on: https://go-review.googlesource.com/19853
Reviewed-by: Ian Lance Taylor <iant@golang.org>
doc/go_spec.html

index 6b6e75c7c9f2646d93deb802027a92e3ccf712cf..437fc066bb60d9df6ec87567c0fd1cf75f947bcc 100644 (file)
@@ -1,6 +1,6 @@
 <!--{
        "Title": "The Go Programming Language Specification",
-       "Subtitle": "Version of January 5, 2016",
+       "Subtitle": "Version of February 23, 2016",
        "Path": "/ref/spec"
 }-->
 
@@ -2443,9 +2443,8 @@ PrimaryExpr =
 
 Selector       = "." identifier .
 Index          = "[" Expression "]" .
-Slice          = "[" ( [ Expression ] ":" [ Expression ] ) |
-                     ( [ Expression ] ":" Expression ":" Expression )
-                 "]" .
+Slice          = "[" [ Expression ] ":" [ Expression ] "]" |
+                 "[" [ Expression ] ":" Expression ":" Expression "]" .
 TypeAssertion  = "." "(" Type ")" .
 Arguments      = "(" [ ( ExpressionList | Type [ "," ExpressionList ] ) [ "..." ] [ "," ] ] ")" .
 </pre>