Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 50 for IndexExpr (0.28 sec)

  1. src/go/types/expr.go

    		kind := check.rawExpr(nil, x, e.X, nil, false)
    		x.expr = e
    		return kind
    
    	case *ast.SelectorExpr:
    		check.selector(x, e, nil, false)
    
    	case *ast.IndexExpr, *ast.IndexListExpr:
    		ix := typeparams.UnpackIndexExpr(e)
    		if check.indexExpr(x, ix) {
    			if !enableReverseTypeInference {
    				T = nil
    			}
    			check.funcInst(T, e.Pos(), x, ix, true)
    		}
    		if x.mode == invalid {
    			goto Error
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 49.7K bytes
    - Viewed (0)
  2. src/go/parser/parser.go

    		}
    		p.next()
    	}
    	p.exprLev--
    
    	closing := p.expectClosing(token.RBRACK, "type argument list")
    
    	if len(list) == 0 {
    		p.errorExpected(closing, "type argument list")
    		return &ast.IndexExpr{
    			X:      typ,
    			Lbrack: opening,
    			Index:  &ast.BadExpr{From: opening + 1, To: closing},
    			Rbrack: closing,
    		}
    	}
    
    	return typeparams.PackIndexExpr(typ, opening, list, closing)
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 08 20:07:50 UTC 2023
    - 72.2K bytes
    - Viewed (0)
  3. 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)
  4. 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)
  5. src/cmd/compile/internal/types2/expr.go

    		kind := check.rawExpr(nil, x, e.X, nil, false)
    		x.expr = e
    		return kind
    
    	case *syntax.SelectorExpr:
    		check.selector(x, e, nil, false)
    
    	case *syntax.IndexExpr:
    		if check.indexExpr(x, e) {
    			if !enableReverseTypeInference {
    				T = nil
    			}
    			check.funcInst(T, e.Pos(), x, e, true)
    		}
    		if x.mode == invalid {
    			goto Error
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 51.7K bytes
    - Viewed (0)
  6. 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)
  7. src/go/types/check.go

    	if m := check.Instances; m != nil {
    		m[ident] = Instance{newTypeList(targs), typ}
    	}
    }
    
    func instantiatedIdent(expr ast.Expr) *ast.Ident {
    	var selOrIdent ast.Expr
    	switch e := expr.(type) {
    	case *ast.IndexExpr:
    		selOrIdent = e.X
    	case *ast.IndexListExpr:
    		selOrIdent = e.X
    	case *ast.SelectorExpr, *ast.Ident:
    		selOrIdent = e
    	}
    	switch x := selOrIdent.(type) {
    	case *ast.Ident:
    		return x
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  8. src/go/printer/testdata/parser.go

    			high = p.parseRhs()
    		}
    	}
    	p.exprLev--
    	rbrack := p.expect(token.RBRACK)
    
    	if isSlice {
    		return &ast.SliceExpr{x, lbrack, low, high, rbrack}
    	}
    	return &ast.IndexExpr{x, lbrack, low, rbrack}
    }
    
    func (p *parser) parseCallOrConversion(fun ast.Expr) *ast.CallExpr {
    	if p.trace {
    		defer un(trace(p, "CallOrConversion"))
    	}
    
    	lparen := p.expect(token.LPAREN)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 20:19:51 UTC 2023
    - 50.5K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/syntax/printer.go

    			} else {
    				p.printExprList(n.ElemList)
    			}
    		}
    		p.print(_Rbrace)
    
    	case *ParenExpr:
    		p.print(_Lparen, n.X, _Rparen)
    
    	case *SelectorExpr:
    		p.print(n.X, _Dot, n.Sel)
    
    	case *IndexExpr:
    		p.print(n.X, _Lbrack, n.Index, _Rbrack)
    
    	case *SliceExpr:
    		p.print(n.X, _Lbrack)
    		if i := n.Index[0]; i != nil {
    			p.printNode(i)
    		}
    		p.print(_Colon)
    		if j := n.Index[1]; j != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 24 07:17:27 UTC 2023
    - 21.5K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types2/check.go

    		m[ident] = Instance{newTypeList(targs), typ}
    	}
    }
    
    func instantiatedIdent(expr syntax.Expr) *syntax.Name {
    	var selOrIdent syntax.Expr
    	switch e := expr.(type) {
    	case *syntax.IndexExpr:
    		selOrIdent = e.X
    	case *syntax.SelectorExpr, *syntax.Name:
    		selOrIdent = e
    	}
    	switch x := selOrIdent.(type) {
    	case *syntax.Name:
    		return x
    	case *syntax.SelectorExpr:
    		return x.Sel
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 23.3K bytes
    - Viewed (0)
Back to top