Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 24 for ParenExpr (0.22 sec)

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

    	case *ArrayType, *StructType, *FuncType, *InterfaceType, *SliceType, *MapType, *ChanType:
    		return true
    	case *Operation:
    		return isTypeElem(x.X) || (x.Y != nil && isTypeElem(x.Y)) || x.Op == Tilde
    	case *ParenExpr:
    		return isTypeElem(x.X)
    	}
    	return false
    }
    
    // VarSpec = IdentifierList ( Type [ "=" ExpressionList ] | "=" ExpressionList ) .
    func (p *parser) varDecl(group *Group) Decl {
    	if trace {
    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/ast/filter.go

    			b = true
    		}
    	}
    	return b
    }
    
    func filterType(typ Expr, f Filter, export bool) bool {
    	switch t := typ.(type) {
    	case *Ident:
    		return f(t.Name)
    	case *ParenExpr:
    		return filterType(t.X, f, export)
    	case *ArrayType:
    		return filterType(t.Elt, f, export)
    	case *StructType:
    		if filterFieldList(t.Fields, f, export) {
    			t.Incomplete = true
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/typexpr.go

    		}
    
    	case *syntax.IndexExpr:
    		check.verifyVersionf(e, go1_18, "type instantiation")
    		return check.instantiatedType(e.X, syntax.UnpackListExpr(e.Index), def)
    
    	case *syntax.ParenExpr:
    		// Generic types must be instantiated before they can be used in any form.
    		// Consequently, generic types cannot be parenthesized.
    		return check.definedType(e.X, def)
    
    	case *syntax.ArrayType:
    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/types/typexpr.go

    	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:
    		// Generic types must be instantiated before they can be used in any form.
    		// Consequently, generic types cannot be parenthesized.
    		return check.definedType(e.X, def)
    
    	case *ast.ArrayType:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.3K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/walk/assign.go

    			early.Append(init...)
    
    			switch ll := l.(type) {
    			case *ir.IndexExpr:
    				if ll.X.Type().IsArray() {
    					save(&ll.Index)
    					l = ll.X
    					continue
    				}
    			case *ir.ParenExpr:
    				l = ll.X
    				continue
    			case *ir.SelectorExpr:
    				if ll.Op() == ir.ODOT {
    					l = ll.X
    					continue
    				}
    			}
    			break
    		}
    
    		var name *ir.Name
    		switch l.Op() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:09:06 UTC 2024
    - 20.3K bytes
    - Viewed (0)
  6. src/go/printer/printer_test.go

    	const want = `package p
    
    func f()
    `
    
    	if got != want {
    		t.Fatalf("got:\n%s\nwant:\n%s\n", got, want)
    	}
    }
    
    // TestChanType tests that the tree for <-(<-chan int), without
    // ParenExpr, is correctly formatted with parens.
    // Test case for issue #63362.
    func TestChanType(t *testing.T) {
    	expr := &ast.UnaryExpr{
    		Op: token.ARROW,
    		X: &ast.CallExpr{
    			Fun: &ast.ChanType{
    				Dir:   ast.RECV,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 03 14:56:25 UTC 2024
    - 20.4K bytes
    - Viewed (0)
  7. src/go/types/expr.go

    	case *ast.Ident, *ast.BasicLit, *ast.SelectorExpr:
    		// An identifier denoting a constant, a constant literal,
    		// or a qualified identifier (imported untyped constant).
    		// No operands to take care of.
    
    	case *ast.ParenExpr:
    		check.updateExprType0(x, x.X, typ, final)
    
    	case *ast.UnaryExpr:
    		// If x is a constant, the operands were constants.
    		// The operands don't need to be updated since they
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 49.7K bytes
    - Viewed (0)
  8. src/go/doc/reader.go

    		return baseTypeName(t.X)
    	case *ast.SelectorExpr:
    		if _, ok := t.X.(*ast.Ident); ok {
    			// only possible for qualified type names;
    			// assume type is imported
    			return t.Sel.Name, true
    		}
    	case *ast.ParenExpr:
    		return baseTypeName(t.X)
    	case *ast.StarExpr:
    		return baseTypeName(t.X)
    	}
    	return "", false
    }
    
    // An embeddedSet describes a set of embedded types.
    type embeddedSet map[*namedType]bool
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 27.5K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types2/resolver.go

    	// work for other invalid receivers, but we don't care. The
    	// validity of receiver expressions is checked elsewhere.
    	for {
    		switch t := rtyp.(type) {
    		case *syntax.ParenExpr:
    			rtyp = t.X
    		// case *ast.StarExpr:
    		//      ptr = true
    		// 	rtyp = t.X
    		case *syntax.Operation:
    			if t.Op != syntax.Mul || t.Y != nil {
    				break
    			}
    			ptr = true
    			rtyp = t.X
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 14:10:44 UTC 2024
    - 26.3K bytes
    - Viewed (0)
  10. src/go/types/resolver.go

    	// work for other invalid receivers, but we don't care. The
    	// validity of receiver expressions is checked elsewhere.
    	for {
    		switch t := rtyp.(type) {
    		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) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 16:22:59 UTC 2024
    - 26.1K bytes
    - Viewed (0)
Back to top