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

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

Issue 1062343002: improve parser recovery for import directives (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 8 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 593892623ca06f2cb7509cc94450c71508a2fb9a..8d5bc82c5bc39fe1ff5f66b4dac979a8a77752b2 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -3269,6 +3269,16 @@ class B = Object with A {}''', [ParserErrorCode.EXPECTED_TOKEN]);
parseExpression("m(f() => 0);", [ParserErrorCode.EXPECTED_TOKEN]);
}
+ void test_importDirectivePartial() {
+ CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+ "import 'b.dart' d as b;",
+ [ParserErrorCode.UNEXPECTED_TOKEN]);
+ ImportDirective importDirective = unit.childEntities.first;
+ expect(importDirective.asKeyword, isNotNull);
+ expect(unit.directives, hasLength(1));
+ expect(unit.declarations, hasLength(0));
+ }
+
void test_incomplete_conditionalExpression() {
parseExpression("x ? 0", [
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