mirror of
https://github.com/golang/go
synced 2024-11-05 20:26:13 -07:00
12cf2ff00b
- convert all formatters that require a *token.FileSet to consistenly use a *PageInfo as first argument instead - adjust templates correspondingly - fix outstanding bug from previous CL 8005044 Going forward, with this change the affected functions have access to the full page "context" (PageInfo), not just the respective file set. This will permit better context-dependent formatting in the future. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/7860049
82 lines
1.8 KiB
Plaintext
82 lines
1.8 KiB
Plaintext
{{with .PAst}}{{node $ .}}{{end}}{{/*
|
|
|
|
---------------------------------------
|
|
|
|
*/}}{{with .PDoc}}{{if $.IsMain}}COMMAND DOCUMENTATION
|
|
|
|
{{comment_text .Doc " " "\t"}}
|
|
{{else}}PACKAGE DOCUMENTATION
|
|
|
|
package {{.Name}}
|
|
import "{{.ImportPath}}"
|
|
|
|
{{comment_text .Doc " " "\t"}}
|
|
{{example_text $ "" " "}}{{/*
|
|
|
|
---------------------------------------
|
|
|
|
*/}}{{with .Consts}}
|
|
CONSTANTS
|
|
|
|
{{range .}}{{node $ .Decl}}
|
|
{{comment_text .Doc " " "\t"}}{{end}}
|
|
{{end}}{{/*
|
|
|
|
---------------------------------------
|
|
|
|
*/}}{{with .Vars}}
|
|
VARIABLES
|
|
|
|
{{range .}}{{node $ .Decl}}
|
|
{{comment_text .Doc " " "\t"}}{{end}}
|
|
{{end}}{{/*
|
|
|
|
---------------------------------------
|
|
|
|
*/}}{{with .Funcs}}
|
|
FUNCTIONS
|
|
|
|
{{range .}}{{node $ .Decl}}
|
|
{{comment_text .Doc " " "\t"}}
|
|
{{example_text $ .Name " "}}
|
|
{{end}}{{end}}{{/*
|
|
|
|
---------------------------------------
|
|
|
|
*/}}{{with .Types}}
|
|
TYPES
|
|
|
|
{{range .}}{{$tname := .Name}}{{node $ .Decl}}
|
|
{{comment_text .Doc " " "\t"}}
|
|
{{range .Consts}}{{node $ .Decl}}
|
|
{{comment_text .Doc " " "\t"}}
|
|
{{end}}{{range .Vars}}{{node $ .Decl}}
|
|
{{comment_text .Doc " " "\t"}}
|
|
{{end}}{{example_text $ .Name " "}}
|
|
{{range .Funcs}}{{node $ .Decl}}
|
|
{{comment_text .Doc " " "\t"}}
|
|
{{example_text $ .Name " "}}
|
|
{{end}}{{range .Methods}}{{node $ .Decl}}
|
|
{{comment_text .Doc " " "\t"}}
|
|
{{$name := printf "%s_%s" $tname .Name}}{{example_text $ $name " "}}
|
|
{{end}}{{end}}{{end}}{{end}}{{/*
|
|
|
|
---------------------------------------
|
|
|
|
*/}}{{with $.Notes}}
|
|
{{range $marker, $content := .}}
|
|
{{$marker}}S
|
|
|
|
{{range $content}}{{comment_text .Body " " "\t"}}
|
|
{{end}}{{end}}{{end}}{{end}}{{/*
|
|
|
|
---------------------------------------
|
|
|
|
*/}}{{with .Dirs}}
|
|
SUBDIRECTORIES
|
|
{{if $.DirFlat}}{{range .List}}{{if .HasPkg}}
|
|
{{.Path}}{{end}}{{end}}
|
|
{{else}}{{range .List}}
|
|
{{repeat `. ` .Depth}}{{.Name}}{{end}}
|
|
{{end}}{{end}}
|