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 -2
View File
@@ -9,13 +9,13 @@ namespace Carbon::Check {
auto HandleCodeBlockStart(Context& context, Parse::CodeBlockStartId parse_node)
-> bool {
context.node_stack().Push(parse_node);
context.PushScope();
context.scope_stack().Push();
return true;
}
auto HandleCodeBlock(Context& context, Parse::CodeBlockId /*parse_node*/)
-> bool {
context.PopScope();
context.scope_stack().Pop();
context.node_stack()
.PopAndDiscardSoloParseNode<Parse::NodeKind::CodeBlockStart>();
return true;