code: func BuildConfig(root *Module, walker ModuleWalker) (*Config, hcl.Diagnostics) {
  	var diags hcl.Diagnostics
  	cfg := &Config{
  		Module: root,
  	}
  	cfg.Root = cfg // Root module is self-referential.
  	cfg.Children, diags = buildChildModules(cfg, walker)
  	return cfg, diags
  }
docs: // BuildConfig constructs a Config from a root module by loading all of its
  // descendent modules via the given ModuleWalker.
  //
  // The result is a module tree that has so far only had basic module- and
  // file-level invariants validated. If the returned diagnostics contains errors,
  // the returned module tree may be incomplete but can still be used carefully
  // for static analysis.