Factor the scope stack and lexical lookups out of Check::Context. (#3688)

This commit is contained in:
Richard Smith
2024-02-06 00:59:52 +00:00
committed by GitHub
parent 524902b540
commit fdfb1fb5ef
17 changed files with 416 additions and 289 deletions
+2 -1
View File
@@ -26,7 +26,8 @@ auto HandleAnyBindingPattern(Context& context, Parse::NodeId parse_node,
// TODO: Eventually the name will need to support associations with other
// scopes, but right now we don't support qualified names here.
auto bind_name_id = context.bind_names().Add(
{.name_id = name_id, .enclosing_scope_id = context.current_scope_id()});
{.name_id = name_id,
.enclosing_scope_id = context.scope_stack().PeekNameScopeId()});
if (is_generic) {
// TODO: Create a `BindTemplateName` instead inside a `template` pattern.
return {name_node,