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:
Geoff Romer
2025-11-18 19:48:58 +00:00
committed by GitHub
parent ee49d65e29
commit 57a2715f10
76 changed files with 397 additions and 6442 deletions
@@ -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