mirror of
https://github.com/golang/go
synced 2024-09-15 22:20:06 +00:00
spec: fix EBNF for slice syntax
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>
This commit is contained in:
parent
735e5a483c
commit
5583e8a421
|
@ -1,6 +1,6 @@
|
||||||
<!--{
|
<!--{
|
||||||
"Title": "The Go Programming Language Specification",
|
"Title": "The Go Programming Language Specification",
|
||||||
"Subtitle": "Version of January 5, 2016",
|
"Subtitle": "Version of February 23, 2016",
|
||||||
"Path": "/ref/spec"
|
"Path": "/ref/spec"
|
||||||
}-->
|
}-->
|
||||||
|
|
||||||
|
@ -2443,9 +2443,8 @@ PrimaryExpr =
|
||||||
|
|
||||||
Selector = "." identifier .
|
Selector = "." identifier .
|
||||||
Index = "[" Expression "]" .
|
Index = "[" Expression "]" .
|
||||||
Slice = "[" ( [ Expression ] ":" [ Expression ] ) |
|
Slice = "[" [ Expression ] ":" [ Expression ] "]" |
|
||||||
( [ Expression ] ":" Expression ":" Expression )
|
"[" [ Expression ] ":" Expression ":" Expression "]" .
|
||||||
"]" .
|
|
||||||
TypeAssertion = "." "(" Type ")" .
|
TypeAssertion = "." "(" Type ")" .
|
||||||
Arguments = "(" [ ( ExpressionList | Type [ "," ExpressionList ] ) [ "..." ] [ "," ] ] ")" .
|
Arguments = "(" [ ( ExpressionList | Type [ "," ExpressionList ] ) [ "..." ] [ "," ] ] ")" .
|
||||||
</pre>
|
</pre>
|
||||||
|
|
Loading…
Reference in a new issue