Rename enclosing scope to parent scope (#4020)

Following up on discussion from #3948, doing a general rename of
"enclosing scope" to "parent scope" (and "enclosing scopes" to "ancestor
scopes"). The intent is to improve understandability and collide less
with C++ terminology for "enclosing scope". Note this changes most uses
of "enclosing", but leaves behind a few like "enclosing function" and
"enclosing block".

Note this does create some "parent class" mentions for "adapt" and "var"
(the class they're within), which is maybe unfortunate, but we'd
probably say "base class" if we meant inheritance so perhaps that's
okay. Along the same lines, these are the only `parent_class` uses I see
now, and we do have a few `base_class`.
This commit is contained in:
Jon Ross-Perkins authored and GitHub committed 2024-06-04 19:57:14 +00:00
1 parent 83413479d7
commit d9c62b106d
33 files changed
+237 -257

No files matched your search

+3 -3
View File
@@ -81,10 +81,10 @@ auto ScopeStack::LookupInCurrentScope(SemIR::NameId name_id) -> SemIR::InstId {
return result.inst_id;
}
auto ScopeStack::LookupInEnclosingScopes(SemIR::NameId name_id)
auto ScopeStack::LookupInLexicalScopes(SemIR::NameId name_id)
-> std::pair<SemIR::InstId, llvm::ArrayRef<NonLexicalScope>> {
// Find the results from enclosing lexical scopes. These will be combined with
// results from non-lexical scopes such as namespaces and classes.
// Find the results from lexical scopes. These will be combined with results
// from non-lexical scopes such as namespaces and classes.
llvm::ArrayRef<LexicalLookup::Result> lexical_results =
lexical_lookup_.Get(name_id);