Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 28 for parenthesized (0.26 sec)

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

    			// *(T)
    			p.syntaxError("cannot parenthesize embedded type")
    			p.next()
    			typ = p.qualifiedName(nil)
    			p.got(_Rparen) // no need to complain if missing
    		} else {
    			// *T
    			typ = p.qualifiedName(nil)
    		}
    		tag := p.oliteral()
    		p.addField(styp, pos, nil, newIndirect(pos, typ), tag)
    
    	case _Lparen:
    		p.syntaxError("cannot parenthesize embedded type")
    		p.next()
    		var typ Expr
    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/cmd/compile/internal/types2/typexpr.go

    		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:
    		typ := new(Array)
    		setDefType(def, typ)
    		if e.Len != nil {
    			typ.len = check.arrayLength(e.Len)
    		} else {
    			// [...]array
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.6K bytes
    - Viewed (0)
  3. src/go/types/typexpr.go

    		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:
    		if e.Len == nil {
    			typ := new(Slice)
    			setDefType(def, typ)
    			typ.elem = check.varType(e.Elt)
    			return typ
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.3K bytes
    - Viewed (0)
  4. src/go/printer/printer_test.go

    	_, err = parser.ParseFile(fset, "", got, 0)
    	if err != nil {
    		t.Errorf("%v\norig: %q\ngot : %q", err, src, got)
    	}
    }
    
    // If a declaration has multiple specifications, a parenthesized
    // declaration must be printed even if Lparen is token.NoPos.
    func TestParenthesizedDecl(t *testing.T) {
    	// a package with multiple specs in a single declaration
    	const src = "package p; var ( a float64; b int )"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 03 14:56:25 UTC 2024
    - 20.4K bytes
    - Viewed (0)
  5. doc/go1.17_spec.html

    must be <a href="#Uniqueness_of_identifiers">unique</a>.
    If absent, each type stands for one item of that type.
    Parameter and result
    lists are always parenthesized except that if there is exactly
    one unnamed result it may be written as an unparenthesized type.
    </p>
    
    <p>
    The final incoming parameter in a function signature may have
    a type prefixed with <code>...</code>.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 11 20:22:45 UTC 2024
    - 211.6K bytes
    - Viewed (0)
  6. src/go/doc/example.go

    						ast.Inspect(val, inspectFunc)
    					}
    				}
    			}
    		}
    	}
    
    	// Some decls include multiple specs, such as a variable declaration with
    	// multiple variables on the same line, or a parenthesized declaration. Trim
    	// the declarations to include only the specs that are actually mentioned.
    	// However, if there is a constant group with iota, leave it all: later
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 21.4K bytes
    - Viewed (0)
  7. doc/go_spec.html

    must be <a href="#Uniqueness_of_identifiers">unique</a>.
    If absent, each type stands for one item of that type.
    Parameter and result
    lists are always parenthesized except that if there is exactly
    one unnamed result it may be written as an unparenthesized type.
    </p>
    
    <p>
    The final incoming parameter in a function signature may have
    a type prefixed with <code>...</code>.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 21:07:21 UTC 2024
    - 281.5K bytes
    - Viewed (0)
  8. src/go/doc/reader.go

    			case token.TYPE:
    				// types are handled individually
    				if len(d.Specs) == 1 && !d.Lparen.IsValid() {
    					// common case: single declaration w/o parentheses
    					// (if a single declaration is parenthesized,
    					// create a new fake declaration below, so that
    					// go/doc type declarations always appear w/o
    					// parentheses)
    					if s, ok := d.Specs[0].(*ast.TypeSpec); ok {
    						r.readType(d, s)
    					}
    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/stmt.go

    	case *syntax.ExprStmt:
    		// spec: "With the exception of specific built-in functions,
    		// function and method calls and receive operations can appear
    		// in statement context. Such statements may be parenthesized."
    		var x operand
    		kind := check.rawExpr(nil, &x, s.X, nil, false)
    		var msg string
    		var code Code
    		switch x.mode {
    		default:
    			if kind == statement {
    				return
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.7K bytes
    - Viewed (0)
  10. src/go/types/stmt.go

    	case *ast.ExprStmt:
    		// spec: "With the exception of specific built-in functions,
    		// function and method calls and receive operations can appear
    		// in statement context. Such statements may be parenthesized."
    		var x operand
    		kind := check.rawExpr(nil, &x, s.X, nil, false)
    		var msg string
    		var code Code
    		switch x.mode {
    		default:
    			if kind == statement {
    				return
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.6K bytes
    - Viewed (0)
Back to top