]> Cypherpunks repositories - gostls13.git/commit
go/types: fix scope printing (debugging support)
authorRobert Griesemer <gri@golang.org>
Wed, 12 Sep 2018 23:45:10 +0000 (16:45 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 13 Sep 2018 18:23:02 +0000 (18:23 +0000)
commit8e2333b2825d6a58d98845b448d03545e10de43d
tree8eb698f2133600c28b0c916feae98e70fc8e6954
parent0ef42f4dd6b12821641fe415f16e425bb094137b
go/types: fix scope printing (debugging support)

Printing of scopes was horribly wrong: If a scope contained
no object declarations, it would abort printing even if the
scope had children scopes. Also, the line breaks were not
inserted consistently. The actual test case (ExampleScope)
was incorrect as well.

Fixed and simplified printing, and adjusted example which
tests the printing output.

Change-Id: If21c1d4ad71b15a517d4a54da16de5e6228eb4b5
Reviewed-on: https://go-review.googlesource.com/135115
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
src/go/types/example_test.go
src/go/types/scope.go