Files
carbon-lang/toolchain/parse/handle_pattern.cpp
T
2023-12-08 23:35:47 +00:00

19 lines
542 B
C++

// 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::PatternListAsTuple);
} else {
context.PushState(State::BindingPattern);
}
}
} // namespace Carbon::Parse