From: Rob Pike Date: Sat, 8 Mar 2008 02:01:09 +0000 (-0800) Subject: fix grammar for struct and interface types to make final semicolon optional X-Git-Tag: weekly.2009-11-06~3833 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2aae3fcbafb35a483da59d08f31e1b96c840cf74;p=gostls13.git fix grammar for struct and interface types to make final semicolon optional SVN=111810 --- diff --git a/doc/go_lang.txt b/doc/go_lang.txt index ac7b12d7d1..a5cf328dd7 100644 --- a/doc/go_lang.txt +++ b/doc/go_lang.txt @@ -601,8 +601,8 @@ Struct types are similar to C structs. Each field of a struct represents a variable within the data structure. - StructType = 'struct' '{' { FieldDecl } '}' . - FieldDecl = IdentifierList Type ';' . + StructType = 'struct' '{' [ FieldDecl { ';' FieldDecl } [ ';' ] ] '}' . + FieldDecl = IdentifierList Type . // An empty struct. struct {} @@ -768,8 +768,8 @@ Interface types An interface type denotes a set of methods. - InterfaceType = 'interface' '{' { MethodDecl } '}' . - MethodDecl = identifier Parameters [ Result ] ';' . + InterfaceType = 'interface' '{' [ MethodDecl { ';' MethodDecl } [ ';' ] ] '}' . + MethodDecl = identifier Parameters [ Result ] . // A basic file interface. type File interface {