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

Method process

parse/getast.go:324–365  ·  view source on GitHub ↗

process takes the contents of f.Specs and uses them to populate f.Identities

()

Source from the content-addressed store, hash-verified

322// process takes the contents of f.Specs and
323// uses them to populate f.Identities
324func (fs *FileSet) process() {
325 deferred := make(linkset)
326parse:
327 for name, def := range fs.Specs {
328 pushstate(name)
329 el := fs.parseExpr(def)
330 if el == nil {
331 warnf("failed to parse")
332 popstate()
333 continue parse
334 }
335 el.AlwaysPtr(&fs.pointerRcv)
336
337 // Apply type parameters if available
338 if typeInfo, ok := fs.TypeInfos[name]; ok && typeInfo.TypeParams != nil {
339 typeParamsStr := formatTypeParams(typeInfo.TypeParams)
340 ptrMap := getMspTypeParams(typeInfo.TypeParams)
341 if typeParamsStr != "" && ptrMap != nil {
342 el.SetTypeParams(gen.GenericTypeParams{
343 TypeParams: typeParamsStr,
344 ToPointerMap: ptrMap,
345 })
346 }
347 }
348
349 // push unresolved identities into
350 // the graph of links and resolve after
351 // we've handled every possible named type.
352 if be, ok := el.(*gen.BaseElem); ok && be.Value == gen.IDENT {
353 deferred[name] = be
354 popstate()
355 continue parse
356 }
357 el.Alias(name)
358 fs.Identities[name] = el
359 popstate()
360 }
361
362 if len(deferred) > 0 {
363 fs.resolve(deferred)
364 }
365}
366
367func strToMethod(s string) gen.Method {
368 switch s {

Callers 1

FileFunction · 0.95

Calls 10

parseExprMethod · 0.95
resolveMethod · 0.95
pushstateFunction · 0.85
warnfFunction · 0.85
popstateFunction · 0.85
formatTypeParamsFunction · 0.85
getMspTypeParamsFunction · 0.85
AlwaysPtrMethod · 0.65
SetTypeParamsMethod · 0.65
AliasMethod · 0.65

Tested by

no test coverage detected