- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 31 for LPAREN (0.17 sec)
-
src/cmd/vendor/golang.org/x/tools/go/ast/astutil/imports.go
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 { return true }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 10 21:56:21 UTC 2022 - 13.4K bytes - Viewed (0) -
src/go/ast/ast.go
// TypeAssertExpr struct { X Expr // expression Lparen token.Pos // position of "(" Type Expr // asserted type; nil means type switch X.(type) Rparen token.Pos // position of ")" } // A CallExpr node represents an expression followed by an argument list. CallExpr struct { Fun Expr // function expression Lparen token.Pos // position of "("
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 28 21:32:41 UTC 2024 - 35.6K bytes - Viewed (0) -
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) -
src/go/format/format.go
for _, d := range file.Decls { d, ok := d.(*ast.GenDecl) if !ok || d.Tok != token.IMPORT { // Not an import declaration, so we're done. // Imports are always first. return false } if d.Lparen.IsValid() { // For now assume all grouped imports are unsorted. // TODO(gri) Should check if they are sorted already. return true } // Ungrouped imports are sorted by default. } return false
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 12:02:03 UTC 2023 - 4.3K bytes - Viewed (0) -
src/go/ast/example_test.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 15 21:44:50 UTC 2024 - 6.1K bytes - Viewed (0) -
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) -
src/go/ast/import.go
for _, d := range f.Decls { d, ok := d.(*GenDecl) if !ok || d.Tok != token.IMPORT { // Not an import declaration, so we're done. // Imports are always first. break } if !d.Lparen.IsValid() { // Not a block: sorted by default. continue } // Identify and sort runs of specs on successive lines. i := 0 specs := d.Specs[:0] for j, s := range d.Specs {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 5.7K bytes - Viewed (0) -
src/go/printer/printer_test.go
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 )" fset := token.NewFileSet()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jun 03 14:56:25 UTC 2024 - 20.4K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go
} // A call to C.CBytes passes a pointer but is always safe. 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 }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 23:33:33 UTC 2023 - 11.2K bytes - Viewed (0) -
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)