Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 31 for IndexExpr (0.24 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/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)
  4. 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)
  5. 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)
  6. 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)
  7. src/cmd/compile/internal/walk/expr.go

    		n.X = walkExpr(n.X, init)
    		return n
    
    	case ir.ODIV, ir.OMOD:
    		n := n.(*ir.BinaryExpr)
    		return walkDivMod(n, init)
    
    	case ir.OINDEX:
    		n := n.(*ir.IndexExpr)
    		return walkIndex(n, init)
    
    	case ir.OINDEXMAP:
    		n := n.(*ir.IndexExpr)
    		return walkIndexMap(n, init)
    
    	case ir.ORECV:
    		base.Fatalf("walkExpr ORECV") // should see inside OAS only
    		panic("unreachable")
    
    	case ir.OSLICEHEADER:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 27.6K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/walk/order.go

    		a.X = l
    		return typecheck.Expr(a)
    
    	case ir.OINDEX, ir.OINDEXMAP:
    		n := n.(*ir.IndexExpr)
    		var l ir.Node
    		if n.X.Type().IsArray() {
    			l = o.safeExpr(n.X)
    		} else {
    			l = o.cheapExpr(n.X)
    		}
    		r := o.cheapExpr(n.Index)
    		if l == n.X && r == n.Index {
    			return n
    		}
    		a := ir.Copy(n).(*ir.IndexExpr)
    		a.X = l
    		a.Index = r
    		return typecheck.Expr(a)
    
    	default:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 02:00:33 UTC 2024
    - 42.7K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/walk/assign.go

    		left, right = n.X, n.Y
    	}
    
    	// Recognize m[k] = append(m[k], ...) so we can reuse
    	// the mapassign call.
    	var mapAppend *ir.CallExpr
    	if left.Op() == ir.OINDEXMAP && right.Op() == ir.OAPPEND {
    		left := left.(*ir.IndexExpr)
    		mapAppend = right.(*ir.CallExpr)
    		if !ir.SameSafeExpr(left, mapAppend.Args[0]) {
    			base.Fatalf("not same expressions: %v != %v", left, mapAppend.Args[0])
    		}
    	}
    
    	left = walkExpr(left, init)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:09:06 UTC 2024
    - 20.3K bytes
    - Viewed (0)
  10. src/go/types/exprstring.go

    	case *ast.ParenExpr:
    		buf.WriteByte('(')
    		WriteExpr(buf, x.X)
    		buf.WriteByte(')')
    
    	case *ast.SelectorExpr:
    		WriteExpr(buf, x.X)
    		buf.WriteByte('.')
    		buf.WriteString(x.Sel.Name)
    
    	case *ast.IndexExpr, *ast.IndexListExpr:
    		ix := typeparams.UnpackIndexExpr(x)
    		WriteExpr(buf, ix.X)
    		buf.WriteByte('[')
    		writeExprList(buf, ix.Indices)
    		buf.WriteByte(']')
    
    	case *ast.SliceExpr:
    		WriteExpr(buf, x.X)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 08 19:31:44 UTC 2024
    - 4.8K bytes
    - Viewed (0)
Back to top