Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 363 for Lparen (0.21 sec)

  1. src/cmd/vendor/golang.org/x/mod/modfile/read.go

    //	)
    type LineBlock struct {
    	Comments
    	Start  Position
    	LParen LParen
    	Token  []string
    	Line   []*Line
    	RParen RParen
    }
    
    func (x *LineBlock) Span() (start, end Position) {
    	return x.Start, x.RParen.Pos.add(")")
    }
    
    // An LParen represents the beginning of a parenthesized line block.
    // It is a place to store suffix comments.
    type LParen struct {
    	Comments
    	Pos Position
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go

    			children = append(children,
    				tok(n.Func, len("func")))
    		}
    
    	case *ast.GenDecl:
    		children = append(children,
    			tok(n.TokPos, len(n.Tok.String())))
    		if n.Lparen != 0 {
    			children = append(children,
    				tok(n.Lparen, len("(")),
    				tok(n.Rparen, len(")")))
    		}
    
    	case *ast.GoStmt:
    		children = append(children,
    			tok(n.Go, len("go")))
    
    	case *ast.Ident:
    		children = append(children,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 15.9K bytes
    - Viewed (0)
  3. src/go/types/generate_test.go

    					if isIdent(n.Args[0], "pos") {
    						pos := n.Args[0].Pos()
    						fun := &ast.SelectorExpr{X: newIdent(pos, "posn"), Sel: newIdent(pos, "Pos")}
    						arg := &ast.CallExpr{Fun: fun, Lparen: pos, Args: nil, Ellipsis: token.NoPos, Rparen: pos}
    						n.Args[0] = arg
    						return false
    					}
    				case "addf":
    					// rewrite err.addf(pos, ...) to err.addf(posn, ...)
    					if isIdent(n.Args[0], "pos") {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 16.5K bytes
    - Viewed (0)
  4. src/go/ast/ast.go

    							return gen, true
    						}
    					}
    				}
    			}
    		}
    	}
    	return "", false
    }
    
    // Unparen returns the expression with any enclosing parentheses removed.
    func Unparen(e Expr) Expr {
    	for {
    		paren, ok := e.(*ParenExpr)
    		if !ok {
    			return e
    		}
    		e = paren.X
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 35.6K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/imports.go

    	}
    	newImport.Path.ValuePos = pos
    	newImport.EndPos = pos
    
    	// Clean up parens. impDecl contains at least one spec.
    	if len(impDecl.Specs) == 1 {
    		// Remove unneeded parens.
    		impDecl.Lparen = token.NoPos
    	} else if !impDecl.Lparen.IsValid() {
    		// impDecl needs parens added.
    		impDecl.Lparen = impDecl.Specs[0].Pos()
    	}
    
    	f.Imports = append(f.Imports, newImport)
    
    	if len(f.Decls) <= 1 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 10 21:56:21 UTC 2022
    - 13.4K bytes
    - Viewed (0)
  6. src/cmd/fix/fix.go

    		copy(f.Decls[lastImport+2:], f.Decls[lastImport+1:])
    		f.Decls[lastImport+1] = impDecl
    	}
    
    	// Ensure the import decl has parentheses, if needed.
    	if len(impDecl.Specs) > 0 && !impDecl.Lparen.IsValid() {
    		impDecl.Lparen = impDecl.Pos()
    	}
    
    	insertAt := impIndex + 1
    	if insertAt == 0 {
    		insertAt = len(impDecl.Specs)
    	}
    	impDecl.Specs = append(impDecl.Specs, nil)
    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/go/doc/example.go

    			if d.Doc != nil {
    				comments = append(comments, d.Doc)
    			}
    		}
    	}
    
    	// Synthesize import declaration.
    	importDecl := &ast.GenDecl{
    		Tok:    token.IMPORT,
    		Lparen: 1, // Need non-zero Lparen and Rparen so that printer
    		Rparen: 1, // treats this as a factored import.
    	}
    	importDecl.Specs = append(namedImports, blankImports...)
    
    	// Synthesize main function.
    	funcDecl := &ast.FuncDecl{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 21.4K bytes
    - Viewed (0)
  8. src/go/printer/printer_test.go

    	// now remove parentheses from the declaration
    	for i := 0; i != len(f.Decls); i++ {
    		f.Decls[i].(*ast.GenDecl).Lparen = token.NoPos
    	}
    	buf.Reset()
    	err = Fprint(&buf, fset, f)
    	if err != nil {
    		t.Fatal(err)
    	}
    	noparen := buf.String()
    
    	if noparen != original {
    		t.Errorf("got %q, want %q", noparen, original)
    	}
    }
    
    // Verify that we don't print a newline between "return" and its results, as
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 03 14:56:25 UTC 2024
    - 20.4K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go

    		if name == "CBytes" {
    			return true
    		}
    
    		if debug {
    			log.Printf("%s: call to C.%s", fset.Position(call.Lparen), name)
    		}
    
    		for _, arg := range call.Args {
    			if !typeOKForCgoCall(cgoBaseType(info, arg), make(map[types.Type]bool)) {
    				reportf(arg.Pos(), "possibly passing Go type with embedded pointer to C")
    				break
    			}
    
    			// Check for passing the address of a bad type.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 11.2K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go

    	if idx < 0 {
    		if false {
    			pass.Reportf(call.Lparen, "can't check non-constant format in call to %s", fn.FullName())
    		}
    		return
    	}
    
    	firstArg := idx + 1 // Arguments are immediately after format string.
    	if !strings.Contains(format, "%") {
    		if len(call.Args) > firstArg {
    			pass.Reportf(call.Lparen, "%s call has arguments but no formatting directives", fn.FullName())
    		}
    		return
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 32.5K bytes
    - Viewed (0)
Back to top