Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 43 for ParenExpr (0.15 sec)

  1. src/go/parser/parser_test.go

    	{name: "binary", format: "package main; var x = «1+»1"},
    	{name: "binaryparen", format: "package main; var x = «1+(«1»)»", parseMultiplier: 2}, // Parser nodes: BinaryExpr, ParenExpr
    	{name: "unary", format: "package main; var x = «^»1"},
    	{name: "addr", format: "package main; var x = «& »x"},
    	{name: "star", format: "package main; var x = «*»x"},
    	{name: "recv", format: "package main; var x = «<-»x"},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 31 20:26:14 UTC 2024
    - 24.6K bytes
    - Viewed (0)
  2. src/go/types/builtins_test.go

    				return
    			}
    			if bin.Name() != name {
    				t.Errorf("%s: got built-in %s; want %s", src0, bin.Name(), name)
    				return
    			}
    			return // we're done
    
    		case *ast.ParenExpr:
    			fun = p.X // unpack
    
    		case *ast.SelectorExpr:
    			// built-in from package unsafe - ignore details
    			return // we're done
    
    		default:
    			t.Errorf("%s: invalid function call", src0)
    			return
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  3. 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)
  4. 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)
  5. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go

    	case *ast.FuncLit:
    		a.apply(n, "Type", nil, n.Type)
    		a.apply(n, "Body", nil, n.Body)
    
    	case *ast.CompositeLit:
    		a.apply(n, "Type", nil, n.Type)
    		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)
    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.Type, before, after)
    		walkBeforeAfter(&n.Body, before, after)
    	case *ast.CompositeLit:
    		walkBeforeAfter(&n.Type, before, after)
    		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)
    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

    		}
    
    	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)
  8. 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)
  9. 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)
  10. 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)
Back to top