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

Also minor cleanups for the stack itself.
This commit is contained in:
Richard Smith authored and GitHub committed 2023-12-14 20:57:03 +00:00
1 parent fbb4ecf319
commit 0a1abe9f64
9 files changed
+76 -66

No files matched your search

+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");
}