Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 20 for parenthesize (0.2 sec)

  1. src/cmd/compile/internal/types2/check.go

    			stv.SetAssignable()
    		}
    		if tv.HasOk() {
    			stv.SetHasOk()
    		}
    		x.SetTypeInfo(stv)
    	}
    }
    
    func (check *Checker) recordBuiltinType(f syntax.Expr, sig *Signature) {
    	// f must be a (possibly parenthesized, possibly qualified)
    	// identifier denoting a built-in (including unsafe's non-constant
    	// functions Add and Slice): record the signature for f and possible
    	// children.
    	for {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 23.3K 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. 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)
  6. 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)
  7. 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)
  8. 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)
  9. src/time/format_test.go

    	// This test checks nextStdChunk's behavior directly,
    	// instead of needing to test it only indirectly through Parse/Format.
    
    	// markChunks returns format with each detected
    	// 'format chunk' parenthesized.
    	// For example showChunks("2006-01-02") == "(2006)-(01)-(02)".
    	markChunks := func(format string) string {
    		// Note that NextStdChunk and StdChunkNames
    		// are not part of time's public API.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:58:29 UTC 2024
    - 36.4K bytes
    - Viewed (0)
  10. src/text/template/exec.go

    	case *parse.ChainNode:
    		return s.evalChainNode(dot, n, cmd.Args, final)
    	case *parse.IdentifierNode:
    		// Must be a function.
    		return s.evalFunction(dot, n, cmd, cmd.Args, final)
    	case *parse.PipeNode:
    		// Parenthesized pipeline. The arguments are all inside the pipeline; final must be absent.
    		s.notAFunction(cmd.Args, final)
    		return s.evalPipeline(dot, n)
    	case *parse.VariableNode:
    		return s.evalVariableNode(dot, n, cmd.Args, final)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 21:22:24 UTC 2024
    - 32K bytes
    - Viewed (0)
Back to top