]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile/internal/syntax: clean up node printing API
authorRobert Griesemer <gri@golang.org>
Thu, 7 Jan 2021 20:57:15 +0000 (12:57 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 8 Jan 2021 17:32:14 +0000 (17:32 +0000)
commit934f9dc0efbae667c445684915676323b98b34d0
tree1c4af8dff3303dc337466dedad8a45f41a647191
parent5b9152de579a75962a48d5380abcc2d4deedbf28
[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>
src/cmd/compile/internal/syntax/dumper.go
src/cmd/compile/internal/syntax/parser_test.go
src/cmd/compile/internal/syntax/printer.go
src/cmd/compile/internal/syntax/printer_test.go