diff options
author | Robert Griesemer <gri@golang.org> | 2010-12-07 13:44:01 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2010-12-07 13:44:01 -0800 |
commit | ce89f213a822b7a6277282ae2feb9ce9dda96a1b (patch) | |
tree | 8f265a70d379565b00d4491421e549331d6646ab | |
parent | 1ce6245d6cc313daba1a4d7b5b349328e18bba6b (diff) | |
download | go-ce89f213a822b7a6277282ae2feb9ce9dda96a1b.tar.gz go-ce89f213a822b7a6277282ae2feb9ce9dda96a1b.zip |
go/parser: Better comment for ParseFile.
The name ParseFile was kept as it indicates that
this function parses a Go 'SourceFile' per the
Go spec. Similarly, the other functions (ParseExpr,
ParseStmtList, ParseDeclList) parse the corresponding
constructs as defined in the Go spec.
Fixes #1311.
R=r, rsc
CC=golang-dev
https://golang.org/cl/3453042
-rw-r--r-- | src/pkg/go/parser/interface.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/pkg/go/parser/interface.go b/src/pkg/go/parser/interface.go index 916efc6c1b..f14e4ac757 100644 --- a/src/pkg/go/parser/interface.go +++ b/src/pkg/go/parser/interface.go @@ -111,14 +111,13 @@ func ParseDeclList(fset *token.FileSet, filename string, src interface{}) ([]ast } -// TODO(gri) Change ParseFile to Parse and improve documentation (issue 1311). - -// ParseFile parses a Go source file and returns a File node. +// ParseFile parses the source code of a single Go source file and returns +// the corresponding ast.File node. The source code may be provided via +// the filename of the source file, or via the src parameter. // -// If src != nil, ParseFile parses the file source from src. src may -// be provided in a variety of formats. At the moment the following types -// are supported: string, []byte, and io.Reader. In this case, filename is -// only used for source position information and error messages. +// If src != nil, ParseFile parses the source from src and the filename is +// only used when recording position information. The type of the argument +// for the src parameter must be string, []byte, or io.Reader. // // If src == nil, ParseFile parses the file specified by filename. // |