- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for commentMap (0.17 sec)
-
src/go/ast/commentmap.go
slices.SortFunc(list, func(a, b *CommentGroup) int { return cmp.Compare(a.Pos(), b.Pos()) }) } // A CommentMap maps an AST node to a list of comment groups // associated with it. See [NewCommentMap] for a description of // the association. type CommentMap map[Node][]*CommentGroup func (cmap CommentMap) addComment(n Node, c *CommentGroup) { list := cmap[n] if len(list) == 0 { list = []*CommentGroup{c} } else {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 8.9K bytes - Viewed (0) -
src/go/ast/example_test.go
// x // y // int // print // x // y } // This example illustrates how to remove a variable declaration // in a Go program while maintaining correct comment association // using an ast.CommentMap. func ExampleCommentMap() { // src is the input for which we create the AST that we // are going to manipulate. src := ` // This is the package comment. package main
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 15 21:44:50 UTC 2024 - 6.1K bytes - Viewed (0) -
src/cmd/internal/dwarf/putvarabbrevgen_test.go
} // pvacfgbody generates a simplified CFG for a slice of statements, // containing only calls to putattr and the if statements affecting them. func pvacfgbody(t *testing.T, fset *token.FileSet, cm ast.CommentMap, body []ast.Stmt) (start, end *pvacfgnode) { add := func(n *pvacfgnode) { if start == nil || end == nil { start = n end = n } else { end.then = n end = n } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Feb 26 20:45:07 UTC 2024 - 8.9K bytes - Viewed (0) -
src/go/types/check_test.go
conf.Check(pkgName, fset, files, &info) if listErrors { return } // collect expected errors errmap := make(map[string]map[int][]comment) for i, filename := range filenames { if m := commentMap(srcs[i], regexp.MustCompile("^ ERRORx? ")); len(m) > 0 { errmap[filename] = m } } // match against found errors var indices []int // list indices of matching errors, reused for each error
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 22 19:45:33 UTC 2024 - 14.1K bytes - Viewed (0) -
src/cmd/compile/internal/types2/check_test.go
conf.Check(pkgName, files, &info) if listErrors { return } // collect expected errors errmap := make(map[string]map[uint][]syntax.Error) for i, filename := range filenames { if m := syntax.CommentMap(bytes.NewReader(srcs[i]), regexp.MustCompile("^ ERRORx? ")); len(m) > 0 { errmap[filename] = m } } // match against found errors var indices []int // list indices of matching errors, reused for each error
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 22 19:45:33 UTC 2024 - 13.8K bytes - Viewed (0) -
src/go/ast/ast.go
// removed or moved, relevant comments in their vicinity must also be removed // (from the [File.Comments] list) or moved accordingly (by updating their // positions). A [CommentMap] may be used to facilitate some of these operations. // // Whether and how a comment is associated with a node depends on the // interpretation of the syntax tree by the manipulating program: except for Doc
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 28 21:32:41 UTC 2024 - 35.6K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go
{"(*UnaryExpr).End", Method, 0}, {"(*UnaryExpr).Pos", Method, 0}, {"(*ValueSpec).End", Method, 0}, {"(*ValueSpec).Pos", Method, 0}, {"(CommentMap).Comments", Method, 1}, {"(CommentMap).Filter", Method, 1}, {"(CommentMap).String", Method, 1}, {"(CommentMap).Update", Method, 1}, {"(ObjKind).String", Method, 0}, {"ArrayType", Type, 0}, {"ArrayType.Elt", Field, 0}, {"ArrayType.Lbrack", Field, 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)