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 -3
View File
@@ -21,9 +21,8 @@ auto HandleArrayExprSemi(Context& context, Parse::NodeId parse_node) -> bool {
auto HandleArrayExpr(Context& context, Parse::NodeId parse_node) -> bool {
// TODO: Handle array type with undefined bound.
if (context.parse_tree().node_kind(context.node_stack().PeekParseNode()) ==
Parse::NodeKind::ArrayExprSemi) {
context.node_stack().PopAndIgnore();
if (context.node_stack()
.PopAndDiscardSoloParseNodeIf<Parse::NodeKind::ArrayExprSemi>()) {
context.node_stack().PopAndIgnore();
return context.TODO(parse_node, "HandleArrayExprWithoutBounds");
}