Parse support for tuple patterns in var and let (#3448)

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
Geoff Romer
2023-12-08 01:16:03 +00:00
committed by GitHub
co-authored by Richard Smith
parent 8ace1dcb78
commit 39750b9925
27 changed files with 181 additions and 104 deletions
+18
View File
@@ -0,0 +1,18 @@
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "toolchain/parse/context.h"
namespace Carbon::Parse {
auto HandlePattern(Context& context) -> void {
context.PopAndDiscardState();
if (context.PositionKind() == Lex::TokenKind::OpenParen) {
context.PushState(State::ParamListAsRegular);
} else {
context.PushState(State::BindingPattern);
}
}
} // namespace Carbon::Parse