Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 56 for IndexExpr (0.21 sec)

  1. src/go/internal/typeparams/typeparams.go

    }
    
    func (x *IndexExpr) Pos() token.Pos {
    	return x.Orig.Pos()
    }
    
    func UnpackIndexExpr(n ast.Node) *IndexExpr {
    	switch e := n.(type) {
    	case *ast.IndexExpr:
    		return &IndexExpr{
    			Orig:    e,
    			X:       e.X,
    			Lbrack:  e.Lbrack,
    			Indices: []ast.Expr{e.Index},
    			Rbrack:  e.Rbrack,
    		}
    	case *ast.IndexListExpr:
    		return &IndexExpr{
    			Orig:    e,
    			X:       e.X,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 16:17:05 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/tools/internal/typeparams/common.go

    	switch e := n.(type) {
    	case *ast.IndexExpr:
    		return e.X, e.Lbrack, []ast.Expr{e.Index}, e.Rbrack
    	case *ast.IndexListExpr:
    		return e.X, e.Lbrack, e.Indices, e.Rbrack
    	}
    	return nil, token.NoPos, nil, token.NoPos
    }
    
    // PackIndexExpr returns an *ast.IndexExpr or *ast.IndexListExpr, depending on
    // the cardinality of indices. Calling PackIndexExpr with len(indices) == 0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/go/types/typeutil/callee.go

    	fun := astutil.Unparen(call.Fun)
    
    	// Look through type instantiation if necessary.
    	isInstance := false
    	switch fun.(type) {
    	case *ast.IndexExpr, *ast.IndexListExpr:
    		// When extracting the callee from an *IndexExpr, we need to check that
    		// it is a *types.Func and not a *types.Var.
    		// Example: Don't match a slice m within the expression `m[0]()`.
    		isInstance = true
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  4. src/go/types/index.go

    	"go/internal/typeparams"
    	. "internal/types/errors"
    )
    
    // If e is a valid function instantiation, indexExpr returns true.
    // In that case x represents the uninstantiated function value and
    // it is the caller's responsibility to instantiate the function.
    func (check *Checker) indexExpr(x *operand, e *typeparams.IndexExpr) (isFuncInst bool) {
    	check.exprOrType(x, e.X, true)
    	// x may be generic
    
    	switch x.mode {
    	case invalid:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 16:17:05 UTC 2024
    - 11.2K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/syntax/nodes.go

    	//    in the source.
    	// 2) The position of a node representing a non-terminal production
    	//    (IndexExpr, IfStmt, etc.) is the position of a token uniquely
    	//    associated with that production; usually the left-most one
    	//    ('[' for IndexExpr, 'if' for IfStmt, etc.)
    	Pos() Pos
    	SetPos(Pos)
    	aNode()
    }
    
    type node struct {
    	// commented out for now since not yet used
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 20 14:52:38 UTC 2023
    - 9K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types2/call.go

    	return inst
    }
    
    func (check *Checker) callExpr(x *operand, call *syntax.CallExpr) exprKind {
    	var inst *syntax.IndexExpr // function instantiation, if any
    	if iexpr, _ := call.Fun.(*syntax.IndexExpr); iexpr != nil {
    		if check.indexExpr(x, iexpr) {
    			// Delay function instantiation to argument checking,
    			// where we combine type and value arguments for type
    			// inference.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 31.5K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/index.go

    	"go/constant"
    	. "internal/types/errors"
    )
    
    // If e is a valid function instantiation, indexExpr returns true.
    // In that case x represents the uninstantiated function value and
    // it is the caller's responsibility to instantiate the function.
    func (check *Checker) indexExpr(x *operand, e *syntax.IndexExpr) (isFuncInst bool) {
    	check.exprOrType(x, e.X, true)
    	// x may be generic
    
    	switch x.mode {
    	case invalid:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 15 16:16:58 UTC 2023
    - 11.5K bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/testinggoroutine/util.go

    	}
    	for _, n := range names {
    		if f.Name() == n {
    			return true
    		}
    	}
    	return false
    }
    
    func funcIdent(fun ast.Expr) *ast.Ident {
    	switch fun := astutil.Unparen(fun).(type) {
    	case *ast.IndexExpr, *ast.IndexListExpr:
    		x, _, _, _ := typeparams.UnpackIndexExpr(fun) // necessary?
    		id, _ := x.(*ast.Ident)
    		return id
    	case *ast.Ident:
    		return fun
    	default:
    		return nil
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/assign/assign.go

    					},
    				})
    			}
    		}
    	})
    
    	return nil, nil
    }
    
    // isMapIndex returns true if e is a map index expression.
    func isMapIndex(info *types.Info, e ast.Expr) bool {
    	if idx, ok := astutil.Unparen(e).(*ast.IndexExpr); ok {
    		if typ := info.Types[idx.X].Type; typ != nil {
    			_, ok := typ.Underlying().(*types.Map)
    			return ok
    		}
    	}
    	return false
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 2.4K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/syntax/positions.go

    			if n.Type != nil {
    				m = n.Type
    				continue
    			}
    			return n.Pos()
    		case *KeyValueExpr:
    			m = n.Key
    		// case *FuncLit:
    		// case *ParenExpr:
    		case *SelectorExpr:
    			m = n.X
    		case *IndexExpr:
    			m = n.X
    		// case *SliceExpr:
    		case *AssertExpr:
    			m = n.X
    		case *TypeSwitchGuard:
    			if n.Lhs != nil {
    				m = n.Lhs
    				continue
    			}
    			m = n.X
    		case *Operation:
    			if n.Y != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 17:49:19 UTC 2024
    - 6.5K bytes
    - Viewed (0)
Back to top