mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user