Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for FuncLit (0.3 sec)

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

    		(*ast.FuncDecl)(nil),
    		(*ast.FuncLit)(nil),
    		(*ast.GenDecl)(nil),
    		(*ast.RangeStmt)(nil),
    		(*ast.ReturnStmt)(nil),
    	}
    	inspect.Preorder(nodeFilter, func(node ast.Node) {
    		switch node := node.(type) {
    		case *ast.RangeStmt:
    			checkCopyLocksRange(pass, node)
    		case *ast.FuncDecl:
    			checkCopyLocksFunc(pass, node.Name.Name, node.Recv, node.Type)
    		case *ast.FuncLit:
    			checkCopyLocksFunc(pass, "func", nil, node.Type)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/rangefunc/rewrite.go

    	ri := make(map[*syntax.FuncLit]bool)
    	for _, file := range files {
    		syntax.Inspect(file, func(n syntax.Node) bool {
    			switch n := n.(type) {
    			case *syntax.FuncDecl:
    				sig, _ := info.Defs[n.Name].Type().(*types2.Signature)
    				rewriteFunc(pkg, info, n.Type, n.Body, sig, ri)
    				return false
    			case *syntax.FuncLit:
    				sig, _ := info.Types[n].Type.(*types2.Signature)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:05:44 UTC 2024
    - 41.6K bytes
    - Viewed (0)
  3. src/go/ast/ast.go

    		Value    string      // literal string; e.g. 42, 0x7f, 3.14, 1e-9, 2.4i, 'a', '\x7f', "foo" or `\m\n\o`
    	}
    
    	// A FuncLit node represents a function literal.
    	FuncLit struct {
    		Type *FuncType  // function type
    		Body *BlockStmt // function body
    	}
    
    	// A CompositeLit node represents a composite literal.
    	CompositeLit struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 35.6K bytes
    - Viewed (0)
  4. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/loopclosure/loopclosure.go

    }
    
    // litStmts returns all statements from the function body of a function
    // literal.
    //
    // If fun is not a function literal, it returns nil.
    func litStmts(fun ast.Expr) []ast.Stmt {
    	lit, _ := fun.(*ast.FuncLit)
    	if lit == nil {
    		return nil
    	}
    	return lit.Body.List
    }
    
    // goInvoke returns a function expression that would be called asynchronously
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go

    		}
    		if n.Type.Results != nil {
    			children = append(children, n.Type.Results)
    		}
    		if n.Body != nil {
    			children = append(children, n.Body)
    		}
    
    	case *ast.FuncLit:
    		// nop
    
    	case *ast.FuncType:
    		if n.Func != 0 {
    			children = append(children,
    				tok(n.Func, len("func")))
    		}
    
    	case *ast.GenDecl:
    		children = append(children,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 15.9K bytes
    - Viewed (0)
  6. src/cmd/fix/typecheck.go

    	// the curfn stack.
    	var curfn []*ast.FuncType
    
    	before := func(n any) {
    		// push function type on stack
    		switch n := n.(type) {
    		case *ast.FuncDecl:
    			curfn = append(curfn, n.Type)
    		case *ast.FuncLit:
    			curfn = append(curfn, n.Type)
    		}
    	}
    
    	// After is the real type checker.
    	after := func(n any) {
    		if n == nil {
    			return
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 16 22:02:42 UTC 2022
    - 20.1K bytes
    - Viewed (0)
  7. src/go/parser/parser_test.go

    	{name: "go", format: "package main; func main() { «go func() { «» }()» }", parseMultiplier: 2, scope: true},                      // Parser nodes: GoStmt, FuncLit
    	{name: "defer", format: "package main; func main() { «defer func() { «» }()» }", parseMultiplier: 2, scope: true},                // Parser nodes: DeferStmt, FuncLit
    	{name: "select", format: "package main; func main() { «select { default: «» }» }", scope: true},
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 31 20:26:14 UTC 2024
    - 24.6K bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/tests/tests.go

    			return true
    		}
    	}
    	return false
    }
    
    // Validate the arguments of fuzz target.
    func validateFuzzArgs(pass *analysis.Pass, params *types.Tuple, expr ast.Expr) bool {
    	fLit, isFuncLit := expr.(*ast.FuncLit)
    	exprRange := expr
    	ok := true
    	if !isTestingType(params.At(0).Type(), "T") {
    		if isFuncLit {
    			exprRange = fLit.Type.Params.List[0].Type
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 14.4K bytes
    - Viewed (0)
  9. src/cmd/cgo/ast.go

    		for _, field := range n.List {
    			f.walk(field, context, visit)
    		}
    	case *ast.BadExpr:
    	case *ast.Ident:
    	case *ast.Ellipsis:
    		f.walk(&n.Elt, ctxType, visit)
    	case *ast.BasicLit:
    	case *ast.FuncLit:
    		f.walk(n.Type, ctxType, visit)
    		f.walk(n.Body, ctxStmt, visit)
    	case *ast.CompositeLit:
    		f.walk(&n.Type, ctxType, visit)
    		f.walk(n.Elts, ctxExpr, visit)
    	case *ast.ParenExpr:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 07 16:54:27 UTC 2023
    - 14.3K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go

    	case *ast.FieldList:
    		a.applyList(n, "List")
    
    	// Expressions
    	case *ast.BadExpr, *ast.Ident, *ast.BasicLit:
    		// nothing to do
    
    	case *ast.Ellipsis:
    		a.apply(n, "Elt", nil, n.Elt)
    
    	case *ast.FuncLit:
    		a.apply(n, "Type", nil, n.Type)
    		a.apply(n, "Body", nil, n.Body)
    
    	case *ast.CompositeLit:
    		a.apply(n, "Type", nil, n.Type)
    		a.applyList(n, "Elts")
    
    	case *ast.ParenExpr:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 12.2K bytes
    - Viewed (0)
Back to top