summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2014-05-28 08:43:47 -0700
committerRobert Griesemer <gri@golang.org>2014-05-28 08:43:47 -0700
commit9c3b0d007d757afa69ebc4e726d2aa350a8276d1 (patch)
tree348c0937ed495950faf3f5c5fcbea0b9409c1363 /doc
parentf03a5cc9ad8333cb0c2ed419dcb59e012d0f21d7 (diff)
downloadgo-9c3b0d007d757afa69ebc4e726d2aa350a8276d1.tar.gz
spec: clarify that break/continue do not work across function boundaries
Also made it extra clear for goto statements (even though label scopes are already limited to the function defining a label). Fixes issue 8040. LGTM=r, rsc R=r, rsc, iant, ken CC=golang-codereviews https://codereview.appspot.com/99550043
Diffstat (limited to 'doc')
-rw-r--r--doc/go_spec.html9
1 files changed, 6 insertions, 3 deletions
diff --git a/doc/go_spec.html b/doc/go_spec.html
index 11f6a90e6..baa0ecf40 100644
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -1,6 +1,6 @@
<!--{
"Title": "The Go Programming Language Specification",
- "Subtitle": "Version of May 22, 2014",
+ "Subtitle": "Version of May 28, 2014",
"Path": "/ref/spec"
}-->
@@ -5093,7 +5093,8 @@ func f(n int) (res int, err error) {
A "break" statement terminates execution of the innermost
<a href="#For_statements">"for"</a>,
<a href="#Switch_statements">"switch"</a>, or
-<a href="#Select_statements">"select"</a> statement.
+<a href="#Select_statements">"select"</a> statement
+within the same function.
</p>
<pre class="ebnf">
@@ -5127,6 +5128,7 @@ OuterLoop:
<p>
A "continue" statement begins the next iteration of the
innermost <a href="#For_statements">"for" loop</a> at its post statement.
+The "for" loop must be within the same function.
</p>
<pre class="ebnf">
@@ -5154,7 +5156,8 @@ RowLoop:
<h3 id="Goto_statements">Goto statements</h3>
<p>
-A "goto" statement transfers control to the statement with the corresponding label.
+A "goto" statement transfers control to the statement with the corresponding label
+within the same function.
</p>
<pre class="ebnf">