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

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

Issue 1068263002: improve parser recovery for import statements (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 8d5bc82c5bc39fe1ff5f66b4dac979a8a77752b2..3cf943dcf9308ae8071dbac9f1e57ac4b988cce3 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -3269,7 +3269,7 @@ class B = Object with A {}''', [ParserErrorCode.EXPECTED_TOKEN]);
parseExpression("m(f() => 0);", [ParserErrorCode.EXPECTED_TOKEN]);
}
- void test_importDirectivePartial() {
+ void test_importDirectivePartial_as() {
CompilationUnit unit = ParserTestCase.parseCompilationUnit(
"import 'b.dart' d as b;",
[ParserErrorCode.UNEXPECTED_TOKEN]);
@@ -3279,6 +3279,26 @@ class B = Object with A {}''', [ParserErrorCode.EXPECTED_TOKEN]);
expect(unit.declarations, hasLength(0));
}
+ void test_importDirectivePartial_show() {
+ CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+ "import 'b.dart' d show foo;",
+ [ParserErrorCode.UNEXPECTED_TOKEN]);
+ ImportDirective importDirective = unit.childEntities.first;
+ expect(importDirective.combinators, hasLength(1));
+ expect(unit.directives, hasLength(1));
+ expect(unit.declarations, hasLength(0));
+ }
+
+ void test_importDirectivePartial_hide() {
+ CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+ "import 'b.dart' d hide foo;",
+ [ParserErrorCode.UNEXPECTED_TOKEN]);
+ ImportDirective importDirective = unit.childEntities.first;
+ expect(importDirective.combinators, hasLength(1));
+ 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