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

Unified Diff: compiler/javatests/com/google/dart/compiler/parser/ParserRecoveryTest.java

Issue 11340033: Issue 5847. Parse incomplete function expression without body (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use skipTypeName() Created 8 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
Index: compiler/javatests/com/google/dart/compiler/parser/ParserRecoveryTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/parser/ParserRecoveryTest.java b/compiler/javatests/com/google/dart/compiler/parser/ParserRecoveryTest.java
index 6c4f95b9c7d5910e5f4c531d61fd8fb06622ab6c..b615cdfc50217fb0ef5307c5f578a6f6d4dae4bd 100644
--- a/compiler/javatests/com/google/dart/compiler/parser/ParserRecoveryTest.java
+++ b/compiler/javatests/com/google/dart/compiler/parser/ParserRecoveryTest.java
@@ -48,6 +48,63 @@ public class ParserRecoveryTest extends AbstractParserTest {
// Implemented elsewhere
}
+ public void test_incompleteFunctionExpression() {
+ DartParserRunner parserRunner = parseSource(Joiner.on("\n").join(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "main() {",
+ " var v = (AAA a, BB)",
+ "}"));
+ DartUnit unit = parserRunner.getDartUnit();
+ assertEquals(
+ Joiner.on("\n").join(
+ "// unit test_incompleteFunctionExpression",
+ "",
+ "main() {",
+ " var v = (AAA a, BB) {",
+ " };",
+ "}",
+ ""),
+ unit.toString());
+ }
+
+ public void test_incompleteFunctionExpression_qualifiedType() {
+ DartParserRunner parserRunner = parseSource(Joiner.on("\n").join(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "main() {",
+ " var v = (pref.AAA a, BB)",
+ "}"));
+ DartUnit unit = parserRunner.getDartUnit();
+ assertEquals(
+ Joiner.on("\n").join(
+ "// unit test_incompleteFunctionExpression_qualifiedType",
+ "",
+ "main() {",
+ " var v = (pref.AAA a, BB) {",
+ " };",
+ "}",
+ ""),
+ unit.toString());
+ }
+
+ public void test_incompleteFunctionExpression_typeArguments() {
+ DartParserRunner parserRunner = parseSource(Joiner.on("\n").join(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "main() {",
+ " var v = (AAA<T1, T2<T3, T4>, T5> a, BB)",
+ "}"));
+ DartUnit unit = parserRunner.getDartUnit();
+ assertEquals(
+ Joiner.on("\n").join(
+ "// unit test_incompleteFunctionExpression_typeArguments",
+ "",
+ "main() {",
+ " var v = (AAA<T1, T2<T3, T4>, T5> a, BB) {",
+ " };",
+ "}",
+ ""),
+ unit.toString());
+ }
+
public void testVarOnMethodDefinition() {
// This syntax is illegal, and should produce errors, but since it is a common error,
// we want to make sure it produce a valid AST for editor users

Powered by Google App Engine
This is Rietveld 408576698