From: Robert Griesemer Date: Fri, 18 Nov 2016 18:49:29 +0000 (-0800) Subject: spec: add subtitles to section on "for" statements X-Git-Tag: go1.8beta1~99 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b01f612a693b2b39064c0b5bd75a5d0280e4179e;p=gostls13.git spec: add subtitles to section on "for" statements This matches what we already do for switch statements and makes this large section more visibly organized. No other changes besides introducing the titles. Fixes #4486. Change-Id: I73f274e4fdd27c6cfeaed79090b4553e57a9c479 Reviewed-on: https://go-review.googlesource.com/33410 Reviewed-by: Rob Pike Reviewed-by: Matthew Dempsky --- diff --git a/doc/go_spec.html b/doc/go_spec.html index 1a60a9eac7..5872eefb03 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -4799,8 +4799,8 @@ The "fallthrough" statement is not permitted in a type switch.

For statements

-A "for" statement specifies repeated execution of a block. The iteration is -controlled by a condition, a "for" clause, or a "range" clause. +A "for" statement specifies repeated execution of a block. There are three forms: +The iteration may be controlled by a single condition, a "for" clause, or a "range" clause.

@@ -4808,6 +4808,8 @@ ForStmt = "for" [ Condition | ForClause | RangeClause ] Block .
 Condition = Expression .
 
+

For statements with single condition

+

In its simplest form, a "for" statement specifies the repeated execution of a block as long as a boolean condition evaluates to true. @@ -4822,6 +4824,8 @@ for a < b { } +

For statements with for clause

+

A "for" statement with a ForClause is also controlled by its condition, but additionally it may specify an init @@ -4860,6 +4864,8 @@ for cond { S() } is the same as for ; cond ; { S() } for { S() } is the same as for true { S() } +

For statements with range clause

+

A "for" statement with a "range" clause iterates through all entries of an array, slice, string or map,