mirror of
https://github.com/golang/go
synced 2024-09-06 00:19:45 +00:00
fix grammar for struct and interface types to make final semicolon optional
SVN=111810
This commit is contained in:
parent
e6626dafa8
commit
2aae3fcbaf
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue