On Thu, Mar 8, 2018 at 8:43 AM,  <d...@veryhaha.com> wrote:
>
> There are two semicolon rules in Go spec:
> https://golang.org/ref/spec#Semicolons
> The first one states how a semicolon will be automatically inserted,
> however, the second one states how a semicolon can be omitted.
> Isn't more consistent to modify the second one to the following description?
>
> To allow complex statements to occupy a single line, a semicolon may be
> inserted before a closing ")" or "}".

We would have to change a lot of the syntax productions.  For example

StructType    = "struct" "{" { FieldDecl ";" } "}" .

The rule as stated permits omitting the final ";" when the "}" follows
on the same line (if the "}" is on a different line, the ";" is
inserted automatically anyhow).  If we change to your version, we need
to rewrite the StructType production to not have a trailing ";", and
then rely on the new rule to permit adding one.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to