[tools] go/types/internal/play: show AST debug representation too

0 views
Skip to first unread message

Alan Donovan (Gerrit)

unread,
Mar 28, 2023, 8:37:07 PM3/28/23
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, kokoro, Gopher Robot, Robert Findley, golang-co...@googlegroups.com

Alan Donovan submitted this change.

View Change

Approvals: Robert Findley: Looks good to me, approved; Run TryBots Gopher Robot: TryBots succeeded kokoro: gopls CI succeeded
go/types/internal/play: show AST debug representation too

Change-Id: Id3109a9dd058c08156b120471f59df34703aeecb
Reviewed-on: https://go-review.googlesource.com/c/tools/+/479975
Run-TryBot: Robert Findley <rfin...@google.com>
gopls-CI: kokoro <noreply...@google.com>
Reviewed-by: Robert Findley <rfin...@google.com>
TryBot-Result: Gopher Robot <go...@golang.org>
---
M go/types/internal/play/play.go
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/go/types/internal/play/play.go b/go/types/internal/play/play.go
index 8be804b4..e53d988 100644
--- a/go/types/internal/play/play.go
+++ b/go/types/internal/play/play.go
@@ -165,6 +165,9 @@
}
fmt.Fprintf(out, "\n")

+ // Syntax debug output.
+ ast.Fprint(out, fset, path[0], nil) // ignore errors
+
// Clean up the messy temp file name.
outStr := strings.ReplaceAll(out.String(), f.Name(), "play.go")


To view, visit change 479975. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: tools
Gerrit-Branch: master
Gerrit-Change-Id: Id3109a9dd058c08156b120471f59df34703aeecb
Gerrit-Change-Number: 479975
Gerrit-PatchSet: 2
Gerrit-Owner: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Robert Findley <rfin...@google.com>
Gerrit-Reviewer: kokoro <noreply...@google.com>
Gerrit-MessageType: merged
Reply all
Reply to author
Forward
0 new messages