mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 18:01:07 +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:
@@ -470,10 +470,9 @@ auto Context::AddFunctionDefinitionStart(Lex::TokenIndex token,
|
||||
int subtree_start, bool has_error)
|
||||
-> void {
|
||||
if (ParsingInDeferredDefinitionScope(*this)) {
|
||||
enclosing_deferred_definition_stack_.push_back(
|
||||
tree_->deferred_definitions_.Add(
|
||||
{.start_id = FunctionDefinitionStartId(
|
||||
NodeId(tree_->node_impls_.size()))}));
|
||||
deferred_definition_stack_.push_back(tree_->deferred_definitions_.Add(
|
||||
{.start_id =
|
||||
FunctionDefinitionStartId(NodeId(tree_->node_impls_.size()))}));
|
||||
}
|
||||
|
||||
AddNode(NodeKind::FunctionDefinitionStart, token, subtree_start, has_error);
|
||||
@@ -482,7 +481,7 @@ auto Context::AddFunctionDefinitionStart(Lex::TokenIndex token,
|
||||
auto Context::AddFunctionDefinition(Lex::TokenIndex token, int subtree_start,
|
||||
bool has_error) -> void {
|
||||
if (ParsingInDeferredDefinitionScope(*this)) {
|
||||
auto definition_index = enclosing_deferred_definition_stack_.pop_back_val();
|
||||
auto definition_index = deferred_definition_stack_.pop_back_val();
|
||||
auto& definition = tree_->deferred_definitions_.Get(definition_index);
|
||||
definition.definition_id =
|
||||
FunctionDefinitionId(NodeId(tree_->node_impls_.size()));
|
||||
|
||||
Reference in New Issue
Block a user