Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 56 for IndexExpr (0.51 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. src/cmd/compile/internal/ir/fmt.go

    		}
    		fmt.Fprintf(s, ".%s", n.Sel.Name)
    
    	case ODOTTYPE, ODOTTYPE2:
    		n := n.(*TypeAssertExpr)
    		exprFmt(n.X, s, nprec)
    		fmt.Fprintf(s, ".(%v)", n.Type())
    
    	case OINDEX, OINDEXMAP:
    		n := n.(*IndexExpr)
    		exprFmt(n.X, s, nprec)
    		fmt.Fprintf(s, "[%v]", n.Index)
    
    	case OSLICE, OSLICESTR, OSLICEARR, OSLICE3, OSLICE3ARR:
    		n := n.(*SliceExpr)
    		exprFmt(n.X, s, nprec)
    		fmt.Fprint(s, "[")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 05 15:20:28 UTC 2023
    - 26K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/resolver.go

    			if t.Op != syntax.Mul || t.Y != nil {
    				break
    			}
    			ptr = true
    			rtyp = t.X
    		default:
    			break L
    		}
    	}
    
    	// unpack type parameters, if any
    	if ptyp, _ := rtyp.(*syntax.IndexExpr); ptyp != nil {
    		rtyp = ptyp.X
    		if unpackParams {
    			for _, arg := range syntax.UnpackListExpr(ptyp.Index) {
    				var par *syntax.Name
    				switch arg := arg.(type) {
    				case *syntax.Name:
    					par = arg
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 14:10:44 UTC 2024
    - 26.3K bytes
    - Viewed (0)
  8. src/go/types/resolver.go

    		case *ast.ParenExpr:
    			rtyp = t.X
    		case *ast.StarExpr:
    			ptr = true
    			rtyp = t.X
    		default:
    			break L
    		}
    	}
    
    	// unpack type parameters, if any
    	switch rtyp.(type) {
    	case *ast.IndexExpr, *ast.IndexListExpr:
    		ix := typeparams.UnpackIndexExpr(rtyp)
    		rtyp = ix.X
    		if unpackParams {
    			for _, arg := range ix.Indices {
    				var par *ast.Ident
    				switch arg := arg.(type) {
    				case *ast.Ident:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 16:22:59 UTC 2024
    - 26.1K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/typecheck/expr.go

    	}
    	if !t.IsInterface() {
    		base.Fatalf("OITAB of %v", t)
    	}
    	n.SetType(types.NewPtr(types.Types[types.TUINTPTR]))
    	return n
    }
    
    // tcIndex typechecks an OINDEX node.
    func tcIndex(n *ir.IndexExpr) ir.Node {
    	n.X = Expr(n.X)
    	n.X = DefaultLit(n.X, nil)
    	n.X = implicitstar(n.X)
    	l := n.X
    	n.Index = Expr(n.Index)
    	r := n.Index
    	t := l.Type()
    	if t == nil || r.Type() == nil {
    		n.SetType(nil)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  10. src/go/printer/nodes.go

    		p.setPos(x.Rparen)
    		p.print(token.RPAREN)
    
    	case *ast.IndexExpr:
    		// TODO(gri): should treat[] like parentheses and undo one level of depth
    		p.expr1(x.X, token.HighestPrec, 1)
    		p.setPos(x.Lbrack)
    		p.print(token.LBRACK)
    		p.expr0(x.Index, depth+1)
    		p.setPos(x.Rbrack)
    		p.print(token.RBRACK)
    
    	case *ast.IndexListExpr:
    		// TODO(gri): as for IndexExpr, should treat [] like parentheses and undo
    		// one level of depth
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 17 18:53:17 UTC 2023
    - 52.6K bytes
    - Viewed (0)
Back to top