Skip to content

Commit

Permalink
Patterns parser: remove bogus error recovery logic.
Browse files Browse the repository at this point in the history
The "recovery" condition `|| /* recovery */ optional(':', next)` had
no effect, because that case was already covered by the previous `if`
statement.

Bug: #50035
Change-Id: I4eeeeb2ff6b3558888f07c65d85e9f79e334d9eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292661
Reviewed-by: Konstantin Shcheglov <[email protected]>
  • Loading branch information
stereotype441 committed Apr 2, 2023
1 parent afe69ed commit 45429b3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10098,14 +10098,12 @@ class Parser {
break;
}
Token? colon = null;
// TODO(paulberry): test error recovery
if (optional(':', next)) {
wasRecord = true;
wasValidRecord = true;
listener.handleNoName(token);
colon = token = next;
} else if (optional(':', next.next!) || /* recovery */
optional(':', next)) {
} else if (optional(':', next.next!)) {
// Record with named expression.
wasRecord = true;
token = ensureIdentifier(
Expand Down

0 comments on commit 45429b3

Please sign in to comment.