Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 633 for isIdent (0.27 sec)

  1. src/go/parser/parser.go

    func (p *parser) parseImportSpec(doc *ast.CommentGroup, _ token.Token, _ int) ast.Spec {
    	if p.trace {
    		defer un(trace(p, "ImportSpec"))
    	}
    
    	var ident *ast.Ident
    	switch p.tok {
    	case token.IDENT:
    		ident = p.parseIdent()
    	case token.PERIOD:
    		ident = &ast.Ident{NamePos: p.pos, Name: "."}
    		p.next()
    	}
    
    	pos := p.pos
    	var path string
    	if p.tok == token.STRING {
    		path = p.lit
    		p.next()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 08 20:07:50 UTC 2023
    - 72.2K bytes
    - Viewed (0)
  2. src/encoding/json/indent.go

    // if src ends in a trailing newline, so will dst.
    func Indent(dst *bytes.Buffer, src []byte, prefix, indent string) error {
    	dst.Grow(indentGrowthFactor * len(src))
    	b := dst.AvailableBuffer()
    	b, err := appendIndent(b, src, prefix, indent)
    	dst.Write(b)
    	return err
    }
    
    func appendIndent(dst, src []byte, prefix, indent string) ([]byte, error) {
    	origLen := len(dst)
    	scan := newScanner()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 06 20:19:31 UTC 2023
    - 5.4K bytes
    - Viewed (0)
  3. src/cmd/doc/pkg.go

    			// Embedded type. Use the name of the type. It must be of the form ident or
    			// pkg.ident (for structs and interfaces), or *ident or *pkg.ident (structs only).
    			// Or a type embedded in a constraint.
    			// Nothing else is allowed.
    			ty := field.Type
    			if se, ok := field.Type.(*ast.StarExpr); !isInterface && ok {
    				// The form *ident or *pkg.ident is only valid on
    				// embedded types in structs.
    				ty = se.X
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 08 20:15:52 UTC 2024
    - 32K bytes
    - Viewed (0)
  4. src/go/printer/printer_test.go

    	if err != nil {
    		panic(err) // error in test
    	}
    
    	for indent := 0; indent < 4; indent++ {
    		indent := indent
    		t.Run(fmt.Sprint(indent), func(t *testing.T) {
    			t.Parallel()
    			var buf bytes.Buffer
    			(&Config{Tabwidth: tabwidth, Indent: indent}).Fprint(&buf, fset, file)
    			// all code must be indented by at least 'indent' tabs
    			lines := bytes.Split(buf.Bytes(), []byte{'\n'})
    			for i, line := range lines {
    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. staging/src/k8s.io/apimachinery/pkg/runtime/swagger_doc_generator.go

    }
    
    func writeFuncHeader(b *buffer, structName string, indent int) {
    	s := fmt.Sprintf("var map_%s = map[string]string {\n", structName)
    	b.addLine(s, indent)
    }
    
    func writeFuncFooter(b *buffer, structName string, indent int) {
    	b.addLine("}\n", indent) // Closes the map definition
    
    	s := fmt.Sprintf("func (%s) SwaggerDoc() map[string]string {\n", structName)
    	b.addLine(s, indent)
    	s = fmt.Sprintf("return map_%s\n", structName)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 03 07:33:58 UTC 2017
    - 7K bytes
    - Viewed (0)
  6. src/go/types/typexpr.go

    	. "internal/types/errors"
    	"strings"
    )
    
    // ident type-checks identifier e and initializes x with the value or type of e.
    // If an error occurred, x.mode is set to invalid.
    // For the meaning of def, see Checker.definedType, below.
    // If wantType is set, the identifier e is expected to denote a type.
    func (check *Checker) ident(x *operand, e *ast.Ident, def *TypeName, wantType bool) {
    	x.mode = invalid
    	x.expr = e
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.3K bytes
    - Viewed (0)
  7. src/go/types/stmt.go

    	// (and use 0 indentation at function start)
    	defer func(env environment, indent int) {
    		check.environment = env
    		check.indent = indent
    	}(check.environment, check.indent)
    	check.environment = environment{
    		decl:  decl,
    		scope: sig.scope,
    		iota:  iota,
    		sig:   sig,
    	}
    	check.indent = 0
    
    	check.stmtList(0, body.List)
    
    	if check.hasLabel {
    		check.labels(body)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.6K bytes
    - Viewed (0)
  8. src/go/printer/nodes.go

    				// won't indent again. If we didn't (ws == indent), identList will
    				// indent if the identList spans multiple lines, and it will outdent
    				// again at the end (and still ws == indent). Thus, a subsequent indent
    				// by a linebreak call after a type, or in the next multi-line identList
    				// will do the right thing.
    				p.identList(par.Names, ws == indent)
    				p.print(blank)
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 17 18:53:17 UTC 2023
    - 52.6K bytes
    - Viewed (0)
  9. src/go/printer/printer.go

    	// write entries
    	for i := 0; i < n; i++ {
    		switch ch := p.wsbuf[i]; ch {
    		case ignore:
    			// ignore!
    		case indent:
    			p.indent++
    		case unindent:
    			p.indent--
    			if p.indent < 0 {
    				p.internalError("negative indentation:", p.indent)
    				p.indent = 0
    			}
    		case newline, formfeed:
    			// A line break immediately followed by a "correcting"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 41.6K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types2/typexpr.go

    // Must only be called by definedType or genericType.
    func (check *Checker) typInternal(e0 syntax.Expr, def *TypeName) (T Type) {
    	if check.conf.Trace {
    		check.trace(e0.Pos(), "-- type %s", e0)
    		check.indent++
    		defer func() {
    			check.indent--
    			var under Type
    			if T != nil {
    				// Calling under() here may lead to endless instantiations.
    				// Test case: type T[P any] *T[P]
    				under = safeUnderlying(T)
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.6K bytes
    - Viewed (0)
Back to top