mirror of
https://github.com/golang/go
synced 2024-11-13 16:40:22 -07:00
spec: clarify lhs syntax for range and select
Fixes #4653. R=rsc, r, iant, ken, thakis CC=golang-dev https://golang.org/cl/7135058
This commit is contained in:
parent
059fed3dfb
commit
d3679726b4
@ -1,6 +1,6 @@
|
|||||||
<!--{
|
<!--{
|
||||||
"Title": "The Go Programming Language Specification",
|
"Title": "The Go Programming Language Specification",
|
||||||
"Subtitle": "Version of January 11, 2013",
|
"Subtitle": "Version of January 18, 2013",
|
||||||
"Path": "/ref/spec"
|
"Path": "/ref/spec"
|
||||||
}-->
|
}-->
|
||||||
|
|
||||||
@ -4353,7 +4353,7 @@ to corresponding <i>iteration variables</i> and then executes the block.
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre class="ebnf">
|
<pre class="ebnf">
|
||||||
RangeClause = Expression [ "," Expression ] ( "=" | ":=" ) "range" Expression .
|
RangeClause = ( ExpressionList "=" | IdentifierList ":=" ) "range" Expression .
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@ -4522,7 +4522,7 @@ cases all referring to communication operations.
|
|||||||
SelectStmt = "select" "{" { CommClause } "}" .
|
SelectStmt = "select" "{" { CommClause } "}" .
|
||||||
CommClause = CommCase ":" { Statement ";" } .
|
CommClause = CommCase ":" { Statement ";" } .
|
||||||
CommCase = "case" ( SendStmt | RecvStmt ) | "default" .
|
CommCase = "case" ( SendStmt | RecvStmt ) | "default" .
|
||||||
RecvStmt = [ Expression [ "," Expression ] ( "=" | ":=" ) ] RecvExpr .
|
RecvStmt = [ ExpressionList "=" | IdentifierList ":=" ] RecvExpr .
|
||||||
RecvExpr = Expression .
|
RecvExpr = Expression .
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user