Search Options

Results per page
Sort
Preferred Languages
Advance

Results 71 - 80 of 101 for Parenthesized (0.31 sec)

  1. src/fmt/example_test.go

    	pi := math.Pi
    	fmt.Printf("%v %g %.2f (%6.2f) %e\n", pi, pi, pi, pi, pi)
    	// Result: 3.141592653589793 3.141592653589793 3.14 (  3.14) 3.141593e+00
    
    	// Complex numbers format as parenthesized pairs of floats, with an 'i'
    	// after the imaginary part.
    	point := 110.7 + 22.5i
    	fmt.Printf("%v %g %.2f %.2e\n", point, point, point, point)
    	// Result: (110.7+22.5i) (110.7+22.5i) (110.70+22.50i) (1.11e+02+2.25e+01i)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 21:03:10 UTC 2019
    - 11.8K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/imports.go

    			continue
    		}
    		if first == nil {
    			first = gen
    			continue // Don't touch the first one.
    		}
    		// We now know there is more than one package in this import
    		// declaration. Ensure that it ends up parenthesized.
    		first.Lparen = first.Pos()
    		// Move the imports of the other import declaration to the first one.
    		for _, spec := range gen.Specs {
    			spec.(*ast.ImportSpec).Path.ValuePos = first.Pos()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 10 21:56:21 UTC 2022
    - 13.4K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go

    		return "key/value association"
    	case *ast.LabeledStmt:
    		return "statement label"
    	case *ast.MapType:
    		return "map type"
    	case *ast.Package:
    		return "package"
    	case *ast.ParenExpr:
    		return "parenthesized " + NodeDescription(n.X)
    	case *ast.RangeStmt:
    		return "range loop"
    	case *ast.ReturnStmt:
    		return "return statement"
    	case *ast.SelectStmt:
    		return "select statement"
    	case *ast.SelectorExpr:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 15.9K bytes
    - Viewed (0)
  4. src/go/build/constraint/expr.go

    		p.lex()
    		if p.tok == "!" {
    			panic(&SyntaxError{Offset: p.pos, Err: "double negation not allowed"})
    		}
    		return not(p.atom())
    	}
    	return p.atom()
    }
    
    // atom parses a tag or a parenthesized expression.
    // On entry, the next input token HAS been lexed.
    // On exit, the next input token has been lexed and is in p.tok.
    func (p *exprParser) atom() Expr {
    	// first token already in p.tok
    	if p.tok == "(" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 14.2K bytes
    - Viewed (0)
  5. src/go/parser/parser.go

    		x := &ast.BasicLit{ValuePos: p.pos, Kind: p.tok, Value: p.lit}
    		p.next()
    		return x
    
    	case token.LPAREN:
    		lparen := p.pos
    		p.next()
    		p.exprLev++
    		x := p.parseRhs() // types may be parenthesized: (some type)
    		p.exprLev--
    		rparen := p.expect(token.RPAREN)
    		return &ast.ParenExpr{Lparen: lparen, X: x, Rparen: rparen}
    
    	case token.FUNC:
    		return p.parseFuncTypeOrLit()
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 08 20:07:50 UTC 2023
    - 72.2K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. src/internal/types/testdata/check/typeparams.go

    func identity[T any](x T) T { return x }
    
    func _[_ any](x int) int { panic(0) }
    func _[T any](T /* ERROR "redeclared" */ T)() {}
    func _[T, T /* ERROR "redeclared" */ any]() {}
    
    // Constraints (incl. any) may be parenthesized.
    func _[_ (any)]() {}
    func _[_ (interface{})]() {}
    
    func reverse[T any](list []T) []T {
            rlist := make([]T, len(list))
            i := len(list)
            for _, x := range list {
                    i--
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 19 01:56:58 UTC 2023
    - 15.2K bytes
    - Viewed (0)
  9. 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)
  10. src/text/template/parse/parse.go

    	case itemCharConstant, itemComplex, itemNumber:
    		number, err := t.newNumber(token.pos, token.val, token.typ)
    		if err != nil {
    			t.error(err)
    		}
    		return number
    	case itemLeftParen:
    		return t.pipeline("parenthesized pipeline", itemRightParen)
    	case itemString, itemRawString:
    		s, err := strconv.Unquote(token.val)
    		if err != nil {
    			t.error(err)
    		}
    		return t.newString(token.pos, token.val, s)
    	}
    	t.backup()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 20:57:51 UTC 2024
    - 21.3K bytes
    - Viewed (0)
Back to top