MCPcopy
hub / github.com/tinylib/msgp / parseFieldList

Method parseFieldList

parse/getast.go:502–518  ·  view source on GitHub ↗
(fl *ast.FieldList)

Source from the content-addressed store, hash-verified

500}
501
502func (fs *FileSet) parseFieldList(fl *ast.FieldList) []gen.StructField {
503 if fl == nil || fl.NumFields() == 0 {
504 return nil
505 }
506 out := make([]gen.StructField, 0, fl.NumFields())
507 for _, field := range fl.List {
508 pushstate(fieldName(field))
509 fds := fs.getField(field)
510 if len(fds) > 0 {
511 out = append(out, fds...)
512 } else {
513 warnf("ignored")
514 }
515 popstate()
516 }
517 return out
518}
519
520// translate *ast.Field into []gen.StructField
521func (fs *FileSet) getField(f *ast.Field) []gen.StructField {

Callers 2

parseExprMethod · 0.95

Calls 5

getFieldMethod · 0.95
pushstateFunction · 0.85
fieldNameFunction · 0.85
warnfFunction · 0.85
popstateFunction · 0.85

Tested by

no test coverage detected