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

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

Issue 2539243002: Transition analyzer and analysis_server to new astFactory; remove old AST factory methods. (Closed)
Patch Set: Update CHANGELOG Created 4 years 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: 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 6ce609fc7fa4c46f32b9503f453d05735baeccca..ad1ceaaf75d27fa7c019f3576e55b39127eff75f 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -5,6 +5,7 @@
library analyzer.test.generated.parser_test;
import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/ast/visitor.dart';
import 'package:analyzer/error/error.dart';
@@ -5066,7 +5067,7 @@ class SimpleParserTest extends ParserTestCase {
void test_parseAssignableSelector_none() {
createParser(';');
Expression expression =
- parser.parseAssignableSelector(new SimpleIdentifier(null), true);
+ parser.parseAssignableSelector(astFactory.simpleIdentifier(null), true);
expectNotNullIfNoErrors(expression);
listener.assertNoErrors();
expect(expression, new isInstanceOf<SimpleIdentifier>());
@@ -9423,8 +9424,9 @@ void''');
}
void test_parseFunctionDeclaration_function() {
- Comment comment = Comment.createDocumentationComment(new List<Token>(0));
- TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
+ Comment comment = astFactory.documentationComment(new List<Token>(0));
+ TypeName returnType =
+ astFactory.typeName(astFactory.simpleIdentifier(null), null);
createParser('f() {}');
FunctionDeclaration declaration = parser.parseFunctionDeclaration(
commentAndMetadata(comment), null, returnType);
@@ -9442,8 +9444,9 @@ void''');
}
void test_parseFunctionDeclaration_functionWithTypeParameters() {
- Comment comment = Comment.createDocumentationComment(new List<Token>(0));
- TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
+ Comment comment = astFactory.documentationComment(new List<Token>(0));
+ TypeName returnType =
+ astFactory.typeName(astFactory.simpleIdentifier(null), null);
createParser('f<E>() {}');
FunctionDeclaration declaration = parser.parseFunctionDeclaration(
commentAndMetadata(comment), null, returnType);
@@ -9462,8 +9465,9 @@ void''');
void test_parseFunctionDeclaration_functionWithTypeParameters_comment() {
enableGenericMethodComments = true;
- Comment comment = Comment.createDocumentationComment(new List<Token>(0));
- TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
+ Comment comment = astFactory.documentationComment(new List<Token>(0));
+ TypeName returnType =
+ astFactory.typeName(astFactory.simpleIdentifier(null), null);
createParser('f/*<E>*/() {}');
FunctionDeclaration declaration = parser.parseFunctionDeclaration(
commentAndMetadata(comment), null, returnType);
@@ -9481,8 +9485,9 @@ void''');
}
void test_parseFunctionDeclaration_getter() {
- Comment comment = Comment.createDocumentationComment(new List<Token>(0));
- TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
+ Comment comment = astFactory.documentationComment(new List<Token>(0));
+ TypeName returnType =
+ astFactory.typeName(astFactory.simpleIdentifier(null), null);
createParser('get p => 0;');
FunctionDeclaration declaration = parser.parseFunctionDeclaration(
commentAndMetadata(comment), null, returnType);
@@ -9500,8 +9505,9 @@ void''');
}
void test_parseFunctionDeclaration_setter() {
- Comment comment = Comment.createDocumentationComment(new List<Token>(0));
- TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
+ Comment comment = astFactory.documentationComment(new List<Token>(0));
+ TypeName returnType =
+ astFactory.typeName(astFactory.simpleIdentifier(null), null);
createParser('set p(v) {}');
FunctionDeclaration declaration = parser.parseFunctionDeclaration(
commentAndMetadata(comment), null, returnType);
@@ -9590,8 +9596,9 @@ void''');
}
void test_parseGetter_nonStatic() {
- Comment comment = Comment.createDocumentationComment(new List<Token>(0));
- TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
+ Comment comment = astFactory.documentationComment(new List<Token>(0));
+ TypeName returnType =
+ astFactory.typeName(astFactory.simpleIdentifier(null), null);
createParser('get a;');
MethodDeclaration method =
parser.parseGetter(commentAndMetadata(comment), null, null, returnType);
@@ -9609,9 +9616,10 @@ void''');
}
void test_parseGetter_static() {
- Comment comment = Comment.createDocumentationComment(new List<Token>(0));
+ Comment comment = astFactory.documentationComment(new List<Token>(0));
Token staticKeyword = TokenFactory.tokenFromKeyword(Keyword.STATIC);
- TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
+ TypeName returnType =
+ astFactory.typeName(astFactory.simpleIdentifier(null), null);
createParser('get a => 42;');
MethodDeclaration method = parser.parseGetter(
commentAndMetadata(comment), null, staticKeyword, returnType);
@@ -9860,9 +9868,10 @@ void''');
}
void test_parseInitializedIdentifierList_type() {
- Comment comment = Comment.createDocumentationComment(new List<Token>(0));
+ Comment comment = astFactory.documentationComment(new List<Token>(0));
Token staticKeyword = TokenFactory.tokenFromKeyword(Keyword.STATIC);
- TypeName type = new TypeName(new SimpleIdentifier(null), null);
+ TypeName type =
+ astFactory.typeName(astFactory.simpleIdentifier(null), null);
createParser("a = 1, b, c = 3;");
FieldDeclaration declaration = parser.parseInitializedIdentifierList(
commentAndMetadata(comment), staticKeyword, null, type);
@@ -9879,7 +9888,7 @@ void''');
}
void test_parseInitializedIdentifierList_var() {
- Comment comment = Comment.createDocumentationComment(new List<Token>(0));
+ Comment comment = astFactory.documentationComment(new List<Token>(0));
Token staticKeyword = TokenFactory.tokenFromKeyword(Keyword.STATIC);
Token varKeyword = TokenFactory.tokenFromKeyword(Keyword.VAR);
createParser('a = 1, b, c = 3;');
@@ -11071,8 +11080,9 @@ void''');
}
void test_parseOperator() {
- Comment comment = Comment.createDocumentationComment(new List<Token>(0));
- TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
+ Comment comment = astFactory.documentationComment(new List<Token>(0));
+ TypeName returnType =
+ astFactory.typeName(astFactory.simpleIdentifier(null), null);
createParser('operator +(A a);');
MethodDeclaration method =
parser.parseOperator(commentAndMetadata(comment), null, returnType);
@@ -11729,8 +11739,9 @@ void''');
}
void test_parseSetter_nonStatic() {
- Comment comment = Comment.createDocumentationComment(new List<Token>(0));
- TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
+ Comment comment = astFactory.documentationComment(new List<Token>(0));
+ TypeName returnType =
+ astFactory.typeName(astFactory.simpleIdentifier(null), null);
createParser('set a(var x);');
MethodDeclaration method =
parser.parseSetter(commentAndMetadata(comment), null, null, returnType);
@@ -11749,9 +11760,10 @@ void''');
}
void test_parseSetter_static() {
- Comment comment = Comment.createDocumentationComment(new List<Token>(0));
+ Comment comment = astFactory.documentationComment(new List<Token>(0));
Token staticKeyword = TokenFactory.tokenFromKeyword(Keyword.STATIC);
- TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
+ TypeName returnType =
+ astFactory.typeName(astFactory.simpleIdentifier(null), null);
createParser('set a(var x) {}');
MethodDeclaration method = parser.parseSetter(
commentAndMetadata(comment), null, staticKeyword, returnType);
@@ -13118,7 +13130,8 @@ void''');
}
void test_parseVariableDeclarationListAfterType_type() {
- TypeName type = new TypeName(new SimpleIdentifier(null), null);
+ TypeName type =
+ astFactory.typeName(astFactory.simpleIdentifier(null), null);
createParser('a');
VariableDeclarationList declarationList =
parser.parseVariableDeclarationListAfterType(

Powered by Google App Engine
This is Rietveld 408576698