Skip to content

Commit 45429b3

Browse files
committed
Patterns parser: remove bogus error recovery logic.
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]>
1 parent afe69ed commit 45429b3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10098,14 +10098,12 @@ class Parser {
1009810098
break;
1009910099
}
1010010100
Token? colon = null;
10101-
// TODO(paulberry): test error recovery
1010210101
if (optional(':', next)) {
1010310102
wasRecord = true;
1010410103
wasValidRecord = true;
1010510104
listener.handleNoName(token);
1010610105
colon = token = next;
10107-
} else if (optional(':', next.next!) || /* recovery */
10108-
optional(':', next)) {
10106+
} else if (optional(':', next.next!)) {
1010910107
// Record with named expression.
1011010108
wasRecord = true;
1011110109
token = ensureIdentifier(

0 commit comments

Comments
 (0)