diff options
author | Robert Griesemer <gri@golang.org> | 2015-06-18 11:55:19 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2015-06-18 20:31:26 +0000 |
commit | 2e7831a1d192ef0cbcb0caf9331b6cf3fa05e3d3 (patch) | |
tree | 32d1a1efbdf7690376a74c2cad3ba8520db960c2 /src/go/parser/parser.go | |
parent | 32f2f72c4716debf658eaec1c400a35b2de7d51d (diff) | |
download | go-2e7831a1d192ef0cbcb0caf9331b6cf3fa05e3d3.tar.gz go-2e7831a1d192ef0cbcb0caf9331b6cf3fa05e3d3.zip |
go/parser: document that parser accepts a wider language than specified
See also issue #11271.
Change-Id: I34175f46ce137b14ca483500f673b0f8ee1f2108
Reviewed-on: https://go-review.googlesource.com/11262
Reviewed-by: Alan Donovan <adonovan@google.com>
Diffstat (limited to 'src/go/parser/parser.go')
-rw-r--r-- | src/go/parser/parser.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/go/parser/parser.go b/src/go/parser/parser.go index 18278ba4b7..e82c0bd122 100644 --- a/src/go/parser/parser.go +++ b/src/go/parser/parser.go @@ -7,6 +7,13 @@ // output is an abstract syntax tree (AST) representing the Go source. The // parser is invoked through one of the Parse* functions. // +// The parser accepts a larger language than is syntactically permitted by +// the Go spec, for simplicity, and for improved robustness in the presence +// of syntax errors. For instance, in method declarations, the receiver is +// treated like an ordinary parameter list and thus may contain multiple +// entries where the spec permits exactly one. Consequently, the corresponding +// field in the AST (ast.FuncDecl.Recv) field is not restricted to one entry. +// package parser import ( |