- Sort Score
- Result 10 results
- Languages All
Results 1 - 6 of 6 for CommentedNode (0.42 sec)
-
src/go/format/format.go
// // The node type must be *[ast.File], *[printer.CommentedNode], [][ast.Decl], // [][ast.Stmt], or assignment-compatible to [ast.Expr], [ast.Decl], [ast.Spec], // or [ast.Stmt]. Node does not modify node. Imports are not sorted for // nodes representing partial source files (for instance, if the node is // not an *[ast.File] or a *[printer.CommentedNode] not wrapping an *[ast.File]). //
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 12:02:03 UTC 2023 - 4.3K bytes - Viewed (0) -
src/go/printer/printer.go
if len(n.Comments) > 0 { return n.Comments[len(n.Comments)-1] } } return nil } func (p *printer) printNode(node any) error { // unpack *CommentedNode, if any var comments []*ast.CommentGroup if cnode, ok := node.(*CommentedNode); ok { node = cnode.Node comments = cnode.Comments } if comments != nil { // commented node - restrict comment list to relevant range
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 12:02:03 UTC 2023 - 41.6K bytes - Viewed (0) -
src/go/printer/printer_test.go
t.Fatal(err) } var buf bytes.Buffer err = Fprint(&buf, fset, &CommentedNode{Node: f.Decls[0], Comments: f.Comments}) if err != nil { t.Fatal(err) } if buf.String() != foo { t.Errorf("got %q, want %q", buf.String(), foo) } buf.Reset() err = Fprint(&buf, fset, &CommentedNode{Node: f.Decls[1], Comments: f.Comments}) if err != nil { t.Fatal(err) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jun 03 14:56:25 UTC 2024 - 20.4K bytes - Viewed (0) -
src/cmd/doc/pkg.go
func (pkg *Package) emit(comment string, node ast.Node) { if node != nil { var arg any = node if showSrc { // Need an extra little dance to get internal comments to appear. arg = &printer.CommentedNode{ Node: node, Comments: pkg.file.Comments, } } err := format.Node(&pkg.buf, pkg.fs, arg) if err != nil { log.Fatal(err) } if comment != "" && !showSrc {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jan 08 20:15:52 UTC 2024 - 32K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go
{"SkipObjectResolution", Const, 17}, {"SpuriousErrors", Const, 0}, {"Trace", Const, 0}, }, "go/printer": { {"(*Config).Fprint", Method, 0}, {"CommentedNode", Type, 0}, {"CommentedNode.Comments", Field, 0}, {"CommentedNode.Node", Field, 0}, {"Config", Type, 0}, {"Config.Indent", Field, 1}, {"Config.Mode", Field, 0}, {"Config.Tabwidth", Field, 0}, {"Fprint", Func, 0},
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 534.2K bytes - Viewed (0) -
api/go1.txt
pkg go/printer, method (*Config) Fprint(io.Writer, *token.FileSet, interface{}) error pkg go/printer, type CommentedNode struct pkg go/printer, type CommentedNode struct, Comments []*ast.CommentGroup pkg go/printer, type CommentedNode struct, Node interface{} pkg go/printer, type Config struct pkg go/printer, type Config struct, Mode Mode pkg go/printer, type Config struct, Tabwidth int
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Aug 14 18:58:28 UTC 2013 - 1.7M bytes - Viewed (0)