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

Method parse_field

package_text.go:203–221  ·  view source on GitHub ↗

Field = Name Type [ string_lit ] .

()

Source from the content-addressed store, hash-verified

201
202// Field = Name Type [ string_lit ] .
203func (p *gc_parser) parse_field() *ast.Field {
204 var tag string
205 name, _ := p.parse_name()
206 typ := p.parse_type()
207 if p.tok == scanner.String {
208 tag = p.expect(scanner.String)
209 }
210
211 var names []*ast.Ident
212 if name != "?" {
213 names = []*ast.Ident{ast.NewIdent(name)}
214 }
215
216 return &ast.Field{
217 Names: names,
218 Type: typ,
219 Tag: &ast.BasicLit{Kind: token.STRING, Value: tag},
220 }
221}
222
223// Parameter = ( identifier | "?" ) [ "..." ] Type [ string_lit ] .
224func (p *gc_parser) parse_parameter() *ast.Field {

Callers 1

parse_struct_typeMethod · 0.95

Calls 3

parse_nameMethod · 0.95
parse_typeMethod · 0.95
expectMethod · 0.95

Tested by

no test coverage detected