Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 340 for Lparen (0.18 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/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)
  6. 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)
  7. 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)
  8. 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)
  9. src/text/template/parse/parse_test.go

    		hasError, `comment1:1: unclosed comment`},
    	{"comment2",
    		"{{/*\nhello\n}}",
    		hasError, `comment2:1: unclosed comment`},
    	{"lparen",
    		"{{.X (1 2 3}}",
    		hasError, `unclosed left paren`},
    	{"rparen",
    		"{{.X 1 2 3 ) }}",
    		hasError, "unexpected right paren"},
    	{"rparen2",
    		"{{(.X 1 2 3",
    		hasError, `unclosed action`},
    	{"space",
    		"{{`x`3}}",
    		hasError, `in operand`},
    	{"idchar",
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Feb 24 21:59:12 UTC 2024
    - 24K bytes
    - Viewed (0)
  10. src/go/printer/printer.go

    		needsLinebreak := false
    		if p.mode&noExtraBlank == 0 &&
    			last.Text[1] == '*' && p.lineFor(last.Pos()) == next.Line &&
    			tok != token.COMMA &&
    			(tok != token.RPAREN || p.prevOpen == token.LPAREN) &&
    			(tok != token.RBRACK || p.prevOpen == token.LBRACK) {
    			if p.containsLinebreak() && p.mode&noExtraLinebreak == 0 && p.level == 0 {
    				needsLinebreak = true
    			} else {
    				p.writeByte(' ', 1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 41.6K bytes
    - Viewed (0)
Back to top