• Home
  • Raw
  • Download

Lines Matching refs:r

91 	r := &NameResolver{
95 r.rootNamespace = r.newNamespace(".")
96 r.rootNamespace.visibleNamespaces = []*Namespace{r.rootNamespace}
97 r.addNamespace(r.rootNamespace)
99 return r
102 func (r *NameResolver) newNamespace(path string) *Namespace {
105 namespace.exportToKati = r.namespaceExportFilter(namespace)
110 func (r *NameResolver) addNewNamespaceForModule(module *NamespaceModule, path string) error {
117 namespace := r.newNamespace(dir)
119 module.resolver = r
121 return r.addNamespace(namespace)
124 func (r *NameResolver) addNamespace(namespace *Namespace) (err error) {
125 existingNamespace, exists := r.namespaceAt(namespace.Path)
135 r.sortedNamespaces.add(namespace)
137 r.namespacesByDir.Store(namespace.Path, namespace)
142 func (r *NameResolver) namespaceAt(path string) (namespace *Namespace, found bool) {
143 mapVal, found := r.namespacesByDir.Load(path)
151 func (r *NameResolver) findNamespace(path string) (namespace *Namespace) {
152 namespace, found := r.namespaceAt(path)
160 namespace = r.findNamespace(parentDir)
161 r.namespacesByDir.Store(path, namespace)
171 func (r *NameResolver) NewModule(ctx blueprint.NamespaceContext, moduleGroup blueprint.ModuleGroup,…
175 err := r.addNewNamespaceForModule(newNamespace, ctx.ModulePath())
187 ns := r.findNamespaceFromCtx(ctx)
204 func (r *NameResolver) AllModules() []blueprint.ModuleGroup {
207 for _, namespace := range r.sortedNamespaces.sortedItems() {
222 func (r *NameResolver) parseFullyQualifiedName(name string) (namespaceName string, moduleName strin…
235 func (r *NameResolver) getNamespacesToSearchForModule(sourceNamespace blueprint.Namespace) (searchO…
240 return r.sortedNamespaces.sortedItems()
245 func (r *NameResolver) ModuleFromName(name string, namespace blueprint.Namespace) (group blueprint.…
247 nsName, moduleName, isAbs := r.parseFullyQualifiedName(name)
249 namespace, found := r.namespaceAt(nsName)
256 for _, candidate := range r.getNamespacesToSearchForModule(namespace) {
266 func (r *NameResolver) Rename(oldName string, newName string, namespace blueprint.Namespace) []erro…
271 func (r *NameResolver) FindNamespaceImports(namespace *Namespace) (err error) {
277 imp, ok := r.namespaceAt(name)
284 namespace.visibleNamespaces = append(namespace.visibleNamespaces, r.rootNamespace)
288 func (r *NameResolver) chooseId(namespace *Namespace) {
289 id := r.sortedNamespaces.index(namespace)
296 func (r *NameResolver) MissingDependencyError(depender string, dependerNamespace blueprint.Namespac…
299 _, _, isAbs := r.parseFullyQualifiedName(depName)
308 for _, namespace := range r.sortedNamespaces.sortedItems() {
317 searched := r.getNamespacesToSearchForModule(dependerNs)
329 func (r *NameResolver) GetNamespace(ctx blueprint.NamespaceContext) blueprint.Namespace {
330 return r.findNamespaceFromCtx(ctx)
333 func (r *NameResolver) findNamespaceFromCtx(ctx blueprint.NamespaceContext) *Namespace {
334 return r.findNamespace(filepath.Dir(ctx.ModulePath()))
337 func (r *NameResolver) UniqueName(ctx blueprint.NamespaceContext, name string) (unique string) {
338 prefix := r.findNamespaceFromCtx(ctx).id