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

Method parse_name

package_text.go:185–200  ·  view source on GitHub ↗

Name = identifier | "?" | ExportedName .

()

Source from the content-addressed store, hash-verified

183
184// Name = identifier | "?" | ExportedName .
185func (p *gc_parser) parse_name() (string, ast.Expr) {
186 switch p.tok {
187 case scanner.Ident:
188 name := p.lit
189 p.next()
190 return name, ast.NewIdent(name)
191 case '?':
192 p.next()
193 return "?", ast.NewIdent("?")
194 case '@':
195 en := p.parse_exported_name()
196 return en.Sel.Name, en
197 }
198 p.error("name expected")
199 return "", nil
200}
201
202// Field = Name Type [ string_lit ] .
203func (p *gc_parser) parse_field() *ast.Field {

Callers 4

parse_fieldMethod · 0.95
parse_parameterMethod · 0.95
parse_method_declMethod · 0.95

Calls 3

nextMethod · 0.95
parse_exported_nameMethod · 0.95
errorMethod · 0.95

Tested by

no test coverage detected