]> Cypherpunks repositories - gostls13.git/commit
go/printer: remove notion of "Styler", remove HTML mode
authorRobert Griesemer <gri@golang.org>
Wed, 9 Feb 2011 17:52:32 +0000 (09:52 -0800)
committerRobert Griesemer <gri@golang.org>
Wed, 9 Feb 2011 17:52:32 +0000 (09:52 -0800)
commitd916cca327ce6df869746a6e3ed5f574a8e308bd
tree9d0b0713a30a2b6ccea295919f36a45a1bd2e536
parent531fb5413e69b2f1ffcbe57cfa790f85d85b49e6
go/printer: remove notion of "Styler", remove HTML mode

Neither gofmt nor godoc are making use of a Styler (for
token-specific formatting) anymore. Stylers interacted in complicated
ways with HTML-escaping which was why the printer needed an HTML mode
in the first place.

godoc now uses a more powerful and general text formatting
function that does HTML escaping, text selection, and can
handle token-specific formatting if so desired (currently
used only for comments).

As a consequence, cleaned up uses of go/printer in godoc;
simplified the various write utility functions, and also
removed the need for the "html" template format (in favor of
html-esc which now does the same and is used more pervasively).

Applied gofmt -w src misc to verify no changes occured,
and tested godoc manually.

There should be no visible changes except that (type) code
snippets presented for godoc package documentation now
uses the same formatting as for general source code and
thus comments get the comment-specific color here as well
(not the case at the moment).

(TODO: godoc needs a good automatic test suite).

R=rsc
CC=golang-dev
https://golang.org/cl/4152042
lib/godoc/package.html
src/cmd/godoc/format.go
src/cmd/godoc/godoc.go
src/cmd/godoc/main.go
src/cmd/godoc/snippet.go
src/cmd/gofmt/gofmt.go
src/pkg/go/printer/printer.go