Clean up some uses of the node stack. (#3512)

Also minor cleanups for the stack itself.
This commit is contained in:
Richard Smith
2023-12-14 20:57:03 +00:00
committed by GitHub
parent fbb4ecf319
commit 0a1abe9f64
9 changed files with 76 additions and 66 deletions
+2 -2
View File
@@ -57,8 +57,8 @@ auto HandleBindingPattern(Context& context, Parse::NodeId parse_node) -> bool {
// error locations.
// TODO: The node stack is a fragile way of getting context information.
// Get this information from somewhere else.
switch (auto context_parse_node_kind = context.parse_tree().node_kind(
context.node_stack().PeekParseNode())) {
switch (auto context_parse_node_kind =
context.node_stack().PeekParseNodeKind()) {
case Parse::NodeKind::ReturnedModifier:
case Parse::NodeKind::VariableIntroducer: {
// A `var` declaration at class scope introduces a field.