Commit 2aae3fcb authored by Rob Pike's avatar Rob Pike

fix grammar for struct and interface types to make final semicolon optional

SVN=111810
parent e6626daf
...@@ -601,8 +601,8 @@ Struct types are similar to C structs. ...@@ -601,8 +601,8 @@ Struct types are similar to C structs.
Each field of a struct represents a variable within the data Each field of a struct represents a variable within the data
structure. structure.
StructType = 'struct' '{' { FieldDecl } '}' . StructType = 'struct' '{' [ FieldDecl { ';' FieldDecl } [ ';' ] ] '}' .
FieldDecl = IdentifierList Type ';' . FieldDecl = IdentifierList Type .
// An empty struct. // An empty struct.
struct {} struct {}
...@@ -768,8 +768,8 @@ Interface types ...@@ -768,8 +768,8 @@ Interface types
An interface type denotes a set of methods. An interface type denotes a set of methods.
InterfaceType = 'interface' '{' { MethodDecl } '}' . InterfaceType = 'interface' '{' [ MethodDecl { ';' MethodDecl } [ ';' ] ] '}' .
MethodDecl = identifier Parameters [ Result ] ';' . MethodDecl = identifier Parameters [ Result ] .
// A basic file interface. // A basic file interface.
type File interface { type File interface {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment