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

Unified Diff: pkg/analyzer/test/generated/parser_test.dart

Issue 1413953003: Improve incomplete for-each parsing. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | « pkg/analyzer/lib/src/generated/parser.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/parser_test.dart
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index 3f8a6616650a638b3142dffe6962480b14273eda..51e49416a3f3ff135984b366eafa3e9cab210d78 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -3549,6 +3549,18 @@ class C {
expect(field.name.isSynthetic, isTrue);
}
+ void test_incompleteForEach() {
+ ForStatement statement = ParserTestCase.parseStatement(
+ 'for (String item i) {}',
+ [ParserErrorCode.EXPECTED_TOKEN, ParserErrorCode.EXPECTED_TOKEN]);
+ expect(statement, new isInstanceOf<ForStatement>());
+ expect(statement.toSource(), 'for (String item; i;) {}');
+ expect(statement.leftSeparator, isNotNull);
+ expect(statement.leftSeparator.type, TokenType.SEMICOLON);
+ expect(statement.rightSeparator, isNotNull);
+ expect(statement.rightSeparator.type, TokenType.SEMICOLON);
+ }
+
void test_incompleteLocalVariable_atTheEndOfBlock() {
Statement statement = ParserTestCase.parseStatement(
'String v }', [ParserErrorCode.EXPECTED_TOKEN]);
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698