Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 43 for callExpr (0.11 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/atomic/atomic.go

    		n := node.(*ast.AssignStmt)
    		if len(n.Lhs) != len(n.Rhs) {
    			return
    		}
    		if len(n.Lhs) == 1 && n.Tok == token.DEFINE {
    			return
    		}
    
    		for i, right := range n.Rhs {
    			call, ok := right.(*ast.CallExpr)
    			if !ok {
    				continue
    			}
    			fn := typeutil.StaticCallee(pass.TypesInfo, call)
    			if analysisutil.IsFunctionNamed(fn, "sync/atomic", "AddInt32", "AddInt64", "AddUint32", "AddUint64", "AddUintptr") {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 2.3K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/syntax/nodes_test.go

    	{"Operation", `a @|| b`},
    	{"Operation", `a @&& b`},
    	{"Operation", `a @== b`},
    	{"Operation", `a @+ b`},
    	{"Operation", `a @* b`},
    
    	{"CallExpr", `f@()`},
    	{"CallExpr", `f@(x, y, z)`},
    	{"CallExpr", `obj.f@(1, 2, 3)`},
    	{"CallExpr", `func(x int) int { return x + 1 }@(y)`},
    
    	// ListExpr: tested via multi-value const/var declarations
    }
    
    var types = []test{
    	{"Operation", `@*T`},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 02 18:45:06 UTC 2023
    - 8.7K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/errorsas/errorsas.go

    		return nil, nil // doesn't directly import errors
    	}
    
    	inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector)
    
    	nodeFilter := []ast.Node{
    		(*ast.CallExpr)(nil),
    	}
    	inspect.Preorder(nodeFilter, func(n ast.Node) {
    		call := n.(*ast.CallExpr)
    		fn := typeutil.StaticCallee(pass.TypesInfo, call)
    		if !analysisutil.IsFunctionNamed(fn, "errors", "As") {
    			return
    		}
    		if len(call.Args) < 2 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 20 21:52:54 UTC 2023
    - 2.9K bytes
    - Viewed (0)
  4. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/slog/slog.go

    	var attrType types.Type // The type of slog.Attr
    	inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector)
    	nodeFilter := []ast.Node{
    		(*ast.CallExpr)(nil),
    	}
    	inspect.Preorder(nodeFilter, func(node ast.Node) {
    		call := node.(*ast.CallExpr)
    		fn := typeutil.StaticCallee(pass.TypesInfo, call)
    		if fn == nil {
    			return // not a static call
    		}
    		if call.Ellipsis != token.NoPos {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  5. src/cmd/fix/cftype.go

    	// (*bad.type)(x) where x is type *unsafe.Pointer -> (*bad.type)(unsafe.Pointer(x))
    	walk(f, func(n any) {
    		if n == nil {
    			return
    		}
    		// Find pattern like (*a.b)(x)
    		c, ok := n.(*ast.CallExpr)
    		if !ok {
    			return
    		}
    		if len(c.Args) != 1 {
    			return
    		}
    		p, ok := c.Fun.(*ast.ParenExpr)
    		if !ok {
    			return
    		}
    		s, ok := p.X.(*ast.StarExpr)
    		if !ok {
    			return
    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/go/types/errorcalls_test.go

    	fset := token.NewFileSet()
    	files, err := pkgFiles(fset, ".")
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	for _, file := range files {
    		ast.Inspect(file, func(n ast.Node) bool {
    			call, _ := n.(*ast.CallExpr)
    			if call == nil {
    				return true
    			}
    			selx, _ := call.Fun.(*ast.SelectorExpr)
    			if selx == nil {
    				return true
    			}
    			if !(isName(selx.X, "check") && isName(selx.Sel, "errorf")) {
    				return true
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 15 21:57:36 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/inline/interleaved/interleaved.go

    		}
    
    		match := func(n ir.Node) bool {
    			switch n := n.(type) {
    			case *ir.CallExpr:
    				return true
    			case *ir.TailCallStmt:
    				n.Call.NoInline = true // can't inline yet
    			}
    			return false
    		}
    
    		edit := func(n ir.Node) ir.Node {
    			call, ok := n.(*ir.CallExpr)
    			if !ok { // previously inlined
    				return nil
    			}
    
    			devirtualize.StaticCall(call)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 27 20:42:52 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/stringintconv/string.go

    	return ""
    }
    
    func run(pass *analysis.Pass) (interface{}, error) {
    	inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector)
    	nodeFilter := []ast.Node{
    		(*ast.CallExpr)(nil),
    	}
    	inspect.Preorder(nodeFilter, func(n ast.Node) {
    		call := n.(*ast.CallExpr)
    
    		if len(call.Args) != 1 {
    			return
    		}
    		arg := call.Args[0]
    
    		// Retrieve target type name.
    		var tname *types.TypeName
    		switch fun := call.Fun.(type) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/defers/defers.go

    }
    
    func run(pass *analysis.Pass) (interface{}, error) {
    	if !analysisutil.Imports(pass.Pkg, "time") {
    		return nil, nil
    	}
    
    	checkDeferCall := func(node ast.Node) bool {
    		switch v := node.(type) {
    		case *ast.CallExpr:
    			if analysisutil.IsFunctionNamed(typeutil.StaticCallee(pass.TypesInfo, v), "time", "Since") {
    				pass.Reportf(v.Pos(), "call to time.Since is not deferred")
    			}
    		case *ast.FuncLit:
    			return false // prune
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  10. src/cmd/gofmt/rewrite.go

    		// match since that is how f(x) and f(x...) are different.
    		// Check them here but fall through for the remaining fields.
    		p := pattern.Interface().(*ast.CallExpr)
    		v := val.Interface().(*ast.CallExpr)
    		if p.Ellipsis.IsValid() != v.Ellipsis.IsValid() {
    			return false
    		}
    	}
    
    	p := reflect.Indirect(pattern)
    	v := reflect.Indirect(val)
    	if !p.IsValid() || !v.IsValid() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 27 22:07:13 UTC 2023
    - 8.1K bytes
    - Viewed (0)
Back to top