MCPcopy Create free account
hub / github.com/nsf/gocode / parse_func_decl

Method parse_func_decl

package_text.go:583–594  ·  view source on GitHub ↗

FuncDecl = "func" ExportedName Signature [ FuncBody ] .

()

Source from the content-addressed store, hash-verified

581
582// FuncDecl = "func" ExportedName Signature [ FuncBody ] .
583func (p *gc_parser) parse_func_decl() (string, *ast.FuncDecl) {
584 // "func" was already consumed by lookahead
585 name := p.parse_exported_name()
586 typ := p.parse_signature()
587 if p.tok == '{' {
588 p.parse_func_body()
589 }
590 return name.X.(*ast.Ident).Name, &ast.FuncDecl{
591 Name: name.Sel,
592 Type: typ,
593 }
594}
595
596func strip_method_receiver(recv *ast.FieldList) string {
597 var sel *ast.SelectorExpr

Callers 1

parse_declMethod · 0.95

Calls 3

parse_exported_nameMethod · 0.95
parse_signatureMethod · 0.95
parse_func_bodyMethod · 0.95

Tested by

no test coverage detected