Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 50 for indexExpr (0.19 sec)

  1. src/cmd/compile/internal/syntax/parser.go

    					i = p.badExpr()
    				} else {
    					i, comma = p.typeList(false)
    				}
    				if comma || p.tok == _Rbrack {
    					p.want(_Rbrack)
    					// x[], x[i,] or x[i, j, ...]
    					t := new(IndexExpr)
    					t.pos = pos
    					t.X = x
    					t.Index = i
    					x = t
    					break
    				}
    			}
    
    			// x[i:...
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 62.9K bytes
    - Viewed (0)
  2. src/go/types/struct.go

    		return e
    	case *ast.StarExpr:
    		// *T is valid, but **T is not
    		if _, ok := e.X.(*ast.StarExpr); !ok {
    			return embeddedFieldIdent(e.X)
    		}
    	case *ast.SelectorExpr:
    		return e.Sel
    	case *ast.IndexExpr:
    		return embeddedFieldIdent(e.X)
    	case *ast.IndexListExpr:
    		return embeddedFieldIdent(e.X)
    	}
    	return nil // invalid embedded field
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 29 22:06:18 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  3. src/go/ast/walk.go

    	case *CompositeLit:
    		if n.Type != nil {
    			Walk(v, n.Type)
    		}
    		walkList(v, n.Elts)
    
    	case *ParenExpr:
    		Walk(v, n.X)
    
    	case *SelectorExpr:
    		Walk(v, n.X)
    		Walk(v, n.Sel)
    
    	case *IndexExpr:
    		Walk(v, n.X)
    		Walk(v, n.Index)
    
    	case *IndexListExpr:
    		Walk(v, n.X)
    		walkList(v, n.Indices)
    
    	case *SliceExpr:
    		Walk(v, n.X)
    		if n.Low != nil {
    			Walk(v, n.Low)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:34:10 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/reflectdata/helpers.go

    }
    
    // IndexMapRType asserts that n is a map index operation, and returns
    // an expression that yields the *runtime._type value representing the
    // map type.
    func IndexMapRType(pos src.XPos, n *ir.IndexExpr) ir.Node {
    	assertOp(n, ir.OINDEXMAP)
    	if hasRType(n, n.RType, "RType") {
    		return n.RType
    	}
    	return mapRType(pos, n.X.Type())
    }
    
    // MakeChanRType asserts that n is a "make" operation for a channel
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 04:50:32 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  5. src/go/types/typexpr.go

    		case invalid:
    			// 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 *ast.IndexExpr, *ast.IndexListExpr:
    		ix := typeparams.UnpackIndexExpr(e)
    		check.verifyVersionf(inNode(e, ix.Lbrack), go1_18, "type instantiation")
    		return check.instantiatedType(ix, def)
    
    	case *ast.ParenExpr:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.3K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/syntax/nodes_test.go

    	{"CompositeLit", `struct{x, y int}@{}`},
    
    	{"KeyValueExpr", `"foo"@: true`},
    	{"KeyValueExpr", `"a"@: b`},
    
    	{"FuncLit", `@func (){}`},
    	{"ParenExpr", `@(x)`},
    	{"SelectorExpr", `a@.b`},
    	{"IndexExpr", `a@[i]`},
    
    	{"SliceExpr", `a@[:]`},
    	{"SliceExpr", `a@[i:]`},
    	{"SliceExpr", `a@[:j]`},
    	{"SliceExpr", `a@[i:j]`},
    	{"SliceExpr", `a@[i:j:k]`},
    
    	{"AssertExpr", `x@.(T)`},
    
    	{"Operation", `@*b`},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 02 18:45:06 UTC 2023
    - 8.7K bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top