1
0
mirror of https://github.com/golang/go synced 2024-09-30 17:28:32 -06:00

cmd/compile/internal/syntax: print position info for names in tree dump

Debugging support.

Change-Id: Ia518aaed36eaba76e6233306f718ad8aff3ce744
Reviewed-on: https://go-review.googlesource.com/37875
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Robert Griesemer 2017-03-06 15:30:32 -08:00
parent 1874d4a883
commit d10b50dc34

View File

@ -119,7 +119,7 @@ func (p *dumper) dump(x reflect.Value, n Node) {
// special cases for identifiers w/o attached comments (common case)
if x, ok := x.Interface().(*Name); ok {
p.printf(x.Value)
p.printf("%s @ %v", x.Value, x.Pos())
return
}