Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(617)

Unified Diff: pkg/analyzer/lib/src/generated/parser.dart

Issue 1839443002: Fix for labels and the 'inDeclarationContext' flag. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/parser.dart
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
index 010901226c40337b672c73e583c42f47a54b3e79..7e5bee84bb505d0e294a11f32fa90248f44fe613 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -3449,7 +3449,7 @@ class Parser {
Statement parseStatement2() {
List<Label> labels = new List<Label>();
while (_matchesIdentifier() && _tokenMatches(_peek(), TokenType.COLON)) {
- labels.add(parseLabel());
+ labels.add(parseLabel(isDeclaration: true));
}
Statement statement = _parseNonLabeledStatement();
if (labels.isEmpty) {
@@ -7743,7 +7743,8 @@ class Parser {
List<Label> labels = new List<Label>();
while (
_matchesIdentifier() && _tokenMatches(_peek(), TokenType.COLON)) {
- SimpleIdentifier identifier = parseSimpleIdentifier();
+ SimpleIdentifier identifier =
+ parseSimpleIdentifier(isDeclaration: true);
String label = identifier.token.lexeme;
if (definedLabels.contains(label)) {
_reportErrorForToken(
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698