mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-02 10:15:51 +01:00
Remove support for addr (#6375)
Every test that used `addr` before #6283 should be using `ref` after this PR. In most cases that was done in #6283, but this PR transitions a few that I missed in that first pass. In addition, #6283 cloned the old `addr` tests from `foo.carbon` to `foo_addr.carbon` in order to maintain test coverage during the transition; this PR removes those cloned tests.
This commit is contained in:
@@ -11,15 +11,6 @@ namespace Carbon::Parse {
|
||||
auto HandleBindingPattern(Context& context) -> void {
|
||||
auto state = context.PopState();
|
||||
|
||||
// An `addr` pattern may wrap the binding, and becomes the parent of the
|
||||
// `BindingPattern`.
|
||||
if (auto token = context.ConsumeIf(Lex::TokenKind::Addr)) {
|
||||
context.PushState({.kind = StateKind::BindingPatternAddr,
|
||||
.in_var_pattern = state.in_var_pattern,
|
||||
.token = *token,
|
||||
.subtree_start = state.subtree_start});
|
||||
}
|
||||
|
||||
// Handle an invalid pattern introducer for parameters and variables.
|
||||
auto on_error = [&](bool expected_name) {
|
||||
if (!state.has_error) {
|
||||
@@ -145,15 +136,4 @@ auto HandleBindingPatternFinishAsRegular(Context& context) -> void {
|
||||
HandleBindingPatternFinish(context, /*is_compile_time=*/false);
|
||||
}
|
||||
|
||||
auto HandleBindingPatternAddr(Context& context) -> void {
|
||||
auto state = context.PopState();
|
||||
|
||||
context.AddNode(NodeKind::Addr, state.token, state.has_error);
|
||||
|
||||
// If an error was encountered, propagate it while adding a node.
|
||||
if (state.has_error) {
|
||||
context.ReturnErrorOnState();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Carbon::Parse
|
||||
|
||||
Reference in New Issue
Block a user