mirror of
https://github.com/golang/go
synced 2024-11-22 06:04:39 -07:00
instead of unlabeled statements, have a single labeled statement
- no syntactic or semantic change R=r DELTA=45 (24 added, 18 deleted, 3 changed) OCL=26349 CL=26368
This commit is contained in:
parent
5136a9e1f7
commit
dea4394a67
@ -2908,16 +2908,13 @@ Statements control execution.
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre class="grammar">
|
<pre class="grammar">
|
||||||
Statement = { Label ":" } UnlabeledStatement .
|
Statement =
|
||||||
Label = identifier .
|
Declaration | EmptyStat | LabeledStat |
|
||||||
UnlabeledStatement =
|
|
||||||
Declaration | EmptyStat |
|
|
||||||
SimpleStat | GoStat | ReturnStat | BreakStat | ContinueStat | GotoStat |
|
SimpleStat | GoStat | ReturnStat | BreakStat | ContinueStat | GotoStat |
|
||||||
FallthroughStat | Block | IfStat | SwitchStat | SelectStat | ForStat |
|
FallthroughStat | Block | IfStat | SwitchStat | SelectStat | ForStat |
|
||||||
DeferStat .
|
DeferStat .
|
||||||
|
|
||||||
SimpleStat =
|
SimpleStat = ExpressionStat | IncDecStat | Assignment | SimpleVarDecl .
|
||||||
ExpressionStat | IncDecStat | Assignment | SimpleVarDecl .
|
|
||||||
|
|
||||||
StatementList = Statement { Separator Statement } .
|
StatementList = Statement { Separator Statement } .
|
||||||
Separator = [ ";" ]
|
Separator = [ ";" ]
|
||||||
@ -2936,14 +2933,6 @@ which may be omitted only if the previous statement:
|
|||||||
(including "switch" and "select" statements).
|
(including "switch" and "select" statements).
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>
|
|
||||||
A labeled statement may be the target of a <code>goto</code>,
|
|
||||||
<code>break</code> or <code>continue</code> statement.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<pre>
|
|
||||||
Error: log.Fatal("error encountered")
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<h3>Empty statements</h3>
|
<h3>Empty statements</h3>
|
||||||
|
|
||||||
@ -2961,6 +2950,23 @@ adding an empty statement.
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<h3>Labeled statements</h3>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
A labeled statement may be the target of a <code>goto</code>,
|
||||||
|
<code>break</code> or <code>continue</code> statement.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<pre class="grammar">
|
||||||
|
LabeledStat = Label ":" Statement .
|
||||||
|
Label = identifier .
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
Error: log.Fatal("error encountered")
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
<h3>Expression statements</h3>
|
<h3>Expression statements</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
Loading…
Reference in New Issue
Block a user