diff options
author | Robert Griesemer <gri@golang.org> | 2021-01-07 12:57:15 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2021-01-08 17:32:14 +0000 |
commit | 934f9dc0efbae667c445684915676323b98b34d0 (patch) | |
tree | 1c4af8dff3303dc337466dedad8a45f41a647191 /src/cmd/compile/internal/syntax/parser_test.go | |
parent | 5b9152de579a75962a48d5380abcc2d4deedbf28 (diff) | |
download | go-934f9dc0efbae667c445684915676323b98b34d0.tar.gz go-934f9dc0efbae667c445684915676323b98b34d0.zip |
[dev.typeparams] cmd/compile/internal/syntax: clean up node printing API
Preparation for using the syntax printer as expression printer in types2.
- Introduced Form to control printing format
- Cleaned up/added String and ShortString convenience functions
- Implemented ShortForm format which prints … for non-empty
function and composite literal bodies
- Added test to check write error handling
Change-Id: Ie86e46d766fb60fcf07ef643c7788b2ef440ffa8
Reviewed-on: https://go-review.googlesource.com/c/go/+/282552
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/syntax/parser_test.go')
-rw-r--r-- | src/cmd/compile/internal/syntax/parser_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/syntax/parser_test.go b/src/cmd/compile/internal/syntax/parser_test.go index ea9e9acc83..340ca6bb6f 100644 --- a/src/cmd/compile/internal/syntax/parser_test.go +++ b/src/cmd/compile/internal/syntax/parser_test.go @@ -169,7 +169,7 @@ func walkDirs(t *testing.T, dir string, action func(string)) { func verifyPrint(t *testing.T, filename string, ast1 *File) { var buf1 bytes.Buffer - _, err := Fprint(&buf1, ast1, true) + _, err := Fprint(&buf1, ast1, LineForm) if err != nil { panic(err) } @@ -181,7 +181,7 @@ func verifyPrint(t *testing.T, filename string, ast1 *File) { } var buf2 bytes.Buffer - _, err = Fprint(&buf2, ast2, true) + _, err = Fprint(&buf2, ast2, LineForm) if err != nil { panic(err) } |