From: Robert Griesemer Date: Fri, 26 Feb 2016 23:52:13 +0000 (-0800) Subject: spec: refine rules about terminating statements X-Git-Tag: go1.7beta1~608 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b5ddbb90bf1b6aa3881a342bbf7986ba14df3348;p=gostls13.git spec: refine rules about terminating statements Per a suggestion from mdempsky. Both gc and gccgo consider a statement list as terminating if the last _non_empty_ statement is terminating; i.e., trailing semis are ok. Only gotype followed the current stricter rule in the spec. This change adjusts the spec to match gc and gccgo behavior. In support of this change, the spec has a matching rule for fallthrough, which in valid positions may be followed by trailing semis as well. For details and examples, see the issue below. Fixes #14422. Change-Id: Ie17c282e216fc40ecb54623445c17be111e17ade Reviewed-on: https://go-review.googlesource.com/19981 Reviewed-by: Ian Lance Taylor Reviewed-by: Russ Cox --- diff --git a/doc/go_spec.html b/doc/go_spec.html index 437fc066bb..c6187b0787 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -4257,7 +4257,7 @@ All other statements are not terminating.

A statement list ends in a terminating statement if the list -is not empty and its final statement is terminating. +is not empty and its final non-empty statement is terminating.