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

Method parse_method_or_embed_spec

package_text.go:288–301  ·  view source on GitHub ↗

MethodOrEmbedSpec = Name [ Signature ] .

()

Source from the content-addressed store, hash-verified

286
287// MethodOrEmbedSpec = Name [ Signature ] .
288func (p *gc_parser) parse_method_or_embed_spec() *ast.Field {
289 name, nameexpr := p.parse_name()
290 if p.tok == '(' {
291 typ := p.parse_signature()
292 return &ast.Field{
293 Names: []*ast.Ident{ast.NewIdent(name)},
294 Type: typ,
295 }
296 }
297
298 return &ast.Field{
299 Type: nameexpr,
300 }
301}
302
303// int_lit = [ "-" | "+" ] { "0" ... "9" } .
304func (p *gc_parser) parse_int() {

Callers 1

parse_interface_typeMethod · 0.95

Calls 2

parse_nameMethod · 0.95
parse_signatureMethod · 0.95

Tested by

no test coverage detected