diff options
author | Robert Griesemer <gri@golang.org> | 2018-02-14 16:59:36 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2018-02-15 01:48:21 +0000 |
commit | eda39fe9b2bdae054a6d0b93efb9b40cc9d24391 (patch) | |
tree | d5f20329ea31440dd98871d6cab46d8e89e41c72 /src/cmd/compile/internal/syntax/nodes.go | |
parent | 1a2273874953517cc38f7005e985c91d16ebf33c (diff) | |
download | go-eda39fe9b2bdae054a6d0b93efb9b40cc9d24391.tar.gz go-eda39fe9b2bdae054a6d0b93efb9b40cc9d24391.zip |
cmd/compile/internal/syntax: fix syntax.Parse doc string, improved tests
1) Fix the doc string for syntax.Parse: The returned AST is
always nil if there was an error and an error handler is missing.
2) Adjust the syntax Print and Dump tests such that they print and
dump the AST even in the presence of errors.
Change-Id: If658eabdcc83f578d815070bc65d1a5f6cfaddfc
Reviewed-on: https://go-review.googlesource.com/94157
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/syntax/nodes.go')
-rw-r--r-- | src/cmd/compile/internal/syntax/nodes.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/syntax/nodes.go b/src/cmd/compile/internal/syntax/nodes.go index 7ab6df13c4..d7183bd8fb 100644 --- a/src/cmd/compile/internal/syntax/nodes.go +++ b/src/cmd/compile/internal/syntax/nodes.go @@ -215,8 +215,8 @@ type ( // Fun(ArgList[0], ArgList[1], ...) CallExpr struct { Fun Expr - ArgList []Expr - HasDots bool // last argument is followed by ... + ArgList []Expr // nil means no arguments + HasDots bool // last argument is followed by ... expr } |