Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 29 for IndexExpr (0.17 sec)

  1. src/cmd/compile/internal/walk/complit.go

    		rhs.SetBounded(true)
    
    		kidx := ir.NewIndexExpr(base.Pos, vstatk, i)
    		kidx.SetBounded(true)
    
    		// typechecker rewrites OINDEX to OINDEXMAP
    		lhs := typecheck.AssignExpr(ir.NewIndexExpr(base.Pos, m, kidx)).(*ir.IndexExpr)
    		base.AssertfAt(lhs.Op() == ir.OINDEXMAP, lhs.Pos(), "want OINDEXMAP, have %+v", lhs)
    		lhs.RType = n.RType
    
    		zero := ir.NewAssignStmt(base.Pos, i, ir.NewInt(base.Pos, 0))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:03:54 UTC 2023
    - 19.5K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/typecheck/typecheck.go

    		return
    	}
    	if n.Op() == ir.OINDEXMAP {
    		n := n.(*ir.IndexExpr)
    		n.Assigned = true
    		return
    	}
    
    	defer n.SetType(nil)
    
    	switch {
    	case n.Op() == ir.ODOT && n.(*ir.SelectorExpr).X.Op() == ir.OINDEXMAP:
    		base.Errorf("cannot assign to struct field %v in map", n)
    	case (n.Op() == ir.OINDEX && n.(*ir.IndexExpr).X.Type().IsString()) || n.Op() == ir.OSLICESTR:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 20 19:08:34 UTC 2024
    - 30.5K bytes
    - Viewed (0)
  3. src/go/doc/reader.go

    func recvString(recv ast.Expr) string {
    	switch t := recv.(type) {
    	case *ast.Ident:
    		return t.Name
    	case *ast.StarExpr:
    		return "*" + recvString(t.X)
    	case *ast.IndexExpr:
    		// Generic type with one parameter.
    		return fmt.Sprintf("%s[%s]", recvString(t.X), recvParam(t.Index))
    	case *ast.IndexListExpr:
    		// Generic type with multiple parameters.
    		if len(t.Indices) > 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 27.5K bytes
    - Viewed (0)
  4. src/cmd/cgo/ast.go

    		f.walk(&n.Type, ctxType, visit)
    		f.walk(n.Elts, ctxExpr, visit)
    	case *ast.ParenExpr:
    		f.walk(&n.X, context, visit)
    	case *ast.SelectorExpr:
    		f.walk(&n.X, ctxSelector, visit)
    	case *ast.IndexExpr:
    		f.walk(&n.X, ctxExpr, visit)
    		f.walk(&n.Index, ctxExpr, visit)
    	case *ast.SliceExpr:
    		f.walk(&n.X, ctxExpr, visit)
    		if n.Low != nil {
    			f.walk(&n.Low, ctxExpr, visit)
    		}
    		if n.High != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 07 16:54:27 UTC 2023
    - 14.3K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go

    		a.applyList(n, "Elts")
    
    	case *ast.ParenExpr:
    		a.apply(n, "X", nil, n.X)
    
    	case *ast.SelectorExpr:
    		a.apply(n, "X", nil, n.X)
    		a.apply(n, "Sel", nil, n.Sel)
    
    	case *ast.IndexExpr:
    		a.apply(n, "X", nil, n.X)
    		a.apply(n, "Index", nil, n.Index)
    
    	case *ast.IndexListExpr:
    		a.apply(n, "X", nil, n.X)
    		a.applyList(n, "Indices")
    
    	case *ast.SliceExpr:
    		a.apply(n, "X", nil, n.X)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 12.2K bytes
    - Viewed (0)
  6. src/cmd/fix/fix.go

    		walkBeforeAfter(&n.Elts, before, after)
    	case *ast.ParenExpr:
    		walkBeforeAfter(&n.X, before, after)
    	case *ast.SelectorExpr:
    		walkBeforeAfter(&n.X, before, after)
    	case *ast.IndexExpr:
    		walkBeforeAfter(&n.X, before, after)
    		walkBeforeAfter(&n.Index, before, after)
    	case *ast.IndexListExpr:
    		walkBeforeAfter(&n.X, before, after)
    		walkBeforeAfter(&n.Indices, before, after)
    	case *ast.SliceExpr:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 14.6K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/typexpr.go

    			// ignore - error reported before
    		case novalue:
    			check.errorf(&x, NotAType, "%s used as type", &x)
    		default:
    			check.errorf(&x, NotAType, "%s is not a type", &x)
    		}
    
    	case *syntax.IndexExpr:
    		check.verifyVersionf(e, go1_18, "type instantiation")
    		return check.instantiatedType(e.X, syntax.UnpackListExpr(e.Index), def)
    
    	case *syntax.ParenExpr:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.6K bytes
    - Viewed (0)
  8. src/go/parser/resolver.go

    	if ptr, ok := typ.(*ast.StarExpr); ok {
    		typ = ptr.X
    	}
    
    	var declareExprs []ast.Expr // exprs to declare
    	var resolveExprs []ast.Expr // exprs to resolve
    	switch typ := typ.(type) {
    	case *ast.IndexExpr:
    		declareExprs = []ast.Expr{typ.Index}
    		resolveExprs = append(resolveExprs, typ.X)
    	case *ast.IndexListExpr:
    		declareExprs = typ.Indices
    		resolveExprs = append(resolveExprs, typ.X)
    	default:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 02 12:56:53 UTC 2023
    - 15.8K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/walk/range.go

    	}
    
    	stmt1 := loop.Body[0] // only stmt in body
    	if stmt1.Op() != ir.OAS {
    		return nil
    	}
    	stmt := stmt1.(*ir.AssignStmt)
    	if stmt.X.Op() != ir.OINDEX {
    		return nil
    	}
    	lhs := stmt.X.(*ir.IndexExpr)
    	x := lhs.X
    	if a.Type().IsPtr() && a.Type().Elem().IsArray() {
    		if s, ok := x.(*ir.StarExpr); ok && s.Op() == ir.ODEREF {
    			x = s.X
    		}
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 20 14:52:33 UTC 2023
    - 17.6K bytes
    - Viewed (0)
  10. src/cmd/fix/typecheck.go

    				typeof[n] = getType(t)
    			} else {
    				typeof[n] = gofmt(n.Type)
    			}
    
    		case *ast.SliceExpr:
    			// x[i:j] has type of x.
    			typeof[n] = typeof[n.X]
    
    		case *ast.IndexExpr:
    			// x[i] has key type of x's type.
    			t := expand(typeof[n.X])
    			if strings.HasPrefix(t, "[") || strings.HasPrefix(t, "map[") {
    				// Lazy: assume there are no nested [] in the array
    				// length or map key type.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 16 22:02:42 UTC 2022
    - 20.1K bytes
    - Viewed (0)
Back to top