]> Cypherpunks repositories - gostls13.git/commit
spec: refine rules about terminating statements
authorRobert Griesemer <gri@golang.org>
Fri, 26 Feb 2016 23:52:13 +0000 (15:52 -0800)
committerRobert Griesemer <gri@golang.org>
Tue, 19 Apr 2016 17:34:12 +0000 (17:34 +0000)
commitb5ddbb90bf1b6aa3881a342bbf7986ba14df3348
tree15c4d269543154a9a153a35dafeb367d864ea96b
parenta39950ba66998b7166a37ddf878d0a414a267ea5
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 <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
doc/go_spec.html