Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for NewCommentMap (0.54 sec)

  1. src/go/ast/commentmap.go

    //     via the previous rules
    //
    // NewCommentMap tries to associate a comment group to the "largest"
    // node possible: For instance, if the comment is a line comment
    // trailing an assignment, the comment is associated with the entire
    // assignment rather than just the last operand in the assignment.
    func NewCommentMap(fset *token.FileSet, node Node, comments []*CommentGroup) CommentMap {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  2. src/go/ast/example_test.go

    	if err != nil {
    		panic(err)
    	}
    
    	// Create an ast.CommentMap from the ast.File's comments.
    	// This helps keeping the association between comments
    	// and AST nodes.
    	cmap := ast.NewCommentMap(fset, f, f.Comments)
    
    	// Remove the first variable declaration from the list of declarations.
    	for i, decl := range f.Decls {
    		if gen, ok := decl.(*ast.GenDecl); ok && gen.Tok == token.VAR {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 21:44:50 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  3. src/cmd/internal/dwarf/putvarabbrevgen_test.go

    	}
    
    }
    
    func pvagenerate(t *testing.T) string {
    	var fset token.FileSet
    	f, err := parser.ParseFile(&fset, "./dwarf.go", nil, parser.ParseComments)
    	if err != nil {
    		t.Fatal(err)
    	}
    	cm := ast.NewCommentMap(&fset, f, f.Comments)
    	abbrevs := make(map[string]int)
    	funcs := map[string]ast.Stmt{}
    	for _, decl := range f.Decls {
    		decl, ok := decl.(*ast.FuncDecl)
    		if !ok || decl.Body == nil {
    			continue
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 20:45:07 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  4. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"Lbl", Const, 0},
    		{"MapType", Type, 0},
    		{"MapType.Key", Field, 0},
    		{"MapType.Map", Field, 0},
    		{"MapType.Value", Field, 0},
    		{"MergeMode", Type, 0},
    		{"MergePackageFiles", Func, 0},
    		{"NewCommentMap", Func, 1},
    		{"NewIdent", Func, 0},
    		{"NewObj", Func, 0},
    		{"NewPackage", Func, 0},
    		{"NewScope", Func, 0},
    		{"Node", Type, 0},
    		{"NotNilFilter", Func, 0},
    		{"ObjKind", Type, 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)
Back to top