MCPcopy Create free account
hub / github.com/google/gapid / parseIncludesResursive

Method parseIncludesResursive

gapil/api.go:210–227  ·  view source on GitHub ↗

parseUnnamedIncludesResursive resursively parses the unnamed includes from apiname in wd. The full list of includes (named and unnamed) is added to includes.

(base file.Path, includes map[string]*ast.API)

Source from the content-addressed store, hash-verified

208// apiname in wd. The full list of includes (named and unnamed) is added to
209// includes.
210func (p *Processor) parseIncludesResursive(base file.Path, includes map[string]*ast.API) parse.ErrorList {
211 absname := base.System()
212 if _, seen := includes[absname]; seen {
213 return nil
214 }
215 api, allErrs := p.parse(base)
216 if api == nil {
217 return allErrs
218 }
219 includes[absname] = api
220 for _, i := range api.Imports {
221 child := p.Loader.Find(base.Parent().Join(i.Path.Value))
222 if errs := p.parseIncludesResursive(child, includes); len(errs) > 0 {
223 allErrs = append(allErrs, errs...)
224 }
225 }
226 return allErrs
227}
228
229// CheckErrors will, if len(errs) > 0, print each of the error messages for the
230// specified api and then return the list as a single error. If errs is zero length,

Callers 1

resolveMethod · 0.95

Calls 5

parseMethod · 0.95
SystemMethod · 0.80
FindMethod · 0.65
ParentMethod · 0.65
JoinMethod · 0.45

Tested by

no test coverage detected