Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 122 for Decl (0.04 sec)

  1. src/go/ast/example_test.go

    	//      5  .  }
    	//      6  .  Decls: []ast.Decl (len = 1) {
    	//      7  .  .  0: *ast.FuncDecl {
    	//      8  .  .  .  Name: *ast.Ident {
    	//      9  .  .  .  .  NamePos: 3:6
    	//     10  .  .  .  .  Name: "main"
    	//     11  .  .  .  .  Obj: *ast.Object {
    	//     12  .  .  .  .  .  Kind: func
    	//     13  .  .  .  .  .  Name: "main"
    	//     14  .  .  .  .  .  Decl: *(obj @ 7)
    	//     15  .  .  .  .  }
    	//     16  .  .  .  }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 21:44:50 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  2. src/go/doc/filter.go

    				if matchFields(t.Methods, f) {
    					return true
    				}
    			}
    		}
    	}
    	return false
    }
    
    func filterValues(a []*Value, f Filter) []*Value {
    	w := 0
    	for _, vd := range a {
    		if matchDecl(vd.Decl, f) {
    			a[w] = vd
    			w++
    		}
    	}
    	return a[0:w]
    }
    
    func filterFuncs(a []*Func, f Filter) []*Func {
    	w := 0
    	for _, fd := range a {
    		if f(fd.Name) {
    			a[w] = fd
    			w++
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 01 18:18:07 UTC 2022
    - 2.2K bytes
    - Viewed (0)
  3. src/go/ast/filter.go

    //
    // FilterDecl reports whether there are any declared names left after
    // filtering.
    func FilterDecl(decl Decl, f Filter) bool {
    	return filterDecl(decl, f, false)
    }
    
    func filterDecl(decl Decl, f Filter, export bool) bool {
    	switch d := decl.(type) {
    	case *GenDecl:
    		d.Specs = filterSpecList(d.Specs, f, export)
    		return len(d.Specs) > 0
    	case *FuncDecl:
    		return f(d.Name.Name)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  4. src/go/ast/scope.go

    }
    
    // Pos computes the source position of the declaration of an object name.
    // The result may be an invalid position if it cannot be computed
    // (obj.Decl may be nil or not correct).
    func (obj *Object) Pos() token.Pos {
    	name := obj.Name
    	switch d := obj.Decl.(type) {
    	case *Field:
    		for _, n := range d.Names {
    			if n.Name == name {
    				return n.Pos()
    			}
    		}
    	case *ImportSpec:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  5. src/cmd/cgo/internal/testerrors/argposition_test.go

    				Line:   37,
    				Column: 91,
    			},
    		},
    		"doublePointerChecked": []ShortPosition{
    			ShortPosition{
    				Line:   42,
    				Column: 91,
    			},
    		},
    	}
    	for _, decl := range f.Decls {
    		if fdecl, ok := decl.(*ast.FuncDecl); ok {
    			ast.Walk(&Visitor{expectation, fset, t}, fdecl.Body)
    		}
    	}
    	for ident, positions := range expectation {
    		for _, position := range positions {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 19 01:37:31 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  6. test/codegen/fuse.go

    	// amd64:"CMPQ\t.+, [$]251","ADDQ\t[$]-5,"
    	// s390x:"CLGIJ\t[$]4, R[0-9]+, [$]251","ADD\t[$]-5,"
    	for x := <-c; x < 256 && x > 4; x = <-c {
    	}
    }
    
    func si6c(c <-chan int32) {
    	// amd64:"CMPL\t.+, [$]255","DECL\t"
    	// s390x:"CLIJ\t[$]12, R[0-9]+, [$]255","ADDW\t[$]-1,"
    	for x := <-c; x > 0 && x <= 256; x = <-c {
    	}
    }
    
    func si7c(c <-chan int16) {
    	// amd64:"CMPW\t.+, [$]60","ADDL\t[$]10,"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 03 14:30:26 UTC 2020
    - 4.8K bytes
    - Viewed (0)
  7. src/go/doc/doc_test.go

    		t.Fatal(err)
    	}
    
    	for _, f := range doc.Funcs {
    		f.Decl = nil
    	}
    	for _, ty := range doc.Types {
    		for _, f := range ty.Funcs {
    			f.Decl = nil
    		}
    		for _, m := range ty.Methods {
    			m.Decl = nil
    		}
    	}
    
    	compareFuncs := func(t *testing.T, msg string, got, want *Func) {
    		// ignore Decl and Examples
    		got.Decl = nil
    		got.Examples = nil
    		if !(got.Doc == want.Doc &&
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:31:52 UTC 2022
    - 6.7K bytes
    - Viewed (0)
  8. test/fixedbugs/issue13273.go

    	<-<-chan int // ERROR "unexpected <-, expected chan|expecting {" (new parser: same error as for type decl)
    
    	type _ <-chan<-int // ERROR "unexpected int, expected chan|expected .*chan.*|expected chan|expected .*;.* or .*}.* or newline"
    	<-chan<-int // ERROR "unexpected int, expected chan|expecting {" (new parser: same error as for type decl)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 01 22:37:04 UTC 2022
    - 1.7K bytes
    - Viewed (0)
  9. src/go/doc/testdata/c.go

    // Test that empty declarations don't cause problems
    
    const ()
    
    type ()
    
    var ()
    
    // ----------------------------------------------------------------------------
    // Test that types with documentation on both, the Decl and the Spec node
    // are handled correctly.
    
    // A (should see this)
    type A struct{}
    
    // B (should see this)
    type (
    	B struct{}
    )
    
    type (
    	// C (should see this)
    	C struct{}
    )
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 08 04:08:51 UTC 2014
    - 1.2K bytes
    - Viewed (0)
  10. src/go/ast/commentmap_test.go

    	f, err := parser.ParseFile(fset, "", src, parser.ParseComments)
    	if err != nil {
    		t.Fatal(err)
    	}
    	cmap := NewCommentMap(fset, f, f.Comments)
    
    	// delete variable declaration
    	for i, decl := range f.Decls {
    		if gen, ok := decl.(*GenDecl); ok && gen.Tok == token.VAR {
    			copy(f.Decls[i:], f.Decls[i+1:])
    			f.Decls = f.Decls[:len(f.Decls)-1]
    			break
    		}
    	}
    
    	// check if comments are filtered correctly
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 09 15:35:30 UTC 2022
    - 3.9K bytes
    - Viewed (0)
Back to top