]> Cypherpunks repositories - gostls13.git/commitdiff
fix grammar for struct and interface types to make final semicolon optional
authorRob Pike <r@golang.org>
Sat, 8 Mar 2008 02:01:09 +0000 (18:01 -0800)
committerRob Pike <r@golang.org>
Sat, 8 Mar 2008 02:01:09 +0000 (18:01 -0800)
SVN=111810

doc/go_lang.txt

index ac7b12d7d1cc5bd86c90ec025d5670b2d69f30ab..a5cf328dd71463aa20e82b9b817a254b2c994189 100644 (file)
@@ -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 {