Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 105 for SelectorExpr (0.18 sec)

  1. src/go/types/generate_test.go

    				panic("invalid import path")
    			}
    			m.rename(&n.Path.Value)
    			return false
    		case *ast.SelectorExpr:
    			// rewrite syntax.Pos to token.Pos
    			m.renameSel(n)
    		case *ast.CallExpr:
    			// rewrite x.IsKnown() to x.IsValid()
    			if fun, _ := n.Fun.(*ast.SelectorExpr); fun != nil && len(n.Args) == 0 {
    				m.rename(&fun.Sel.Name)
    				return false
    			}
    		}
    		return true
    	})
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 16.5K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/sigchanyzer/sigchanyzer.go

    		obj := info.ObjectOf(id)
    		return obj.Name() == "Notify" && obj.Pkg().Path() == "os/signal"
    	}
    	switch fun := call.Fun.(type) {
    	case *ast.SelectorExpr:
    		return check(fun.Sel)
    	case *ast.Ident:
    		if fun, ok := findDecl(fun).(*ast.SelectorExpr); ok {
    			return check(fun.Sel)
    		}
    		return false
    	default:
    		return false
    	}
    }
    
    func findDecl(arg *ast.Ident) ast.Node {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 09 01:28:01 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  3. src/cmd/fix/netipv6zone.go

    	if !imports(f, "net") {
    		return false
    	}
    
    	fixed := false
    	walk(f, func(n any) {
    		cl, ok := n.(*ast.CompositeLit)
    		if !ok {
    			return
    		}
    		se, ok := cl.Type.(*ast.SelectorExpr)
    		if !ok {
    			return
    		}
    		if !isTopName(se.X, "net") || se.Sel == nil {
    			return
    		}
    		switch ss := se.Sel.String(); ss {
    		case "IPAddr", "UDPAddr", "TCPAddr":
    			for i, e := range cl.Elts {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 1.3K bytes
    - Viewed (0)
  4. src/go/parser/testdata/resolution/resolution.src

    // license that can be found in the LICENSE file.
    
    package resolution
    
    func f /* =@fdecl */(n /* =@narg */ ast.Node) bool {
    		if n /* =@ninit */, ok /* =@ok */ := n /* @narg */ .(*ast.SelectorExpr); ok /* @ok */ {
    			sel = n /* @ninit */
    	}
    }
    
    type c /* =@cdecl */ map[token.Pos]resolvedObj
    
    func (v /* =@vdecl */ c /* @cdecl */) Visit(node /* =@nodearg */ ast.Node) (w /* =@w */ ast.Visitor) {}
    
    const (
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 16 21:19:23 UTC 2021
    - 1.5K bytes
    - Viewed (0)
  5. src/cmd/fix/cftype.go

    		}
    		if len(c.Args) != 1 {
    			return
    		}
    		p, ok := c.Fun.(*ast.ParenExpr)
    		if !ok {
    			return
    		}
    		s, ok := p.X.(*ast.StarExpr)
    		if !ok {
    			return
    		}
    		t, ok := s.X.(*ast.SelectorExpr)
    		if !ok {
    			return
    		}
    		pkg, ok := t.X.(*ast.Ident)
    		if !ok {
    			return
    		}
    		dst := pkg.Name + "." + t.Sel.Name
    		src := typeof[c.Args[0]]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 07 00:25:49 UTC 2023
    - 3.5K bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go

    	cancelvars := make(map[*types.Var]ast.Node)
    
    	// TODO(adonovan): opt: refactor to make a single pass
    	// over the AST using inspect.WithStack and node types
    	// {FuncDecl,FuncLit,CallExpr,SelectorExpr}.
    
    	// Find the set of cancel vars to analyze.
    	stack := make([]ast.Node, 0, 32)
    	ast.Inspect(node, func(n ast.Node) bool {
    		switch n.(type) {
    		case *ast.FuncLit:
    			if len(stack) > 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 19:00:13 UTC 2024
    - 9K bytes
    - Viewed (0)
  7. src/cmd/cgo/ast.go

    	switch x := x.(type) {
    	case *ast.Expr:
    		switch (*x).(type) {
    		case *ast.SelectorExpr:
    			f.saveRef(x, context)
    		}
    	case *ast.CallExpr:
    		f.saveCall(x, context)
    	}
    }
    
    // Save references to C.xxx for later processing.
    func (f *File) saveRef(n *ast.Expr, context astContext) {
    	sel := (*n).(*ast.SelectorExpr)
    	// For now, assume that the only instance of capital C is when
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 07 16:54:27 UTC 2023
    - 14.3K bytes
    - Viewed (0)
  8. src/cmd/fix/printerconfig.go

    	if !imports(f, "go/printer") {
    		return false
    	}
    
    	fixed := false
    	walk(f, func(n any) {
    		cl, ok := n.(*ast.CompositeLit)
    		if !ok {
    			return
    		}
    		se, ok := cl.Type.(*ast.SelectorExpr)
    		if !ok {
    			return
    		}
    		if !isTopName(se.X, "printer") || se.Sel == nil {
    			return
    		}
    
    		if ss := se.Sel.String(); ss == "Config" {
    			for i, e := range cl.Elts {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 1.1K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unsafeptr/unsafeptr.go

    func isSafeUintptr(info *types.Info, x ast.Expr) bool {
    	// Check unsafe.Pointer safety rules according to
    	// https://golang.org/pkg/unsafe/#Pointer.
    
    	switch x := astutil.Unparen(x).(type) {
    	case *ast.SelectorExpr:
    		// "(6) Conversion of a reflect.SliceHeader or
    		// reflect.StringHeader Data field to or from Pointer."
    		if x.Sel.Name != "Data" {
    			break
    		}
    		// reflect.SliceHeader and reflect.StringHeader are okay,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/tools/go/types/typeutil/callee.go

    		fun, _, _, _ = typeparams.UnpackIndexExpr(fun)
    	}
    
    	var obj types.Object
    	switch fun := fun.(type) {
    	case *ast.Ident:
    		obj = info.Uses[fun] // type, var, builtin, or declared func
    	case *ast.SelectorExpr:
    		if sel, ok := info.Selections[fun]; ok {
    			obj = sel.Obj() // method or field
    		} else {
    			obj = info.Uses[fun.Sel] // qualified identifier?
    		}
    	}
    	if _, ok := obj.(*types.TypeName); ok {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 2.1K bytes
    - Viewed (0)
Back to top