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

Side by Side Diff: pkg/analyzer_experimental/test/generated/ast_test.dart

Issue 14308011: New Analysis Engine snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // This code was auto-generated, is not intended to be edited, and is subject to 1 // This code was auto-generated, is not intended to be edited, and is subject to
2 // significant change. Please see the README file for more information. 2 // significant change. Please see the README file for more information.
3 3
4 library engine.ast_test; 4 library engine.ast_test;
5 5
6 import 'dart:collection'; 6 import 'dart:collection';
7 import 'package:analyzer_experimental/src/generated/java_core.dart'; 7 import 'package:analyzer_experimental/src/generated/java_core.dart';
8 import 'package:analyzer_experimental/src/generated/java_engine.dart'; 8 import 'package:analyzer_experimental/src/generated/java_engine.dart';
9 import 'package:analyzer_experimental/src/generated/java_junit.dart'; 9 import 'package:analyzer_experimental/src/generated/java_junit.dart';
10 import 'package:analyzer_experimental/src/generated/source.dart'; 10 import 'package:analyzer_experimental/src/generated/source.dart';
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 }); 46 });
47 _ut.test('test_range', () { 47 _ut.test('test_range', () {
48 final __test = new NodeLocatorTest(); 48 final __test = new NodeLocatorTest();
49 runJUnitTest(__test, __test.test_range); 49 runJUnitTest(__test, __test.test_range);
50 }); 50 });
51 }); 51 });
52 } 52 }
53 } 53 }
54 class IndexExpressionTest extends EngineTestCase { 54 class IndexExpressionTest extends EngineTestCase {
55 void test_inGetterContext_assignment_compound_left() { 55 void test_inGetterContext_assignment_compound_left() {
56 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r2("a"), ASTFactory.identifier2("b")); 56 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r3("a"), ASTFactory.identifier3("b"));
57 ASTFactory.assignmentExpression(expression, TokenType.PLUS_EQ, null); 57 ASTFactory.assignmentExpression(expression, TokenType.PLUS_EQ, null);
58 JUnitTestCase.assertTrue(expression.inGetterContext()); 58 JUnitTestCase.assertTrue(expression.inGetterContext());
59 } 59 }
60 void test_inGetterContext_assignment_simple_left() { 60 void test_inGetterContext_assignment_simple_left() {
61 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r2("a"), ASTFactory.identifier2("b")); 61 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r3("a"), ASTFactory.identifier3("b"));
62 ASTFactory.assignmentExpression(expression, TokenType.EQ, null); 62 ASTFactory.assignmentExpression(expression, TokenType.EQ, null);
63 JUnitTestCase.assertFalse(expression.inGetterContext()); 63 JUnitTestCase.assertFalse(expression.inGetterContext());
64 } 64 }
65 void test_inGetterContext_nonAssignment() { 65 void test_inGetterContext_nonAssignment() {
66 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r2("a"), ASTFactory.identifier2("b")); 66 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r3("a"), ASTFactory.identifier3("b"));
67 ASTFactory.binaryExpression(expression, TokenType.PLUS, null); 67 ASTFactory.binaryExpression(expression, TokenType.PLUS, null);
68 JUnitTestCase.assertTrue(expression.inGetterContext()); 68 JUnitTestCase.assertTrue(expression.inGetterContext());
69 } 69 }
70 void test_inSetterContext_assignment_compound_left() { 70 void test_inSetterContext_assignment_compound_left() {
71 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r2("a"), ASTFactory.identifier2("b")); 71 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r3("a"), ASTFactory.identifier3("b"));
72 ASTFactory.assignmentExpression(expression, TokenType.PLUS_EQ, null); 72 ASTFactory.assignmentExpression(expression, TokenType.PLUS_EQ, null);
73 JUnitTestCase.assertTrue(expression.inSetterContext()); 73 JUnitTestCase.assertTrue(expression.inSetterContext());
74 } 74 }
75 void test_inSetterContext_assignment_compound_right() { 75 void test_inSetterContext_assignment_compound_right() {
76 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r2("a"), ASTFactory.identifier2("b")); 76 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r3("a"), ASTFactory.identifier3("b"));
77 ASTFactory.assignmentExpression(null, TokenType.PLUS_EQ, expression); 77 ASTFactory.assignmentExpression(null, TokenType.PLUS_EQ, expression);
78 JUnitTestCase.assertFalse(expression.inSetterContext()); 78 JUnitTestCase.assertFalse(expression.inSetterContext());
79 } 79 }
80 void test_inSetterContext_assignment_simple_left() { 80 void test_inSetterContext_assignment_simple_left() {
81 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r2("a"), ASTFactory.identifier2("b")); 81 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r3("a"), ASTFactory.identifier3("b"));
82 ASTFactory.assignmentExpression(expression, TokenType.EQ, null); 82 ASTFactory.assignmentExpression(expression, TokenType.EQ, null);
83 JUnitTestCase.assertTrue(expression.inSetterContext()); 83 JUnitTestCase.assertTrue(expression.inSetterContext());
84 } 84 }
85 void test_inSetterContext_assignment_simple_right() { 85 void test_inSetterContext_assignment_simple_right() {
86 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r2("a"), ASTFactory.identifier2("b")); 86 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r3("a"), ASTFactory.identifier3("b"));
87 ASTFactory.assignmentExpression(null, TokenType.EQ, expression); 87 ASTFactory.assignmentExpression(null, TokenType.EQ, expression);
88 JUnitTestCase.assertFalse(expression.inSetterContext()); 88 JUnitTestCase.assertFalse(expression.inSetterContext());
89 } 89 }
90 void test_inSetterContext_nonAssignment() { 90 void test_inSetterContext_nonAssignment() {
91 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r2("a"), ASTFactory.identifier2("b")); 91 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r3("a"), ASTFactory.identifier3("b"));
92 ASTFactory.binaryExpression(expression, TokenType.PLUS, null); 92 ASTFactory.binaryExpression(expression, TokenType.PLUS, null);
93 JUnitTestCase.assertFalse(expression.inSetterContext()); 93 JUnitTestCase.assertFalse(expression.inSetterContext());
94 } 94 }
95 void test_inSetterContext_postfix() { 95 void test_inSetterContext_postfix() {
96 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r2("a"), ASTFactory.identifier2("b")); 96 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r3("a"), ASTFactory.identifier3("b"));
97 ASTFactory.postfixExpression(expression, TokenType.PLUS_PLUS); 97 ASTFactory.postfixExpression(expression, TokenType.PLUS_PLUS);
98 JUnitTestCase.assertTrue(expression.inSetterContext()); 98 JUnitTestCase.assertTrue(expression.inSetterContext());
99 } 99 }
100 void test_inSetterContext_prefix_bang() { 100 void test_inSetterContext_prefix_bang() {
101 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r2("a"), ASTFactory.identifier2("b")); 101 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r3("a"), ASTFactory.identifier3("b"));
102 ASTFactory.prefixExpression(TokenType.BANG, expression); 102 ASTFactory.prefixExpression(TokenType.BANG, expression);
103 JUnitTestCase.assertFalse(expression.inSetterContext()); 103 JUnitTestCase.assertFalse(expression.inSetterContext());
104 } 104 }
105 void test_inSetterContext_prefix_minusMinus() { 105 void test_inSetterContext_prefix_minusMinus() {
106 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r2("a"), ASTFactory.identifier2("b")); 106 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r3("a"), ASTFactory.identifier3("b"));
107 ASTFactory.prefixExpression(TokenType.MINUS_MINUS, expression); 107 ASTFactory.prefixExpression(TokenType.MINUS_MINUS, expression);
108 JUnitTestCase.assertTrue(expression.inSetterContext()); 108 JUnitTestCase.assertTrue(expression.inSetterContext());
109 } 109 }
110 void test_inSetterContext_prefix_plusPlus() { 110 void test_inSetterContext_prefix_plusPlus() {
111 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r2("a"), ASTFactory.identifier2("b")); 111 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r3("a"), ASTFactory.identifier3("b"));
112 ASTFactory.prefixExpression(TokenType.PLUS_PLUS, expression); 112 ASTFactory.prefixExpression(TokenType.PLUS_PLUS, expression);
113 JUnitTestCase.assertTrue(expression.inSetterContext()); 113 JUnitTestCase.assertTrue(expression.inSetterContext());
114 } 114 }
115 static dartSuite() { 115 static dartSuite() {
116 _ut.group('IndexExpressionTest', () { 116 _ut.group('IndexExpressionTest', () {
117 _ut.test('test_inGetterContext_assignment_compound_left', () { 117 _ut.test('test_inGetterContext_assignment_compound_left', () {
118 final __test = new IndexExpressionTest(); 118 final __test = new IndexExpressionTest();
119 runJUnitTest(__test, __test.test_inGetterContext_assignment_compound_lef t); 119 runJUnitTest(__test, __test.test_inGetterContext_assignment_compound_lef t);
120 }); 120 });
121 _ut.test('test_inGetterContext_assignment_simple_left', () { 121 _ut.test('test_inGetterContext_assignment_simple_left', () {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 * The general pattern is for the name of the factory method to be the same as t he name of the class 174 * The general pattern is for the name of the factory method to be the same as t he name of the class
175 * of AST node being created. There are two notable exceptions. The first is for methods creating 175 * of AST node being created. There are two notable exceptions. The first is for methods creating
176 * nodes that are part of a cascade expression. These methods are all prefixed w ith 'cascaded'. The 176 * nodes that are part of a cascade expression. These methods are all prefixed w ith 'cascaded'. The
177 * second is places where a shorter name seemed unambiguous and easier to read, such as using 177 * second is places where a shorter name seemed unambiguous and easier to read, such as using
178 * 'identifier' rather than 'prefixedIdentifier', or 'integer' rather than 'inte gerLiteral'. 178 * 'identifier' rather than 'prefixedIdentifier', or 'integer' rather than 'inte gerLiteral'.
179 */ 179 */
180 class ASTFactory { 180 class ASTFactory {
181 static AdjacentStrings adjacentStrings(List<StringLiteral> strings) => new Adj acentStrings.full(list(strings)); 181 static AdjacentStrings adjacentStrings(List<StringLiteral> strings) => new Adj acentStrings.full(list(strings));
182 static Annotation annotation(Identifier name) => new Annotation.full(TokenFact ory.token3(TokenType.AT), name, null, null, null); 182 static Annotation annotation(Identifier name) => new Annotation.full(TokenFact ory.token3(TokenType.AT), name, null, null, null);
183 static Annotation annotation2(Identifier name, SimpleIdentifier constructorNam e, ArgumentList arguments) => new Annotation.full(TokenFactory.token3(TokenType. AT), name, TokenFactory.token3(TokenType.PERIOD), constructorName, arguments); 183 static Annotation annotation2(Identifier name, SimpleIdentifier constructorNam e, ArgumentList arguments) => new Annotation.full(TokenFactory.token3(TokenType. AT), name, TokenFactory.token3(TokenType.PERIOD), constructorName, arguments);
184 static ArgumentDefinitionTest argumentDefinitionTest(String identifier) => new ArgumentDefinitionTest.full(TokenFactory.token3(TokenType.QUESTION), identifier 2(identifier)); 184 static ArgumentDefinitionTest argumentDefinitionTest(String identifier) => new ArgumentDefinitionTest.full(TokenFactory.token3(TokenType.QUESTION), identifier 3(identifier));
185 static ArgumentList argumentList(List<Expression> arguments) => new ArgumentLi st.full(TokenFactory.token3(TokenType.OPEN_PAREN), list(arguments), TokenFactory .token3(TokenType.CLOSE_PAREN)); 185 static ArgumentList argumentList(List<Expression> arguments) => new ArgumentLi st.full(TokenFactory.token3(TokenType.OPEN_PAREN), list(arguments), TokenFactory .token3(TokenType.CLOSE_PAREN));
186 static AsExpression asExpression(Expression expression, TypeName type) => new AsExpression.full(expression, TokenFactory.token(Keyword.AS), type); 186 static AsExpression asExpression(Expression expression, TypeName type) => new AsExpression.full(expression, TokenFactory.token(Keyword.AS), type);
187 static AssertStatement assertStatement(Expression condition) => new AssertStat ement.full(TokenFactory.token(Keyword.ASSERT), TokenFactory.token3(TokenType.OPE N_PAREN), condition, TokenFactory.token3(TokenType.CLOSE_PAREN), TokenFactory.to ken3(TokenType.SEMICOLON)); 187 static AssertStatement assertStatement(Expression condition) => new AssertStat ement.full(TokenFactory.token(Keyword.ASSERT), TokenFactory.token3(TokenType.OPE N_PAREN), condition, TokenFactory.token3(TokenType.CLOSE_PAREN), TokenFactory.to ken3(TokenType.SEMICOLON));
188 static AssignmentExpression assignmentExpression(Expression leftHandSide, Toke nType operator, Expression rightHandSide) => new AssignmentExpression.full(leftH andSide, TokenFactory.token3(operator), rightHandSide); 188 static AssignmentExpression assignmentExpression(Expression leftHandSide, Toke nType operator, Expression rightHandSide) => new AssignmentExpression.full(leftH andSide, TokenFactory.token3(operator), rightHandSide);
189 static BinaryExpression binaryExpression(Expression leftOperand, TokenType ope rator, Expression rightOperand) => new BinaryExpression.full(leftOperand, TokenF actory.token3(operator), rightOperand); 189 static BinaryExpression binaryExpression(Expression leftOperand, TokenType ope rator, Expression rightOperand) => new BinaryExpression.full(leftOperand, TokenF actory.token3(operator), rightOperand);
190 static Block block(List<Statement> statements) => new Block.full(TokenFactory. token3(TokenType.OPEN_CURLY_BRACKET), list(statements), TokenFactory.token3(Toke nType.CLOSE_CURLY_BRACKET)); 190 static Block block(List<Statement> statements) => new Block.full(TokenFactory. token3(TokenType.OPEN_CURLY_BRACKET), list(statements), TokenFactory.token3(Toke nType.CLOSE_CURLY_BRACKET));
191 static BlockFunctionBody blockFunctionBody(List<Statement> statements) => new BlockFunctionBody.full(block(statements)); 191 static BlockFunctionBody blockFunctionBody(List<Statement> statements) => new BlockFunctionBody.full(block(statements));
192 static BooleanLiteral booleanLiteral(bool value) => new BooleanLiteral.full(va lue ? TokenFactory.token(Keyword.TRUE) : TokenFactory.token(Keyword.FALSE), valu e); 192 static BooleanLiteral booleanLiteral(bool value) => new BooleanLiteral.full(va lue ? TokenFactory.token(Keyword.TRUE) : TokenFactory.token(Keyword.FALSE), valu e);
193 static BreakStatement breakStatement() => new BreakStatement.full(TokenFactory .token(Keyword.BREAK), null, TokenFactory.token3(TokenType.SEMICOLON)); 193 static BreakStatement breakStatement() => new BreakStatement.full(TokenFactory .token(Keyword.BREAK), null, TokenFactory.token3(TokenType.SEMICOLON));
194 static BreakStatement breakStatement2(String label) => new BreakStatement.full (TokenFactory.token(Keyword.BREAK), identifier2(label), TokenFactory.token3(Toke nType.SEMICOLON)); 194 static BreakStatement breakStatement2(String label) => new BreakStatement.full (TokenFactory.token(Keyword.BREAK), identifier3(label), TokenFactory.token3(Toke nType.SEMICOLON));
195 static IndexExpression cascadedIndexExpression(Expression index) => new IndexE xpression.forCascade_full(TokenFactory.token3(TokenType.PERIOD_PERIOD), TokenFac tory.token3(TokenType.OPEN_SQUARE_BRACKET), index, TokenFactory.token3(TokenType .CLOSE_SQUARE_BRACKET)); 195 static IndexExpression cascadedIndexExpression(Expression index) => new IndexE xpression.forCascade_full(TokenFactory.token3(TokenType.PERIOD_PERIOD), TokenFac tory.token3(TokenType.OPEN_SQUARE_BRACKET), index, TokenFactory.token3(TokenType .CLOSE_SQUARE_BRACKET));
196 static MethodInvocation cascadedMethodInvocation(String methodName, List<Expre ssion> arguments) => new MethodInvocation.full(null, TokenFactory.token3(TokenTy pe.PERIOD_PERIOD), identifier2(methodName), argumentList(arguments)); 196 static MethodInvocation cascadedMethodInvocation(String methodName, List<Expre ssion> arguments) => new MethodInvocation.full(null, TokenFactory.token3(TokenTy pe.PERIOD_PERIOD), identifier3(methodName), argumentList(arguments));
197 static PropertyAccess cascadedPropertyAccess(String propertyName) => new Prope rtyAccess.full(null, TokenFactory.token3(TokenType.PERIOD_PERIOD), identifier2(p ropertyName)); 197 static PropertyAccess cascadedPropertyAccess(String propertyName) => new Prope rtyAccess.full(null, TokenFactory.token3(TokenType.PERIOD_PERIOD), identifier3(p ropertyName));
198 static CascadeExpression cascadeExpression(Expression target, List<Expression> cascadeSections) => new CascadeExpression.full(target, list(cascadeSections)); 198 static CascadeExpression cascadeExpression(Expression target, List<Expression> cascadeSections) => new CascadeExpression.full(target, list(cascadeSections));
199 static CatchClause catchClause(String exceptionParameter, List<Statement> stat ements) => catchClause5(null, exceptionParameter, null, statements); 199 static CatchClause catchClause(String exceptionParameter, List<Statement> stat ements) => catchClause5(null, exceptionParameter, null, statements);
200 static CatchClause catchClause2(String exceptionParameter, String stackTracePa rameter, List<Statement> statements) => catchClause5(null, exceptionParameter, s tackTraceParameter, statements); 200 static CatchClause catchClause2(String exceptionParameter, String stackTracePa rameter, List<Statement> statements) => catchClause5(null, exceptionParameter, s tackTraceParameter, statements);
201 static CatchClause catchClause3(TypeName exceptionType, List<Statement> statem ents) => catchClause5(exceptionType, null, null, statements); 201 static CatchClause catchClause3(TypeName exceptionType, List<Statement> statem ents) => catchClause5(exceptionType, null, null, statements);
202 static CatchClause catchClause4(TypeName exceptionType, String exceptionParame ter, List<Statement> statements) => catchClause5(exceptionType, exceptionParamet er, null, statements); 202 static CatchClause catchClause4(TypeName exceptionType, String exceptionParame ter, List<Statement> statements) => catchClause5(exceptionType, exceptionParamet er, null, statements);
203 static CatchClause catchClause5(TypeName exceptionType, String exceptionParame ter, String stackTraceParameter, List<Statement> statements) => new CatchClause. full(exceptionType == null ? null : TokenFactory.token4(TokenType.IDENTIFIER, "o n"), exceptionType, exceptionParameter == null ? null : TokenFactory.token(Keywo rd.CATCH), exceptionParameter == null ? null : TokenFactory.token3(TokenType.OPE N_PAREN), identifier2(exceptionParameter), stackTraceParameter == null ? null : TokenFactory.token3(TokenType.COMMA), stackTraceParameter == null ? null : ident ifier2(stackTraceParameter), exceptionParameter == null ? null : TokenFactory.to ken3(TokenType.CLOSE_PAREN), block(statements)); 203 static CatchClause catchClause5(TypeName exceptionType, String exceptionParame ter, String stackTraceParameter, List<Statement> statements) => new CatchClause. full(exceptionType == null ? null : TokenFactory.token4(TokenType.IDENTIFIER, "o n"), exceptionType, exceptionParameter == null ? null : TokenFactory.token(Keywo rd.CATCH), exceptionParameter == null ? null : TokenFactory.token3(TokenType.OPE N_PAREN), identifier3(exceptionParameter), stackTraceParameter == null ? null : TokenFactory.token3(TokenType.COMMA), stackTraceParameter == null ? null : ident ifier3(stackTraceParameter), exceptionParameter == null ? null : TokenFactory.to ken3(TokenType.CLOSE_PAREN), block(statements));
204 static ClassDeclaration classDeclaration(Keyword abstractKeyword, String name, TypeParameterList typeParameters, ExtendsClause extendsClause, WithClause withC lause, ImplementsClause implementsClause, List<ClassMember> members) => new Clas sDeclaration.full(null, null, abstractKeyword == null ? null : TokenFactory.toke n(abstractKeyword), TokenFactory.token(Keyword.CLASS), identifier2(name), typePa rameters, extendsClause, withClause, implementsClause, TokenFactory.token3(Token Type.OPEN_CURLY_BRACKET), list(members), TokenFactory.token3(TokenType.CLOSE_CUR LY_BRACKET)); 204 static ClassDeclaration classDeclaration(Keyword abstractKeyword, String name, TypeParameterList typeParameters, ExtendsClause extendsClause, WithClause withC lause, ImplementsClause implementsClause, List<ClassMember> members) => new Clas sDeclaration.full(null, null, abstractKeyword == null ? null : TokenFactory.toke n(abstractKeyword), TokenFactory.token(Keyword.CLASS), identifier3(name), typePa rameters, extendsClause, withClause, implementsClause, TokenFactory.token3(Token Type.OPEN_CURLY_BRACKET), list(members), TokenFactory.token3(TokenType.CLOSE_CUR LY_BRACKET));
205 static ClassTypeAlias classTypeAlias(String name, TypeParameterList typeParame ters, Keyword abstractKeyword, TypeName superclass, WithClause withClause, Imple mentsClause implementsClause) => new ClassTypeAlias.full(null, null, TokenFactor y.token(Keyword.TYPEDEF), identifier2(name), typeParameters, TokenFactory.token3 (TokenType.EQ), abstractKeyword == null ? null : TokenFactory.token(abstractKeyw ord), superclass, withClause, implementsClause, TokenFactory.token3(TokenType.SE MICOLON)); 205 static ClassTypeAlias classTypeAlias(String name, TypeParameterList typeParame ters, Keyword abstractKeyword, TypeName superclass, WithClause withClause, Imple mentsClause implementsClause) => new ClassTypeAlias.full(null, null, TokenFactor y.token(Keyword.TYPEDEF), identifier3(name), typeParameters, TokenFactory.token3 (TokenType.EQ), abstractKeyword == null ? null : TokenFactory.token(abstractKeyw ord), superclass, withClause, implementsClause, TokenFactory.token3(TokenType.SE MICOLON));
206 static CompilationUnit compilationUnit() => compilationUnit8(null, null, null) ; 206 static CompilationUnit compilationUnit() => compilationUnit8(null, null, null) ;
207 static CompilationUnit compilationUnit2(List<CompilationUnitMember> declaratio ns) => compilationUnit8(null, null, list(declarations)); 207 static CompilationUnit compilationUnit2(List<CompilationUnitMember> declaratio ns) => compilationUnit8(null, null, list(declarations));
208 static CompilationUnit compilationUnit3(List<Directive> directives) => compila tionUnit8(null, list(directives), null); 208 static CompilationUnit compilationUnit3(List<Directive> directives) => compila tionUnit8(null, list(directives), null);
209 static CompilationUnit compilationUnit4(List<Directive> directives, List<Compi lationUnitMember> declarations) => compilationUnit8(null, directives, declaratio ns); 209 static CompilationUnit compilationUnit4(List<Directive> directives, List<Compi lationUnitMember> declarations) => compilationUnit8(null, directives, declaratio ns);
210 static CompilationUnit compilationUnit5(String scriptTag) => compilationUnit8( scriptTag, null, null); 210 static CompilationUnit compilationUnit5(String scriptTag) => compilationUnit8( scriptTag, null, null);
211 static CompilationUnit compilationUnit6(String scriptTag, List<CompilationUnit Member> declarations) => compilationUnit8(scriptTag, null, list(declarations)); 211 static CompilationUnit compilationUnit6(String scriptTag, List<CompilationUnit Member> declarations) => compilationUnit8(scriptTag, null, list(declarations));
212 static CompilationUnit compilationUnit7(String scriptTag, List<Directive> dire ctives) => compilationUnit8(scriptTag, list(directives), null); 212 static CompilationUnit compilationUnit7(String scriptTag, List<Directive> dire ctives) => compilationUnit8(scriptTag, list(directives), null);
213 static CompilationUnit compilationUnit8(String scriptTag4, List<Directive> dir ectives, List<CompilationUnitMember> declarations) => new CompilationUnit.full(T okenFactory.token3(TokenType.EOF), scriptTag4 == null ? null : scriptTag(scriptT ag4), directives == null ? new List<Directive>() : directives, declarations == n ull ? new List<CompilationUnitMember>() : declarations, TokenFactory.token3(Toke nType.EOF)); 213 static CompilationUnit compilationUnit8(String scriptTag4, List<Directive> dir ectives, List<CompilationUnitMember> declarations) => new CompilationUnit.full(T okenFactory.token3(TokenType.EOF), scriptTag4 == null ? null : scriptTag(scriptT ag4), directives == null ? new List<Directive>() : directives, declarations == n ull ? new List<CompilationUnitMember>() : declarations, TokenFactory.token3(Toke nType.EOF));
214 static ConditionalExpression conditionalExpression(Expression condition, Expre ssion thenExpression, Expression elseExpression) => new ConditionalExpression.fu ll(condition, TokenFactory.token3(TokenType.QUESTION), thenExpression, TokenFact ory.token3(TokenType.COLON), elseExpression); 214 static ConditionalExpression conditionalExpression(Expression condition, Expre ssion thenExpression, Expression elseExpression) => new ConditionalExpression.fu ll(condition, TokenFactory.token3(TokenType.QUESTION), thenExpression, TokenFact ory.token3(TokenType.COLON), elseExpression);
215 static ConstructorDeclaration constructorDeclaration(Identifier returnType, St ring name, FormalParameterList parameters, List<ConstructorInitializer> initiali zers) => new ConstructorDeclaration.full(null, null, TokenFactory.token(Keyword. EXTERNAL), null, null, returnType, name == null ? null : TokenFactory.token3(Tok enType.PERIOD), name == null ? null : identifier2(name), parameters, initializer s == null || initializers.isEmpty ? null : TokenFactory.token3(TokenType.PERIOD) , initializers == null ? new List<ConstructorInitializer>() : initializers, null , emptyFunctionBody()); 215 static ConstructorDeclaration constructorDeclaration(Identifier returnType, St ring name, FormalParameterList parameters, List<ConstructorInitializer> initiali zers) => new ConstructorDeclaration.full(null, null, TokenFactory.token(Keyword. EXTERNAL), null, null, returnType, name == null ? null : TokenFactory.token3(Tok enType.PERIOD), name == null ? null : identifier3(name), parameters, initializer s == null || initializers.isEmpty ? null : TokenFactory.token3(TokenType.PERIOD) , initializers == null ? new List<ConstructorInitializer>() : initializers, null , emptyFunctionBody());
216 static ConstructorDeclaration constructorDeclaration2(Keyword constKeyword, Ke yword factoryKeyword, Identifier returnType, String name, FormalParameterList pa rameters, List<ConstructorInitializer> initializers, FunctionBody body) => new C onstructorDeclaration.full(null, null, null, constKeyword == null ? null : Token Factory.token(constKeyword), factoryKeyword == null ? null : TokenFactory.token( factoryKeyword), returnType, name == null ? null : TokenFactory.token3(TokenType .PERIOD), name == null ? null : identifier2(name), parameters, initializers == n ull || initializers.isEmpty ? null : TokenFactory.token3(TokenType.PERIOD), init ializers == null ? new List<ConstructorInitializer>() : initializers, null, body ); 216 static ConstructorDeclaration constructorDeclaration2(Keyword constKeyword, Ke yword factoryKeyword, Identifier returnType, String name, FormalParameterList pa rameters, List<ConstructorInitializer> initializers, FunctionBody body) => new C onstructorDeclaration.full(null, null, null, constKeyword == null ? null : Token Factory.token(constKeyword), factoryKeyword == null ? null : TokenFactory.token( factoryKeyword), returnType, name == null ? null : TokenFactory.token3(TokenType .PERIOD), name == null ? null : identifier3(name), parameters, initializers == n ull || initializers.isEmpty ? null : TokenFactory.token3(TokenType.PERIOD), init ializers == null ? new List<ConstructorInitializer>() : initializers, null, body );
217 static ConstructorFieldInitializer constructorFieldInitializer(bool prefixedWi thThis, String fieldName, Expression expression) => new ConstructorFieldInitiali zer.full(prefixedWithThis ? TokenFactory.token(Keyword.THIS) : null, prefixedWit hThis ? TokenFactory.token3(TokenType.PERIOD) : null, identifier2(fieldName), To kenFactory.token3(TokenType.EQ), expression); 217 static ConstructorFieldInitializer constructorFieldInitializer(bool prefixedWi thThis, String fieldName, Expression expression) => new ConstructorFieldInitiali zer.full(prefixedWithThis ? TokenFactory.token(Keyword.THIS) : null, prefixedWit hThis ? TokenFactory.token3(TokenType.PERIOD) : null, identifier3(fieldName), To kenFactory.token3(TokenType.EQ), expression);
218 static ConstructorName constructorName(TypeName type, String name) => new Cons tructorName.full(type, name == null ? null : TokenFactory.token3(TokenType.PERIO D), name == null ? null : identifier2(name)); 218 static ConstructorName constructorName(TypeName type, String name) => new Cons tructorName.full(type, name == null ? null : TokenFactory.token3(TokenType.PERIO D), name == null ? null : identifier3(name));
219 static ContinueStatement continueStatement() => new ContinueStatement.full(Tok enFactory.token(Keyword.CONTINUE), null, TokenFactory.token3(TokenType.SEMICOLON )); 219 static ContinueStatement continueStatement() => new ContinueStatement.full(Tok enFactory.token(Keyword.CONTINUE), null, TokenFactory.token3(TokenType.SEMICOLON ));
220 static ContinueStatement continueStatement2(String label) => new ContinueState ment.full(TokenFactory.token(Keyword.CONTINUE), identifier2(label), TokenFactory .token3(TokenType.SEMICOLON)); 220 static ContinueStatement continueStatement2(String label) => new ContinueState ment.full(TokenFactory.token(Keyword.CONTINUE), identifier3(label), TokenFactory .token3(TokenType.SEMICOLON));
221 static DeclaredIdentifier declaredIdentifier(Keyword keyword, String identifie r) => declaredIdentifier2(keyword, null, identifier); 221 static DeclaredIdentifier declaredIdentifier(Keyword keyword, String identifie r) => declaredIdentifier2(keyword, null, identifier);
222 static DeclaredIdentifier declaredIdentifier2(Keyword keyword, TypeName type, String identifier) => new DeclaredIdentifier.full(null, null, keyword == null ? null : TokenFactory.token(keyword), type, identifier2(identifier)); 222 static DeclaredIdentifier declaredIdentifier2(Keyword keyword, TypeName type, String identifier) => new DeclaredIdentifier.full(null, null, keyword == null ? null : TokenFactory.token(keyword), type, identifier3(identifier));
223 static DeclaredIdentifier declaredIdentifier3(String identifier) => declaredId entifier2(null, null, identifier); 223 static DeclaredIdentifier declaredIdentifier3(String identifier) => declaredId entifier2(null, null, identifier);
224 static DeclaredIdentifier declaredIdentifier4(TypeName type, String identifier ) => declaredIdentifier2(null, type, identifier); 224 static DeclaredIdentifier declaredIdentifier4(TypeName type, String identifier ) => declaredIdentifier2(null, type, identifier);
225 static DoStatement doStatement(Statement body, Expression condition) => new Do Statement.full(TokenFactory.token(Keyword.DO), body, TokenFactory.token(Keyword. WHILE), TokenFactory.token3(TokenType.OPEN_PAREN), condition, TokenFactory.token 3(TokenType.CLOSE_PAREN), TokenFactory.token3(TokenType.SEMICOLON)); 225 static DoStatement doStatement(Statement body, Expression condition) => new Do Statement.full(TokenFactory.token(Keyword.DO), body, TokenFactory.token(Keyword. WHILE), TokenFactory.token3(TokenType.OPEN_PAREN), condition, TokenFactory.token 3(TokenType.CLOSE_PAREN), TokenFactory.token3(TokenType.SEMICOLON));
226 static DoubleLiteral doubleLiteral(double value) => new DoubleLiteral.full(Tok enFactory.token2(value.toString()), value); 226 static DoubleLiteral doubleLiteral(double value) => new DoubleLiteral.full(Tok enFactory.token2(value.toString()), value);
227 static EmptyFunctionBody emptyFunctionBody() => new EmptyFunctionBody.full(Tok enFactory.token3(TokenType.SEMICOLON)); 227 static EmptyFunctionBody emptyFunctionBody() => new EmptyFunctionBody.full(Tok enFactory.token3(TokenType.SEMICOLON));
228 static EmptyStatement emptyStatement() => new EmptyStatement.full(TokenFactory .token3(TokenType.SEMICOLON)); 228 static EmptyStatement emptyStatement() => new EmptyStatement.full(TokenFactory .token3(TokenType.SEMICOLON));
229 static ExportDirective exportDirective(List<Annotation> metadata, String uri, List<Combinator> combinators) => new ExportDirective.full(null, metadata, TokenF actory.token(Keyword.EXPORT), string2(uri), list(combinators), TokenFactory.toke n3(TokenType.SEMICOLON)); 229 static ExportDirective exportDirective(List<Annotation> metadata, String uri, List<Combinator> combinators) => new ExportDirective.full(null, metadata, TokenF actory.token(Keyword.EXPORT), string2(uri), list(combinators), TokenFactory.toke n3(TokenType.SEMICOLON));
230 static ExportDirective exportDirective2(String uri, List<Combinator> combinato rs) => exportDirective(new List<Annotation>(), uri, combinators); 230 static ExportDirective exportDirective2(String uri, List<Combinator> combinato rs) => exportDirective(new List<Annotation>(), uri, combinators);
231 static ExpressionFunctionBody expressionFunctionBody(Expression expression) => new ExpressionFunctionBody.full(TokenFactory.token3(TokenType.FUNCTION), expres sion, TokenFactory.token3(TokenType.SEMICOLON)); 231 static ExpressionFunctionBody expressionFunctionBody(Expression expression) => new ExpressionFunctionBody.full(TokenFactory.token3(TokenType.FUNCTION), expres sion, TokenFactory.token3(TokenType.SEMICOLON));
232 static ExpressionStatement expressionStatement(Expression expression) => new E xpressionStatement.full(expression, TokenFactory.token3(TokenType.SEMICOLON)); 232 static ExpressionStatement expressionStatement(Expression expression) => new E xpressionStatement.full(expression, TokenFactory.token3(TokenType.SEMICOLON));
233 static ExtendsClause extendsClause(TypeName type) => new ExtendsClause.full(To kenFactory.token(Keyword.EXTENDS), type); 233 static ExtendsClause extendsClause(TypeName type) => new ExtendsClause.full(To kenFactory.token(Keyword.EXTENDS), type);
234 static FieldDeclaration fieldDeclaration(bool isStatic, Keyword keyword, TypeN ame type, List<VariableDeclaration> variables) => new FieldDeclaration.full(null , null, isStatic ? TokenFactory.token(Keyword.STATIC) : null, variableDeclaratio nList(keyword, type, variables), TokenFactory.token3(TokenType.SEMICOLON)); 234 static FieldDeclaration fieldDeclaration(bool isStatic, Keyword keyword, TypeN ame type, List<VariableDeclaration> variables) => new FieldDeclaration.full(null , null, isStatic ? TokenFactory.token(Keyword.STATIC) : null, variableDeclaratio nList(keyword, type, variables), TokenFactory.token3(TokenType.SEMICOLON));
235 static FieldDeclaration fieldDeclaration2(bool isStatic, Keyword keyword, List <VariableDeclaration> variables) => fieldDeclaration(isStatic, keyword, null, va riables); 235 static FieldDeclaration fieldDeclaration2(bool isStatic, Keyword keyword, List <VariableDeclaration> variables) => fieldDeclaration(isStatic, keyword, null, va riables);
236 static FieldFormalParameter fieldFormalParameter(Keyword keyword, TypeName typ e, String identifier) => new FieldFormalParameter.full(null, null, keyword == nu ll ? null : TokenFactory.token(keyword), type, TokenFactory.token(Keyword.THIS), TokenFactory.token3(TokenType.PERIOD), identifier2(identifier)); 236 static FieldFormalParameter fieldFormalParameter(Keyword keyword, TypeName typ e, String identifier) => new FieldFormalParameter.full(null, null, keyword == nu ll ? null : TokenFactory.token(keyword), type, TokenFactory.token(Keyword.THIS), TokenFactory.token3(TokenType.PERIOD), identifier3(identifier));
237 static FieldFormalParameter fieldFormalParameter2(String identifier) => fieldF ormalParameter(null, null, identifier);
237 static ForEachStatement forEachStatement(DeclaredIdentifier loopVariable, Expr ession iterator, Statement body) => new ForEachStatement.full(TokenFactory.token (Keyword.FOR), TokenFactory.token3(TokenType.OPEN_PAREN), loopVariable, TokenFac tory.token(Keyword.IN), iterator, TokenFactory.token3(TokenType.CLOSE_PAREN), bo dy); 238 static ForEachStatement forEachStatement(DeclaredIdentifier loopVariable, Expr ession iterator, Statement body) => new ForEachStatement.full(TokenFactory.token (Keyword.FOR), TokenFactory.token3(TokenType.OPEN_PAREN), loopVariable, TokenFac tory.token(Keyword.IN), iterator, TokenFactory.token3(TokenType.CLOSE_PAREN), bo dy);
238 static FormalParameterList formalParameterList(List<FormalParameter> parameter s) => new FormalParameterList.full(TokenFactory.token3(TokenType.OPEN_PAREN), li st(parameters), null, null, TokenFactory.token3(TokenType.CLOSE_PAREN)); 239 static FormalParameterList formalParameterList(List<FormalParameter> parameter s) => new FormalParameterList.full(TokenFactory.token3(TokenType.OPEN_PAREN), li st(parameters), null, null, TokenFactory.token3(TokenType.CLOSE_PAREN));
239 static ForStatement forStatement(Expression initialization, Expression conditi on, List<Expression> updaters, Statement body) => new ForStatement.full(TokenFac tory.token(Keyword.FOR), TokenFactory.token3(TokenType.OPEN_PAREN), null, initia lization, TokenFactory.token3(TokenType.SEMICOLON), condition, TokenFactory.toke n3(TokenType.SEMICOLON), updaters, TokenFactory.token3(TokenType.CLOSE_PAREN), b ody); 240 static ForStatement forStatement(Expression initialization, Expression conditi on, List<Expression> updaters, Statement body) => new ForStatement.full(TokenFac tory.token(Keyword.FOR), TokenFactory.token3(TokenType.OPEN_PAREN), null, initia lization, TokenFactory.token3(TokenType.SEMICOLON), condition, TokenFactory.toke n3(TokenType.SEMICOLON), updaters, TokenFactory.token3(TokenType.CLOSE_PAREN), b ody);
240 static ForStatement forStatement2(VariableDeclarationList variableList, Expres sion condition, List<Expression> updaters, Statement body) => new ForStatement.f ull(TokenFactory.token(Keyword.FOR), TokenFactory.token3(TokenType.OPEN_PAREN), variableList, null, TokenFactory.token3(TokenType.SEMICOLON), condition, TokenFa ctory.token3(TokenType.SEMICOLON), updaters, TokenFactory.token3(TokenType.CLOSE _PAREN), body); 241 static ForStatement forStatement2(VariableDeclarationList variableList, Expres sion condition, List<Expression> updaters, Statement body) => new ForStatement.f ull(TokenFactory.token(Keyword.FOR), TokenFactory.token3(TokenType.OPEN_PAREN), variableList, null, TokenFactory.token3(TokenType.SEMICOLON), condition, TokenFa ctory.token3(TokenType.SEMICOLON), updaters, TokenFactory.token3(TokenType.CLOSE _PAREN), body);
241 static FunctionDeclaration functionDeclaration(TypeName type, Keyword keyword, String name, FunctionExpression functionExpression) => new FunctionDeclaration. full(null, null, null, type, keyword == null ? null : TokenFactory.token(keyword ), identifier2(name), functionExpression); 242 static FunctionDeclaration functionDeclaration(TypeName type, Keyword keyword, String name, FunctionExpression functionExpression) => new FunctionDeclaration. full(null, null, null, type, keyword == null ? null : TokenFactory.token(keyword ), identifier3(name), functionExpression);
242 static FunctionDeclarationStatement functionDeclarationStatement(TypeName type , Keyword keyword, String name, FunctionExpression functionExpression) => new Fu nctionDeclarationStatement.full(functionDeclaration(type, keyword, name, functio nExpression)); 243 static FunctionDeclarationStatement functionDeclarationStatement(TypeName type , Keyword keyword, String name, FunctionExpression functionExpression) => new Fu nctionDeclarationStatement.full(functionDeclaration(type, keyword, name, functio nExpression));
243 static FunctionExpression functionExpression() => new FunctionExpression.full( formalParameterList([]), blockFunctionBody([])); 244 static FunctionExpression functionExpression() => new FunctionExpression.full( formalParameterList([]), blockFunctionBody([]));
244 static FunctionExpression functionExpression2(FormalParameterList parameters, FunctionBody body) => new FunctionExpression.full(parameters, body); 245 static FunctionExpression functionExpression2(FormalParameterList parameters, FunctionBody body) => new FunctionExpression.full(parameters, body);
245 static FunctionExpressionInvocation functionExpressionInvocation(Expression fu nction, List<Expression> arguments) => new FunctionExpressionInvocation.full(fun ction, argumentList(arguments)); 246 static FunctionExpressionInvocation functionExpressionInvocation(Expression fu nction, List<Expression> arguments) => new FunctionExpressionInvocation.full(fun ction, argumentList(arguments));
246 static FunctionTypedFormalParameter functionTypedFormalParameter(TypeName retu rnType, String identifier, List<FormalParameter> parameters) => new FunctionType dFormalParameter.full(null, null, returnType, identifier2(identifier), formalPar ameterList(parameters)); 247 static FunctionTypedFormalParameter functionTypedFormalParameter(TypeName retu rnType, String identifier, List<FormalParameter> parameters) => new FunctionType dFormalParameter.full(null, null, returnType, identifier3(identifier), formalPar ameterList(parameters));
247 static HideCombinator hideCombinator(List<SimpleIdentifier> identifiers) => ne w HideCombinator.full(TokenFactory.token2("hide"), list(identifiers)); 248 static HideCombinator hideCombinator(List<SimpleIdentifier> identifiers) => ne w HideCombinator.full(TokenFactory.token2("hide"), list(identifiers));
248 static HideCombinator hideCombinator2(List<String> identifiers) { 249 static HideCombinator hideCombinator2(List<String> identifiers) {
249 List<SimpleIdentifier> identifierList = new List<SimpleIdentifier>(); 250 List<SimpleIdentifier> identifierList = new List<SimpleIdentifier>();
250 for (String identifier in identifiers) { 251 for (String identifier in identifiers) {
251 identifierList.add(identifier2(identifier)); 252 identifierList.add(identifier3(identifier));
252 } 253 }
253 return new HideCombinator.full(TokenFactory.token2("hide"), identifierList); 254 return new HideCombinator.full(TokenFactory.token2("hide"), identifierList);
254 } 255 }
255 static PrefixedIdentifier identifier(SimpleIdentifier prefix, SimpleIdentifier identifier10) => new PrefixedIdentifier.full(prefix, TokenFactory.token3(TokenT ype.PERIOD), identifier10); 256 static PrefixedIdentifier identifier(SimpleIdentifier prefix, SimpleIdentifier identifier11) => new PrefixedIdentifier.full(prefix, TokenFactory.token3(TokenT ype.PERIOD), identifier11);
256 static SimpleIdentifier identifier2(String lexeme) => new SimpleIdentifier.ful l(TokenFactory.token4(TokenType.IDENTIFIER, lexeme)); 257 static SimpleIdentifier identifier3(String lexeme) => new SimpleIdentifier.ful l(TokenFactory.token4(TokenType.IDENTIFIER, lexeme));
257 static PrefixedIdentifier identifier3(String prefix, SimpleIdentifier identifi er) => new PrefixedIdentifier.full(identifier2(prefix), TokenFactory.token3(Toke nType.PERIOD), identifier); 258 static PrefixedIdentifier identifier4(String prefix, SimpleIdentifier identifi er) => new PrefixedIdentifier.full(identifier3(prefix), TokenFactory.token3(Toke nType.PERIOD), identifier);
258 static PrefixedIdentifier identifier4(String prefix, String identifier) => new PrefixedIdentifier.full(identifier2(prefix), TokenFactory.token3(TokenType.PERI OD), identifier2(identifier)); 259 static PrefixedIdentifier identifier5(String prefix, String identifier) => new PrefixedIdentifier.full(identifier3(prefix), TokenFactory.token3(TokenType.PERI OD), identifier3(identifier));
259 static IfStatement ifStatement(Expression condition, Statement thenStatement) => ifStatement2(condition, thenStatement, null); 260 static IfStatement ifStatement(Expression condition, Statement thenStatement) => ifStatement2(condition, thenStatement, null);
260 static IfStatement ifStatement2(Expression condition, Statement thenStatement, Statement elseStatement) => new IfStatement.full(TokenFactory.token(Keyword.IF) , TokenFactory.token3(TokenType.OPEN_PAREN), condition, TokenFactory.token3(Toke nType.CLOSE_PAREN), thenStatement, elseStatement == null ? null : TokenFactory.t oken(Keyword.ELSE), elseStatement); 261 static IfStatement ifStatement2(Expression condition, Statement thenStatement, Statement elseStatement) => new IfStatement.full(TokenFactory.token(Keyword.IF) , TokenFactory.token3(TokenType.OPEN_PAREN), condition, TokenFactory.token3(Toke nType.CLOSE_PAREN), thenStatement, elseStatement == null ? null : TokenFactory.t oken(Keyword.ELSE), elseStatement);
261 static ImplementsClause implementsClause(List<TypeName> types) => new Implemen tsClause.full(TokenFactory.token(Keyword.IMPLEMENTS), list(types)); 262 static ImplementsClause implementsClause(List<TypeName> types) => new Implemen tsClause.full(TokenFactory.token(Keyword.IMPLEMENTS), list(types));
262 static ImportDirective importDirective(List<Annotation> metadata, String uri, String prefix, List<Combinator> combinators) => new ImportDirective.full(null, m etadata, TokenFactory.token(Keyword.IMPORT), string2(uri), prefix == null ? null : TokenFactory.token(Keyword.AS), prefix == null ? null : identifier2(prefix), list(combinators), TokenFactory.token3(TokenType.SEMICOLON)); 263 static ImportDirective importDirective(List<Annotation> metadata, String uri, String prefix, List<Combinator> combinators) => new ImportDirective.full(null, m etadata, TokenFactory.token(Keyword.IMPORT), string2(uri), prefix == null ? null : TokenFactory.token(Keyword.AS), prefix == null ? null : identifier3(prefix), list(combinators), TokenFactory.token3(TokenType.SEMICOLON));
263 static ImportDirective importDirective2(String uri, String prefix, List<Combin ator> combinators) => importDirective(new List<Annotation>(), uri, prefix, combi nators); 264 static ImportDirective importDirective2(String uri, String prefix, List<Combin ator> combinators) => importDirective(new List<Annotation>(), uri, prefix, combi nators);
264 static IndexExpression indexExpression(Expression array, Expression index) => new IndexExpression.forTarget_full(array, TokenFactory.token3(TokenType.OPEN_SQU ARE_BRACKET), index, TokenFactory.token3(TokenType.CLOSE_SQUARE_BRACKET)); 265 static IndexExpression indexExpression(Expression array, Expression index) => new IndexExpression.forTarget_full(array, TokenFactory.token3(TokenType.OPEN_SQU ARE_BRACKET), index, TokenFactory.token3(TokenType.CLOSE_SQUARE_BRACKET));
265 static InstanceCreationExpression instanceCreationExpression(Keyword keyword, ConstructorName name, List<Expression> arguments) => new InstanceCreationExpress ion.full(keyword == null ? null : TokenFactory.token(keyword), name, argumentLis t(arguments)); 266 static InstanceCreationExpression instanceCreationExpression(Keyword keyword, ConstructorName name, List<Expression> arguments) => new InstanceCreationExpress ion.full(keyword == null ? null : TokenFactory.token(keyword), name, argumentLis t(arguments));
266 static InstanceCreationExpression instanceCreationExpression2(Keyword keyword, TypeName type, List<Expression> arguments) => instanceCreationExpression3(keywo rd, type, null, arguments); 267 static InstanceCreationExpression instanceCreationExpression2(Keyword keyword, TypeName type, List<Expression> arguments) => instanceCreationExpression3(keywo rd, type, null, arguments);
267 static InstanceCreationExpression instanceCreationExpression3(Keyword keyword, TypeName type, String identifier, List<Expression> arguments) => instanceCreati onExpression(keyword, new ConstructorName.full(type, identifier == null ? null : TokenFactory.token3(TokenType.PERIOD), identifier == null ? null : identifier2( identifier)), arguments); 268 static InstanceCreationExpression instanceCreationExpression3(Keyword keyword, TypeName type, String identifier, List<Expression> arguments) => instanceCreati onExpression(keyword, new ConstructorName.full(type, identifier == null ? null : TokenFactory.token3(TokenType.PERIOD), identifier == null ? null : identifier3( identifier)), arguments);
268 static IntegerLiteral integer(int value) => new IntegerLiteral.full(TokenFacto ry.token4(TokenType.INT, value.toString()), value); 269 static IntegerLiteral integer(int value) => new IntegerLiteral.full(TokenFacto ry.token4(TokenType.INT, value.toString()), value);
269 static InterpolationExpression interpolationExpression(Expression expression) => new InterpolationExpression.full(TokenFactory.token3(TokenType.STRING_INTERPO LATION_EXPRESSION), expression, TokenFactory.token3(TokenType.CLOSE_CURLY_BRACKE T)); 270 static InterpolationExpression interpolationExpression(Expression expression) => new InterpolationExpression.full(TokenFactory.token3(TokenType.STRING_INTERPO LATION_EXPRESSION), expression, TokenFactory.token3(TokenType.CLOSE_CURLY_BRACKE T));
270 static InterpolationExpression interpolationExpression2(String identifier) => new InterpolationExpression.full(TokenFactory.token3(TokenType.STRING_INTERPOLAT ION_IDENTIFIER), identifier2(identifier), null); 271 static InterpolationExpression interpolationExpression2(String identifier) => new InterpolationExpression.full(TokenFactory.token3(TokenType.STRING_INTERPOLAT ION_IDENTIFIER), identifier3(identifier), null);
271 static InterpolationString interpolationString(String contents, String value) => new InterpolationString.full(TokenFactory.token2(contents), value); 272 static InterpolationString interpolationString(String contents, String value) => new InterpolationString.full(TokenFactory.token2(contents), value);
272 static IsExpression isExpression(Expression expression, bool negated, TypeName type) => new IsExpression.full(expression, TokenFactory.token(Keyword.IS), nega ted ? TokenFactory.token3(TokenType.BANG) : null, type); 273 static IsExpression isExpression(Expression expression, bool negated, TypeName type) => new IsExpression.full(expression, TokenFactory.token(Keyword.IS), nega ted ? TokenFactory.token3(TokenType.BANG) : null, type);
273 static Label label(String label5) => new Label.full(identifier2(label5), Token Factory.token3(TokenType.COLON)); 274 static Label label(SimpleIdentifier label5) => new Label.full(label5, TokenFac tory.token3(TokenType.COLON));
275 static Label label2(String label6) => label(identifier3(label6));
274 static LabeledStatement labeledStatement(List<Label> labels, Statement stateme nt) => new LabeledStatement.full(labels, statement); 276 static LabeledStatement labeledStatement(List<Label> labels, Statement stateme nt) => new LabeledStatement.full(labels, statement);
275 static LibraryDirective libraryDirective(List<Annotation> metadata, LibraryIde ntifier libraryName) => new LibraryDirective.full(null, metadata, TokenFactory.t oken(Keyword.LIBRARY), libraryName, TokenFactory.token3(TokenType.SEMICOLON)); 277 static LibraryDirective libraryDirective(List<Annotation> metadata, LibraryIde ntifier libraryName) => new LibraryDirective.full(null, metadata, TokenFactory.t oken(Keyword.LIBRARY), libraryName, TokenFactory.token3(TokenType.SEMICOLON));
276 static LibraryDirective libraryDirective2(String libraryName) => libraryDirect ive(new List<Annotation>(), libraryIdentifier2([libraryName])); 278 static LibraryDirective libraryDirective2(String libraryName) => libraryDirect ive(new List<Annotation>(), libraryIdentifier2([libraryName]));
277 static LibraryIdentifier libraryIdentifier(List<SimpleIdentifier> components) => new LibraryIdentifier.full(list(components)); 279 static LibraryIdentifier libraryIdentifier(List<SimpleIdentifier> components) => new LibraryIdentifier.full(list(components));
278 static LibraryIdentifier libraryIdentifier2(List<String> components) { 280 static LibraryIdentifier libraryIdentifier2(List<String> components) {
279 List<SimpleIdentifier> componentList = new List<SimpleIdentifier>(); 281 List<SimpleIdentifier> componentList = new List<SimpleIdentifier>();
280 for (String component in components) { 282 for (String component in components) {
281 componentList.add(identifier2(component)); 283 componentList.add(identifier3(component));
282 } 284 }
283 return new LibraryIdentifier.full(componentList); 285 return new LibraryIdentifier.full(componentList);
284 } 286 }
285 static List<Object> list(List<Object> elements) { 287 static List list(List<Object> elements) {
286 List<Object> elementList = new List(); 288 List elementList = new List();
287 for (Object element in elements) { 289 for (Object element in elements) {
288 elementList.add(element); 290 elementList.add(element);
289 } 291 }
290 return elementList; 292 return elementList;
291 } 293 }
292 static ListLiteral listLiteral(List<Expression> elements) => listLiteral2(null , null, elements); 294 static ListLiteral listLiteral(List<Expression> elements) => listLiteral2(null , null, elements);
293 static ListLiteral listLiteral2(Keyword keyword, TypeArgumentList typeArgument s, List<Expression> elements) => new ListLiteral.full(keyword == null ? null : T okenFactory.token(keyword), null, TokenFactory.token3(TokenType.OPEN_SQUARE_BRAC KET), list(elements), TokenFactory.token3(TokenType.CLOSE_SQUARE_BRACKET)); 295 static ListLiteral listLiteral2(Keyword keyword, TypeArgumentList typeArgument s, List<Expression> elements) => new ListLiteral.full(keyword == null ? null : T okenFactory.token(keyword), null, TokenFactory.token3(TokenType.OPEN_SQUARE_BRAC KET), list(elements), TokenFactory.token3(TokenType.CLOSE_SQUARE_BRACKET));
294 static MapLiteral mapLiteral(Keyword keyword, TypeArgumentList typeArguments, List<MapLiteralEntry> entries) => new MapLiteral.full(keyword == null ? null : T okenFactory.token(keyword), typeArguments, TokenFactory.token3(TokenType.OPEN_CU RLY_BRACKET), list(entries), TokenFactory.token3(TokenType.CLOSE_CURLY_BRACKET)) ; 296 static MapLiteral mapLiteral(Keyword keyword, TypeArgumentList typeArguments, List<MapLiteralEntry> entries) => new MapLiteral.full(keyword == null ? null : T okenFactory.token(keyword), typeArguments, TokenFactory.token3(TokenType.OPEN_CU RLY_BRACKET), list(entries), TokenFactory.token3(TokenType.CLOSE_CURLY_BRACKET)) ;
295 static MapLiteral mapLiteral2(List<MapLiteralEntry> entries) => mapLiteral(nul l, null, entries); 297 static MapLiteral mapLiteral2(List<MapLiteralEntry> entries) => mapLiteral(nul l, null, entries);
296 static MapLiteralEntry mapLiteralEntry(String key, Expression value) => new Ma pLiteralEntry.full(string2(key), TokenFactory.token3(TokenType.COLON), value); 298 static MapLiteralEntry mapLiteralEntry(String key, Expression value) => new Ma pLiteralEntry.full(string2(key), TokenFactory.token3(TokenType.COLON), value);
297 static MethodDeclaration methodDeclaration(Keyword modifier, TypeName returnTy pe, Keyword property, Keyword operator, SimpleIdentifier name, FormalParameterLi st parameters) => new MethodDeclaration.full(null, null, TokenFactory.token(Keyw ord.EXTERNAL), modifier == null ? null : TokenFactory.token(modifier), returnTyp e, property == null ? null : TokenFactory.token(property), operator == null ? nu ll : TokenFactory.token(operator), name, parameters, emptyFunctionBody()); 299 static MethodDeclaration methodDeclaration(Keyword modifier, TypeName returnTy pe, Keyword property, Keyword operator, SimpleIdentifier name, FormalParameterLi st parameters) => new MethodDeclaration.full(null, null, TokenFactory.token(Keyw ord.EXTERNAL), modifier == null ? null : TokenFactory.token(modifier), returnTyp e, property == null ? null : TokenFactory.token(property), operator == null ? nu ll : TokenFactory.token(operator), name, parameters, emptyFunctionBody());
298 static MethodDeclaration methodDeclaration2(Keyword modifier, TypeName returnT ype, Keyword property, Keyword operator, SimpleIdentifier name, FormalParameterL ist parameters, FunctionBody body) => new MethodDeclaration.full(null, null, nul l, modifier == null ? null : TokenFactory.token(modifier), returnType, property == null ? null : TokenFactory.token(property), operator == null ? null : TokenFa ctory.token(operator), name, parameters, body); 300 static MethodDeclaration methodDeclaration2(Keyword modifier, TypeName returnT ype, Keyword property, Keyword operator, SimpleIdentifier name, FormalParameterL ist parameters, FunctionBody body) => new MethodDeclaration.full(null, null, nul l, modifier == null ? null : TokenFactory.token(modifier), returnType, property == null ? null : TokenFactory.token(property), operator == null ? null : TokenFa ctory.token(operator), name, parameters, body);
299 static MethodInvocation methodInvocation(Expression target, String methodName, List<Expression> arguments) => new MethodInvocation.full(target, target == null ? null : TokenFactory.token3(TokenType.PERIOD), identifier2(methodName), argume ntList(arguments)); 301 static MethodInvocation methodInvocation(Expression target, String methodName, List<Expression> arguments) => new MethodInvocation.full(target, target == null ? null : TokenFactory.token3(TokenType.PERIOD), identifier3(methodName), argume ntList(arguments));
300 static MethodInvocation methodInvocation2(String methodName, List<Expression> arguments) => methodInvocation(null, methodName, arguments); 302 static MethodInvocation methodInvocation2(String methodName, List<Expression> arguments) => methodInvocation(null, methodName, arguments);
301 static NamedExpression namedExpression(String label6, Expression expression) = > new NamedExpression.full(label(label6), expression); 303 static NamedExpression namedExpression(Label label, Expression expression) => new NamedExpression.full(label, expression);
304 static NamedExpression namedExpression2(String label, Expression expression) = > namedExpression(label2(label), expression);
302 static DefaultFormalParameter namedFormalParameter(NormalFormalParameter param eter, Expression expression) => new DefaultFormalParameter.full(parameter, Param eterKind.NAMED, expression == null ? null : TokenFactory.token3(TokenType.COLON) , expression); 305 static DefaultFormalParameter namedFormalParameter(NormalFormalParameter param eter, Expression expression) => new DefaultFormalParameter.full(parameter, Param eterKind.NAMED, expression == null ? null : TokenFactory.token3(TokenType.COLON) , expression);
306 static NativeFunctionBody nativeFunctionBody(String nativeMethodName) => new N ativeFunctionBody.full(TokenFactory.token2("native"), string2(nativeMethodName), TokenFactory.token3(TokenType.SEMICOLON));
303 static NullLiteral nullLiteral() => new NullLiteral.full(TokenFactory.token(Ke yword.NULL)); 307 static NullLiteral nullLiteral() => new NullLiteral.full(TokenFactory.token(Ke yword.NULL));
304 static ParenthesizedExpression parenthesizedExpression(Expression expression) => new ParenthesizedExpression.full(TokenFactory.token3(TokenType.OPEN_PAREN), e xpression, TokenFactory.token3(TokenType.CLOSE_PAREN)); 308 static ParenthesizedExpression parenthesizedExpression(Expression expression) => new ParenthesizedExpression.full(TokenFactory.token3(TokenType.OPEN_PAREN), e xpression, TokenFactory.token3(TokenType.CLOSE_PAREN));
305 static PartDirective partDirective(List<Annotation> metadata, String url) => n ew PartDirective.full(null, metadata, TokenFactory.token(Keyword.PART), string2( url), TokenFactory.token3(TokenType.SEMICOLON)); 309 static PartDirective partDirective(List<Annotation> metadata, String url) => n ew PartDirective.full(null, metadata, TokenFactory.token(Keyword.PART), string2( url), TokenFactory.token3(TokenType.SEMICOLON));
306 static PartDirective partDirective2(String url) => partDirective(new List<Anno tation>(), url); 310 static PartDirective partDirective2(String url) => partDirective(new List<Anno tation>(), url);
307 static PartOfDirective partOfDirective(LibraryIdentifier libraryName) => partO fDirective2(new List<Annotation>(), libraryName); 311 static PartOfDirective partOfDirective(LibraryIdentifier libraryName) => partO fDirective2(new List<Annotation>(), libraryName);
308 static PartOfDirective partOfDirective2(List<Annotation> metadata, LibraryIden tifier libraryName) => new PartOfDirective.full(null, metadata, TokenFactory.tok en(Keyword.PART), TokenFactory.token2("of"), libraryName, TokenFactory.token3(To kenType.SEMICOLON)); 312 static PartOfDirective partOfDirective2(List<Annotation> metadata, LibraryIden tifier libraryName) => new PartOfDirective.full(null, metadata, TokenFactory.tok en(Keyword.PART), TokenFactory.token2("of"), libraryName, TokenFactory.token3(To kenType.SEMICOLON));
309 static DefaultFormalParameter positionalFormalParameter(NormalFormalParameter parameter, Expression expression) => new DefaultFormalParameter.full(parameter, ParameterKind.POSITIONAL, expression == null ? null : TokenFactory.token3(TokenT ype.EQ), expression); 313 static DefaultFormalParameter positionalFormalParameter(NormalFormalParameter parameter, Expression expression) => new DefaultFormalParameter.full(parameter, ParameterKind.POSITIONAL, expression == null ? null : TokenFactory.token3(TokenT ype.EQ), expression);
310 static PostfixExpression postfixExpression(Expression expression, TokenType op erator) => new PostfixExpression.full(expression, TokenFactory.token3(operator)) ; 314 static PostfixExpression postfixExpression(Expression expression, TokenType op erator) => new PostfixExpression.full(expression, TokenFactory.token3(operator)) ;
311 static PrefixExpression prefixExpression(TokenType operator, Expression expres sion) => new PrefixExpression.full(TokenFactory.token3(operator), expression); 315 static PrefixExpression prefixExpression(TokenType operator, Expression expres sion) => new PrefixExpression.full(TokenFactory.token3(operator), expression);
312 static PropertyAccess propertyAccess(Expression target, SimpleIdentifier prope rtyName) => new PropertyAccess.full(target, TokenFactory.token3(TokenType.PERIOD ), propertyName); 316 static PropertyAccess propertyAccess(Expression target, SimpleIdentifier prope rtyName) => new PropertyAccess.full(target, TokenFactory.token3(TokenType.PERIOD ), propertyName);
313 static PropertyAccess propertyAccess2(Expression target, String propertyName) => new PropertyAccess.full(target, TokenFactory.token3(TokenType.PERIOD), identi fier2(propertyName)); 317 static PropertyAccess propertyAccess2(Expression target, String propertyName) => new PropertyAccess.full(target, TokenFactory.token3(TokenType.PERIOD), identi fier3(propertyName));
314 static RedirectingConstructorInvocation redirectingConstructorInvocation(List< Expression> arguments) => redirectingConstructorInvocation2(null, arguments); 318 static RedirectingConstructorInvocation redirectingConstructorInvocation(List< Expression> arguments) => redirectingConstructorInvocation2(null, arguments);
315 static RedirectingConstructorInvocation redirectingConstructorInvocation2(Stri ng constructorName, List<Expression> arguments) => new RedirectingConstructorInv ocation.full(TokenFactory.token(Keyword.THIS), constructorName == null ? null : TokenFactory.token3(TokenType.PERIOD), constructorName == null ? null : identifi er2(constructorName), argumentList(arguments)); 319 static RedirectingConstructorInvocation redirectingConstructorInvocation2(Stri ng constructorName, List<Expression> arguments) => new RedirectingConstructorInv ocation.full(TokenFactory.token(Keyword.THIS), constructorName == null ? null : TokenFactory.token3(TokenType.PERIOD), constructorName == null ? null : identifi er3(constructorName), argumentList(arguments));
316 static ReturnStatement returnStatement() => returnStatement2(null); 320 static ReturnStatement returnStatement() => returnStatement2(null);
317 static ReturnStatement returnStatement2(Expression expression) => new ReturnSt atement.full(TokenFactory.token(Keyword.RETURN), expression, TokenFactory.token3 (TokenType.SEMICOLON)); 321 static ReturnStatement returnStatement2(Expression expression) => new ReturnSt atement.full(TokenFactory.token(Keyword.RETURN), expression, TokenFactory.token3 (TokenType.SEMICOLON));
318 static ScriptTag scriptTag(String scriptTag5) => new ScriptTag.full(TokenFacto ry.token2(scriptTag5)); 322 static ScriptTag scriptTag(String scriptTag5) => new ScriptTag.full(TokenFacto ry.token2(scriptTag5));
319 static ShowCombinator showCombinator(List<SimpleIdentifier> identifiers) => ne w ShowCombinator.full(TokenFactory.token2("show"), list(identifiers)); 323 static ShowCombinator showCombinator(List<SimpleIdentifier> identifiers) => ne w ShowCombinator.full(TokenFactory.token2("show"), list(identifiers));
320 static ShowCombinator showCombinator2(List<String> identifiers) { 324 static ShowCombinator showCombinator2(List<String> identifiers) {
321 List<SimpleIdentifier> identifierList = new List<SimpleIdentifier>(); 325 List<SimpleIdentifier> identifierList = new List<SimpleIdentifier>();
322 for (String identifier in identifiers) { 326 for (String identifier in identifiers) {
323 identifierList.add(identifier2(identifier)); 327 identifierList.add(identifier3(identifier));
324 } 328 }
325 return new ShowCombinator.full(TokenFactory.token2("show"), identifierList); 329 return new ShowCombinator.full(TokenFactory.token2("show"), identifierList);
326 } 330 }
327 static SimpleFormalParameter simpleFormalParameter(Keyword keyword, String par ameterName) => simpleFormalParameter2(keyword, null, parameterName); 331 static SimpleFormalParameter simpleFormalParameter(Keyword keyword, String par ameterName) => simpleFormalParameter2(keyword, null, parameterName);
328 static SimpleFormalParameter simpleFormalParameter2(Keyword keyword, TypeName type, String parameterName) => new SimpleFormalParameter.full(null, null, keywor d == null ? null : TokenFactory.token(keyword), type, identifier2(parameterName) ); 332 static SimpleFormalParameter simpleFormalParameter2(Keyword keyword, TypeName type, String parameterName) => new SimpleFormalParameter.full(null, null, keywor d == null ? null : TokenFactory.token(keyword), type, identifier3(parameterName) );
329 static SimpleFormalParameter simpleFormalParameter3(String parameterName) => s impleFormalParameter2(null, null, parameterName); 333 static SimpleFormalParameter simpleFormalParameter3(String parameterName) => s impleFormalParameter2(null, null, parameterName);
330 static SimpleFormalParameter simpleFormalParameter4(TypeName type, String para meterName) => simpleFormalParameter2(null, type, parameterName); 334 static SimpleFormalParameter simpleFormalParameter4(TypeName type, String para meterName) => simpleFormalParameter2(null, type, parameterName);
331 static StringInterpolation string(List<InterpolationElement> elements) => new StringInterpolation.full(list(elements)); 335 static StringInterpolation string(List<InterpolationElement> elements) => new StringInterpolation.full(list(elements));
332 static SimpleStringLiteral string2(String content) => new SimpleStringLiteral. full(TokenFactory.token2("'${content}'"), content); 336 static SimpleStringLiteral string2(String content) => new SimpleStringLiteral. full(TokenFactory.token2("'${content}'"), content);
333 static SuperConstructorInvocation superConstructorInvocation(List<Expression> arguments) => superConstructorInvocation2(null, arguments); 337 static SuperConstructorInvocation superConstructorInvocation(List<Expression> arguments) => superConstructorInvocation2(null, arguments);
334 static SuperConstructorInvocation superConstructorInvocation2(String name, Lis t<Expression> arguments) => new SuperConstructorInvocation.full(TokenFactory.tok en(Keyword.SUPER), name == null ? null : TokenFactory.token3(TokenType.PERIOD), name == null ? null : identifier2(name), argumentList(arguments)); 338 static SuperConstructorInvocation superConstructorInvocation2(String name, Lis t<Expression> arguments) => new SuperConstructorInvocation.full(TokenFactory.tok en(Keyword.SUPER), name == null ? null : TokenFactory.token3(TokenType.PERIOD), name == null ? null : identifier3(name), argumentList(arguments));
335 static SuperExpression superExpression() => new SuperExpression.full(TokenFact ory.token(Keyword.SUPER)); 339 static SuperExpression superExpression() => new SuperExpression.full(TokenFact ory.token(Keyword.SUPER));
336 static SwitchCase switchCase(Expression expression, List<Statement> statements ) => switchCase2(new List<Label>(), expression, statements); 340 static SwitchCase switchCase(Expression expression, List<Statement> statements ) => switchCase2(new List<Label>(), expression, statements);
337 static SwitchCase switchCase2(List<Label> labels, Expression expression, List< Statement> statements) => new SwitchCase.full(labels, TokenFactory.token(Keyword .CASE), expression, TokenFactory.token3(TokenType.COLON), list(statements)); 341 static SwitchCase switchCase2(List<Label> labels, Expression expression, List< Statement> statements) => new SwitchCase.full(labels, TokenFactory.token(Keyword .CASE), expression, TokenFactory.token3(TokenType.COLON), list(statements));
338 static SwitchDefault switchDefault(List<Label> labels, List<Statement> stateme nts) => new SwitchDefault.full(labels, TokenFactory.token(Keyword.DEFAULT), Toke nFactory.token3(TokenType.COLON), list(statements)); 342 static SwitchDefault switchDefault(List<Label> labels, List<Statement> stateme nts) => new SwitchDefault.full(labels, TokenFactory.token(Keyword.DEFAULT), Toke nFactory.token3(TokenType.COLON), list(statements));
339 static SwitchDefault switchDefault2(List<Statement> statements) => switchDefau lt(new List<Label>(), statements); 343 static SwitchDefault switchDefault2(List<Statement> statements) => switchDefau lt(new List<Label>(), statements);
340 static SwitchStatement switchStatement(Expression expression, List<SwitchMembe r> members) => new SwitchStatement.full(TokenFactory.token(Keyword.SWITCH), Toke nFactory.token3(TokenType.OPEN_PAREN), expression, TokenFactory.token3(TokenType .CLOSE_PAREN), TokenFactory.token3(TokenType.OPEN_CURLY_BRACKET), list(members), TokenFactory.token3(TokenType.CLOSE_CURLY_BRACKET)); 344 static SwitchStatement switchStatement(Expression expression, List<SwitchMembe r> members) => new SwitchStatement.full(TokenFactory.token(Keyword.SWITCH), Toke nFactory.token3(TokenType.OPEN_PAREN), expression, TokenFactory.token3(TokenType .CLOSE_PAREN), TokenFactory.token3(TokenType.OPEN_CURLY_BRACKET), list(members), TokenFactory.token3(TokenType.CLOSE_CURLY_BRACKET));
341 static ThisExpression thisExpression() => new ThisExpression.full(TokenFactory .token(Keyword.THIS)); 345 static ThisExpression thisExpression() => new ThisExpression.full(TokenFactory .token(Keyword.THIS));
342 static ThrowExpression throwExpression() => throwExpression2(null); 346 static ThrowExpression throwExpression() => throwExpression2(null);
343 static ThrowExpression throwExpression2(Expression expression) => new ThrowExp ression.full(TokenFactory.token(Keyword.THROW), expression); 347 static ThrowExpression throwExpression2(Expression expression) => new ThrowExp ression.full(TokenFactory.token(Keyword.THROW), expression);
344 static TopLevelVariableDeclaration topLevelVariableDeclaration(Keyword keyword , TypeName type, List<VariableDeclaration> variables) => new TopLevelVariableDec laration.full(null, null, variableDeclarationList(keyword, type, variables), Tok enFactory.token3(TokenType.SEMICOLON)); 348 static TopLevelVariableDeclaration topLevelVariableDeclaration(Keyword keyword , TypeName type, List<VariableDeclaration> variables) => new TopLevelVariableDec laration.full(null, null, variableDeclarationList(keyword, type, variables), Tok enFactory.token3(TokenType.SEMICOLON));
345 static TopLevelVariableDeclaration topLevelVariableDeclaration2(Keyword keywor d, List<VariableDeclaration> variables) => new TopLevelVariableDeclaration.full( null, null, variableDeclarationList(keyword, null, variables), TokenFactory.toke n3(TokenType.SEMICOLON)); 349 static TopLevelVariableDeclaration topLevelVariableDeclaration2(Keyword keywor d, List<VariableDeclaration> variables) => new TopLevelVariableDeclaration.full( null, null, variableDeclarationList(keyword, null, variables), TokenFactory.toke n3(TokenType.SEMICOLON));
346 static TryStatement tryStatement(Block body, Block finallyClause) => tryStatem ent3(body, new List<CatchClause>(), finallyClause); 350 static TryStatement tryStatement(Block body, Block finallyClause) => tryStatem ent3(body, new List<CatchClause>(), finallyClause);
347 static TryStatement tryStatement2(Block body, List<CatchClause> catchClauses) => tryStatement3(body, list(catchClauses), null); 351 static TryStatement tryStatement2(Block body, List<CatchClause> catchClauses) => tryStatement3(body, list(catchClauses), null);
348 static TryStatement tryStatement3(Block body, List<CatchClause> catchClauses, Block finallyClause) => new TryStatement.full(TokenFactory.token(Keyword.TRY), b ody, catchClauses, finallyClause == null ? null : TokenFactory.token(Keyword.FIN ALLY), finallyClause); 352 static TryStatement tryStatement3(Block body, List<CatchClause> catchClauses, Block finallyClause) => new TryStatement.full(TokenFactory.token(Keyword.TRY), b ody, catchClauses, finallyClause == null ? null : TokenFactory.token(Keyword.FIN ALLY), finallyClause);
349 static FunctionTypeAlias typeAlias(TypeName returnType, String name, TypeParam eterList typeParameters, FormalParameterList parameters) => new FunctionTypeAlia s.full(null, null, TokenFactory.token(Keyword.TYPEDEF), returnType, identifier2( name), typeParameters, parameters, TokenFactory.token3(TokenType.SEMICOLON)); 353 static FunctionTypeAlias typeAlias(TypeName returnType, String name, TypeParam eterList typeParameters, FormalParameterList parameters) => new FunctionTypeAlia s.full(null, null, TokenFactory.token(Keyword.TYPEDEF), returnType, identifier3( name), typeParameters, parameters, TokenFactory.token3(TokenType.SEMICOLON));
350 static TypeArgumentList typeArgumentList(List<TypeName> typeNames) => new Type ArgumentList.full(TokenFactory.token3(TokenType.LT), list(typeNames), TokenFacto ry.token3(TokenType.GT)); 354 static TypeArgumentList typeArgumentList(List<TypeName> typeNames) => new Type ArgumentList.full(TokenFactory.token3(TokenType.LT), list(typeNames), TokenFacto ry.token3(TokenType.GT));
351 /** 355 /**
352 * Create a type name whose name has been resolved to the given element and wh ose type has been 356 * Create a type name whose name has been resolved to the given element and wh ose type has been
353 * resolved to the type of the given element. 357 * resolved to the type of the given element.
354 * <p> 358 * <p>
355 * <b>Note:</b> This method does not correctly handle class elements that have type parameters. 359 * <b>Note:</b> This method does not correctly handle class elements that have type parameters.
356 * @param element the element defining the type represented by the type name 360 * @param element the element defining the type represented by the type name
357 * @return the type name that was created 361 * @return the type name that was created
358 */ 362 */
359 static TypeName typeName(ClassElement element61, List<TypeName> arguments) { 363 static TypeName typeName(ClassElement element70, List<TypeName> arguments) {
360 SimpleIdentifier name22 = identifier2(element61.name); 364 SimpleIdentifier name25 = identifier3(element70.name);
361 name22.element = element61; 365 name25.element = element70;
362 TypeName typeName = typeName2(name22, arguments); 366 TypeName typeName = typeName3(name25, arguments);
363 typeName.type = element61.type; 367 typeName.type = element70.type;
364 return typeName; 368 return typeName;
365 } 369 }
366 static TypeName typeName2(Identifier name, List<TypeName> arguments) { 370 static TypeName typeName3(Identifier name, List<TypeName> arguments) {
367 if (arguments.length == 0) { 371 if (arguments.length == 0) {
368 return new TypeName.full(name, null); 372 return new TypeName.full(name, null);
369 } 373 }
370 return new TypeName.full(name, typeArgumentList(arguments)); 374 return new TypeName.full(name, typeArgumentList(arguments));
371 } 375 }
372 static TypeName typeName3(String name, List<TypeName> arguments) { 376 static TypeName typeName4(String name, List<TypeName> arguments) {
373 if (arguments.length == 0) { 377 if (arguments.length == 0) {
374 return new TypeName.full(identifier2(name), null); 378 return new TypeName.full(identifier3(name), null);
375 } 379 }
376 return new TypeName.full(identifier2(name), typeArgumentList(arguments)); 380 return new TypeName.full(identifier3(name), typeArgumentList(arguments));
377 } 381 }
378 static TypeParameter typeParameter(String name) => new TypeParameter.full(null , null, identifier2(name), null, null); 382 static TypeParameter typeParameter(String name) => new TypeParameter.full(null , null, identifier3(name), null, null);
379 static TypeParameter typeParameter2(String name, TypeName bound) => new TypePa rameter.full(null, null, identifier2(name), TokenFactory.token(Keyword.EXTENDS), bound); 383 static TypeParameter typeParameter2(String name, TypeName bound) => new TypePa rameter.full(null, null, identifier3(name), TokenFactory.token(Keyword.EXTENDS), bound);
380 static TypeParameterList typeParameterList(List<String> typeNames) { 384 static TypeParameterList typeParameterList(List<String> typeNames) {
381 List<TypeParameter> typeParameters = new List<TypeParameter>(); 385 List<TypeParameter> typeParameters = new List<TypeParameter>();
382 for (String typeName in typeNames) { 386 for (String typeName in typeNames) {
383 typeParameters.add(typeParameter(typeName)); 387 typeParameters.add(typeParameter(typeName));
384 } 388 }
385 return new TypeParameterList.full(TokenFactory.token3(TokenType.LT), typePar ameters, TokenFactory.token3(TokenType.GT)); 389 return new TypeParameterList.full(TokenFactory.token3(TokenType.LT), typePar ameters, TokenFactory.token3(TokenType.GT));
386 } 390 }
387 static VariableDeclaration variableDeclaration(String name) => new VariableDec laration.full(null, null, identifier2(name), null, null); 391 static VariableDeclaration variableDeclaration(String name) => new VariableDec laration.full(null, null, identifier3(name), null, null);
388 static VariableDeclaration variableDeclaration2(String name, Expression initia lizer) => new VariableDeclaration.full(null, null, identifier2(name), TokenFacto ry.token3(TokenType.EQ), initializer); 392 static VariableDeclaration variableDeclaration2(String name, Expression initia lizer) => new VariableDeclaration.full(null, null, identifier3(name), TokenFacto ry.token3(TokenType.EQ), initializer);
389 static VariableDeclarationList variableDeclarationList(Keyword keyword, TypeNa me type, List<VariableDeclaration> variables) => new VariableDeclarationList.ful l(null, null, keyword == null ? null : TokenFactory.token(keyword), type, list(v ariables)); 393 static VariableDeclarationList variableDeclarationList(Keyword keyword, TypeNa me type, List<VariableDeclaration> variables) => new VariableDeclarationList.ful l(null, null, keyword == null ? null : TokenFactory.token(keyword), type, list(v ariables));
390 static VariableDeclarationList variableDeclarationList2(Keyword keyword, List< VariableDeclaration> variables) => variableDeclarationList(keyword, null, variab les); 394 static VariableDeclarationList variableDeclarationList2(Keyword keyword, List< VariableDeclaration> variables) => variableDeclarationList(keyword, null, variab les);
391 static VariableDeclarationStatement variableDeclarationStatement(Keyword keywo rd, TypeName type, List<VariableDeclaration> variables) => new VariableDeclarati onStatement.full(variableDeclarationList(keyword, type, variables), TokenFactory .token3(TokenType.SEMICOLON)); 395 static VariableDeclarationStatement variableDeclarationStatement(Keyword keywo rd, TypeName type, List<VariableDeclaration> variables) => new VariableDeclarati onStatement.full(variableDeclarationList(keyword, type, variables), TokenFactory .token3(TokenType.SEMICOLON));
392 static VariableDeclarationStatement variableDeclarationStatement2(Keyword keyw ord, List<VariableDeclaration> variables) => variableDeclarationStatement(keywor d, null, variables); 396 static VariableDeclarationStatement variableDeclarationStatement2(Keyword keyw ord, List<VariableDeclaration> variables) => variableDeclarationStatement(keywor d, null, variables);
393 static WhileStatement whileStatement(Expression condition, Statement body) => new WhileStatement.full(TokenFactory.token(Keyword.WHILE), TokenFactory.token3(T okenType.OPEN_PAREN), condition, TokenFactory.token3(TokenType.CLOSE_PAREN), bod y); 397 static WhileStatement whileStatement(Expression condition, Statement body) => new WhileStatement.full(TokenFactory.token(Keyword.WHILE), TokenFactory.token3(T okenType.OPEN_PAREN), condition, TokenFactory.token3(TokenType.CLOSE_PAREN), bod y);
394 static WithClause withClause(List<TypeName> types) => new WithClause.full(Toke nFactory.token(Keyword.WITH), list(types)); 398 static WithClause withClause(List<TypeName> types) => new WithClause.full(Toke nFactory.token(Keyword.WITH), list(types));
395 /** 399 /**
396 * Prevent the creation of instances of this class. 400 * Prevent the creation of instances of this class.
397 */ 401 */
398 ASTFactory() { 402 ASTFactory() {
399 } 403 }
400 } 404 }
401 class SimpleIdentifierTest extends ParserTestCase { 405 class SimpleIdentifierTest extends ParserTestCase {
402 void test_inDeclarationContext_argumentDefinition() { 406 void test_inDeclarationContext_argumentDefinition() {
403 SimpleIdentifier identifier15 = ASTFactory.argumentDefinitionTest("p").ident ifier; 407 SimpleIdentifier identifier16 = ASTFactory.argumentDefinitionTest("p").ident ifier;
404 JUnitTestCase.assertFalse(identifier15.inDeclarationContext()); 408 JUnitTestCase.assertFalse(identifier16.inDeclarationContext());
405 } 409 }
406 void test_inDeclarationContext_catch_exception() { 410 void test_inDeclarationContext_catch_exception() {
407 SimpleIdentifier identifier = ASTFactory.catchClause("e", []).exceptionParam eter; 411 SimpleIdentifier identifier = ASTFactory.catchClause("e", []).exceptionParam eter;
408 JUnitTestCase.assertTrue(identifier.inDeclarationContext()); 412 JUnitTestCase.assertTrue(identifier.inDeclarationContext());
409 } 413 }
410 void test_inDeclarationContext_catch_stack() { 414 void test_inDeclarationContext_catch_stack() {
411 SimpleIdentifier identifier = ASTFactory.catchClause2("e", "s", []).stackTra ceParameter; 415 SimpleIdentifier identifier = ASTFactory.catchClause2("e", "s", []).stackTra ceParameter;
412 JUnitTestCase.assertTrue(identifier.inDeclarationContext()); 416 JUnitTestCase.assertTrue(identifier.inDeclarationContext());
413 } 417 }
414 void test_inDeclarationContext_classDeclaration() { 418 void test_inDeclarationContext_classDeclaration() {
415 SimpleIdentifier identifier = ASTFactory.classDeclaration(null, "C", null, n ull, null, null, []).name; 419 SimpleIdentifier identifier = ASTFactory.classDeclaration(null, "C", null, n ull, null, null, []).name;
416 JUnitTestCase.assertTrue(identifier.inDeclarationContext()); 420 JUnitTestCase.assertTrue(identifier.inDeclarationContext());
417 } 421 }
418 void test_inDeclarationContext_classTypeAlias() { 422 void test_inDeclarationContext_classTypeAlias() {
419 SimpleIdentifier identifier = ASTFactory.classTypeAlias("C", null, null, nul l, null, null).name; 423 SimpleIdentifier identifier = ASTFactory.classTypeAlias("C", null, null, nul l, null, null).name;
420 JUnitTestCase.assertTrue(identifier.inDeclarationContext()); 424 JUnitTestCase.assertTrue(identifier.inDeclarationContext());
421 } 425 }
422 void test_inDeclarationContext_constructorDeclaration() { 426 void test_inDeclarationContext_constructorDeclaration() {
423 SimpleIdentifier identifier = ASTFactory.constructorDeclaration(ASTFactory.i dentifier2("C"), "c", null, null).name; 427 SimpleIdentifier identifier = ASTFactory.constructorDeclaration(ASTFactory.i dentifier3("C"), "c", null, null).name;
424 JUnitTestCase.assertTrue(identifier.inDeclarationContext()); 428 JUnitTestCase.assertTrue(identifier.inDeclarationContext());
425 } 429 }
430 void test_inDeclarationContext_fieldFormalParameter() {
431 SimpleIdentifier identifier17 = ASTFactory.fieldFormalParameter2("p").identi fier;
432 JUnitTestCase.assertFalse(identifier17.inDeclarationContext());
433 }
426 void test_inDeclarationContext_functionDeclaration() { 434 void test_inDeclarationContext_functionDeclaration() {
427 SimpleIdentifier identifier = ASTFactory.functionDeclaration(null, null, "f" , null).name; 435 SimpleIdentifier identifier = ASTFactory.functionDeclaration(null, null, "f" , null).name;
428 JUnitTestCase.assertTrue(identifier.inDeclarationContext()); 436 JUnitTestCase.assertTrue(identifier.inDeclarationContext());
429 } 437 }
430 void test_inDeclarationContext_functionTypeAlias() { 438 void test_inDeclarationContext_functionTypeAlias() {
431 SimpleIdentifier identifier = ASTFactory.typeAlias(null, "F", null, null).na me; 439 SimpleIdentifier identifier = ASTFactory.typeAlias(null, "F", null, null).na me;
432 JUnitTestCase.assertTrue(identifier.inDeclarationContext()); 440 JUnitTestCase.assertTrue(identifier.inDeclarationContext());
433 } 441 }
434 void test_inDeclarationContext_label_false() { 442 void test_inDeclarationContext_label_false() {
435 SimpleIdentifier identifier = ASTFactory.namedExpression("l", ASTFactory.int eger(0)).name.label; 443 SimpleIdentifier identifier = ASTFactory.namedExpression2("l", ASTFactory.in teger(0)).name.label;
436 JUnitTestCase.assertFalse(identifier.inDeclarationContext()); 444 JUnitTestCase.assertFalse(identifier.inDeclarationContext());
437 } 445 }
438 void test_inDeclarationContext_label_true() { 446 void test_inDeclarationContext_label_true() {
439 Label label2 = ASTFactory.label("l"); 447 Label label = ASTFactory.label2("l");
440 SimpleIdentifier identifier = label2.label; 448 SimpleIdentifier identifier = label.label;
441 ASTFactory.labeledStatement(ASTFactory.list([label2]), ASTFactory.emptyState ment()); 449 ASTFactory.labeledStatement(ASTFactory.list([label]), ASTFactory.emptyStatem ent());
442 JUnitTestCase.assertTrue(identifier.inDeclarationContext()); 450 JUnitTestCase.assertTrue(identifier.inDeclarationContext());
443 } 451 }
444 void test_inDeclarationContext_methodDeclaration() { 452 void test_inDeclarationContext_methodDeclaration() {
445 SimpleIdentifier identifier = ASTFactory.identifier2("m"); 453 SimpleIdentifier identifier = ASTFactory.identifier3("m");
446 ASTFactory.methodDeclaration2(null, null, null, null, identifier, null, null ); 454 ASTFactory.methodDeclaration2(null, null, null, null, identifier, null, null );
447 JUnitTestCase.assertTrue(identifier.inDeclarationContext()); 455 JUnitTestCase.assertTrue(identifier.inDeclarationContext());
448 } 456 }
449 void test_inDeclarationContext_normalFormalParameter() { 457 void test_inDeclarationContext_simpleFormalParameter() {
450 SimpleIdentifier identifier16 = ASTFactory.simpleFormalParameter3("p").ident ifier; 458 SimpleIdentifier identifier18 = ASTFactory.simpleFormalParameter3("p").ident ifier;
451 JUnitTestCase.assertTrue(identifier16.inDeclarationContext()); 459 JUnitTestCase.assertTrue(identifier18.inDeclarationContext());
452 } 460 }
453 void test_inDeclarationContext_typeParameter_bound() { 461 void test_inDeclarationContext_typeParameter_bound() {
454 TypeName bound = ASTFactory.typeName3("A", []); 462 TypeName bound = ASTFactory.typeName4("A", []);
455 SimpleIdentifier identifier = bound.name as SimpleIdentifier; 463 SimpleIdentifier identifier = bound.name as SimpleIdentifier;
456 ASTFactory.typeParameter2("E", bound); 464 ASTFactory.typeParameter2("E", bound);
457 JUnitTestCase.assertFalse(identifier.inDeclarationContext()); 465 JUnitTestCase.assertFalse(identifier.inDeclarationContext());
458 } 466 }
459 void test_inDeclarationContext_typeParameter_name() { 467 void test_inDeclarationContext_typeParameter_name() {
460 SimpleIdentifier identifier = ASTFactory.typeParameter("E").name; 468 SimpleIdentifier identifier = ASTFactory.typeParameter("E").name;
461 JUnitTestCase.assertTrue(identifier.inDeclarationContext()); 469 JUnitTestCase.assertTrue(identifier.inDeclarationContext());
462 } 470 }
463 void test_inDeclarationContext_variableDeclaration() { 471 void test_inDeclarationContext_variableDeclaration() {
464 SimpleIdentifier identifier = ASTFactory.variableDeclaration("v").name; 472 SimpleIdentifier identifier = ASTFactory.variableDeclaration("v").name;
465 JUnitTestCase.assertTrue(identifier.inDeclarationContext()); 473 JUnitTestCase.assertTrue(identifier.inDeclarationContext());
466 } 474 }
467 void test_inGetterContext() { 475 void test_inGetterContext() {
468 for (WrapperKind wrapper in WrapperKind.values) { 476 for (WrapperKind wrapper in WrapperKind.values) {
469 for (AssignmentKind assignment in AssignmentKind.values) { 477 for (AssignmentKind assignment in AssignmentKind.values) {
470 SimpleIdentifier identifier = createIdentifier(wrapper, assignment); 478 SimpleIdentifier identifier = createIdentifier(wrapper, assignment);
471 if (identical(assignment, AssignmentKind.SIMPLE_LEFT) && wrapper != Wrap perKind.PREFIXED_LEFT && wrapper != WrapperKind.PROPERTY_LEFT) { 479 if (identical(assignment, AssignmentKind.SIMPLE_LEFT) && wrapper != Wrap perKind.PREFIXED_LEFT && wrapper != WrapperKind.PROPERTY_LEFT) {
472 if (identifier.inGetterContext()) { 480 if (identifier.inGetterContext()) {
473 JUnitTestCase.fail("Expected ${topMostNode(identifier).toSource()} t o be false"); 481 JUnitTestCase.fail("Expected ${topMostNode(identifier).toSource()} t o be false");
474 } 482 }
475 } else { 483 } else {
476 if (!identifier.inGetterContext()) { 484 if (!identifier.inGetterContext()) {
477 JUnitTestCase.fail("Expected ${topMostNode(identifier).toSource()} t o be true"); 485 JUnitTestCase.fail("Expected ${topMostNode(identifier).toSource()} t o be true");
478 } 486 }
479 } 487 }
480 } 488 }
481 } 489 }
482 } 490 }
491 void test_inReferenceContext() {
492 SimpleIdentifier identifier = ASTFactory.identifier3("id");
493 ASTFactory.namedExpression(ASTFactory.label(identifier), ASTFactory.identifi er3("_"));
494 JUnitTestCase.assertFalse(identifier.inGetterContext());
495 JUnitTestCase.assertFalse(identifier.inSetterContext());
496 }
483 void test_inSetterContext() { 497 void test_inSetterContext() {
484 for (WrapperKind wrapper in WrapperKind.values) { 498 for (WrapperKind wrapper in WrapperKind.values) {
485 for (AssignmentKind assignment in AssignmentKind.values) { 499 for (AssignmentKind assignment in AssignmentKind.values) {
486 SimpleIdentifier identifier = createIdentifier(wrapper, assignment); 500 SimpleIdentifier identifier = createIdentifier(wrapper, assignment);
487 if (identical(wrapper, WrapperKind.PREFIXED_LEFT) || identical(wrapper, WrapperKind.PROPERTY_LEFT) || identical(assignment, AssignmentKind.BINARY) || id entical(assignment, AssignmentKind.COMPOUND_RIGHT) || identical(assignment, Assi gnmentKind.PREFIX_NOT) || identical(assignment, AssignmentKind.SIMPLE_RIGHT) || identical(assignment, AssignmentKind.NONE)) { 501 if (identical(wrapper, WrapperKind.PREFIXED_LEFT) || identical(wrapper, WrapperKind.PROPERTY_LEFT) || identical(assignment, AssignmentKind.BINARY) || id entical(assignment, AssignmentKind.COMPOUND_RIGHT) || identical(assignment, Assi gnmentKind.PREFIX_NOT) || identical(assignment, AssignmentKind.SIMPLE_RIGHT) || identical(assignment, AssignmentKind.NONE)) {
488 if (identifier.inSetterContext()) { 502 if (identifier.inSetterContext()) {
489 JUnitTestCase.fail("Expected ${topMostNode(identifier).toSource()} t o be false"); 503 JUnitTestCase.fail("Expected ${topMostNode(identifier).toSource()} t o be false");
490 } 504 }
491 } else { 505 } else {
492 if (!identifier.inSetterContext()) { 506 if (!identifier.inSetterContext()) {
493 JUnitTestCase.fail("Expected ${topMostNode(identifier).toSource()} t o be true"); 507 JUnitTestCase.fail("Expected ${topMostNode(identifier).toSource()} t o be true");
494 } 508 }
495 } 509 }
496 } 510 }
497 } 511 }
498 } 512 }
499 SimpleIdentifier createIdentifier(WrapperKind wrapper, AssignmentKind assignme nt) { 513 SimpleIdentifier createIdentifier(WrapperKind wrapper, AssignmentKind assignme nt) {
500 SimpleIdentifier identifier = ASTFactory.identifier2("a"); 514 SimpleIdentifier identifier = ASTFactory.identifier3("a");
501 Expression expression = identifier; 515 Expression expression = identifier;
502 while (true) { 516 while (true) {
503 if (wrapper == WrapperKind.PREFIXED_LEFT) { 517 if (wrapper == WrapperKind.PREFIXED_LEFT) {
504 expression = ASTFactory.identifier(identifier, ASTFactory.identifier2("_ ")); 518 expression = ASTFactory.identifier(identifier, ASTFactory.identifier3("_ "));
505 } else if (wrapper == WrapperKind.PREFIXED_RIGHT) { 519 } else if (wrapper == WrapperKind.PREFIXED_RIGHT) {
506 expression = ASTFactory.identifier(ASTFactory.identifier2("_"), identifi er); 520 expression = ASTFactory.identifier(ASTFactory.identifier3("_"), identifi er);
507 } else if (wrapper == WrapperKind.PROPERTY_LEFT) { 521 } else if (wrapper == WrapperKind.PROPERTY_LEFT) {
508 expression = ASTFactory.propertyAccess2(expression, "_"); 522 expression = ASTFactory.propertyAccess2(expression, "_");
509 } else if (wrapper == WrapperKind.PROPERTY_RIGHT) { 523 } else if (wrapper == WrapperKind.PROPERTY_RIGHT) {
510 expression = ASTFactory.propertyAccess(ASTFactory.identifier2("_"), iden tifier); 524 expression = ASTFactory.propertyAccess(ASTFactory.identifier3("_"), iden tifier);
511 } 525 }
512 break; 526 break;
513 } 527 }
514 while (true) { 528 while (true) {
515 if (assignment == AssignmentKind.BINARY) { 529 if (assignment == AssignmentKind.BINARY) {
516 ASTFactory.binaryExpression(expression, TokenType.PLUS, ASTFactory.ident ifier2("_")); 530 ASTFactory.binaryExpression(expression, TokenType.PLUS, ASTFactory.ident ifier3("_"));
517 } else if (assignment == AssignmentKind.COMPOUND_LEFT) { 531 } else if (assignment == AssignmentKind.COMPOUND_LEFT) {
518 ASTFactory.assignmentExpression(expression, TokenType.PLUS_EQ, ASTFactor y.identifier2("_")); 532 ASTFactory.assignmentExpression(expression, TokenType.PLUS_EQ, ASTFactor y.identifier3("_"));
519 } else if (assignment == AssignmentKind.COMPOUND_RIGHT) { 533 } else if (assignment == AssignmentKind.COMPOUND_RIGHT) {
520 ASTFactory.assignmentExpression(ASTFactory.identifier2("_"), TokenType.P LUS_EQ, expression); 534 ASTFactory.assignmentExpression(ASTFactory.identifier3("_"), TokenType.P LUS_EQ, expression);
521 } else if (assignment == AssignmentKind.POSTFIX_INC) { 535 } else if (assignment == AssignmentKind.POSTFIX_INC) {
522 ASTFactory.postfixExpression(expression, TokenType.PLUS_PLUS); 536 ASTFactory.postfixExpression(expression, TokenType.PLUS_PLUS);
523 } else if (assignment == AssignmentKind.PREFIX_DEC) { 537 } else if (assignment == AssignmentKind.PREFIX_DEC) {
524 ASTFactory.prefixExpression(TokenType.MINUS_MINUS, expression); 538 ASTFactory.prefixExpression(TokenType.MINUS_MINUS, expression);
525 } else if (assignment == AssignmentKind.PREFIX_INC) { 539 } else if (assignment == AssignmentKind.PREFIX_INC) {
526 ASTFactory.prefixExpression(TokenType.PLUS_PLUS, expression); 540 ASTFactory.prefixExpression(TokenType.PLUS_PLUS, expression);
527 } else if (assignment == AssignmentKind.PREFIX_NOT) { 541 } else if (assignment == AssignmentKind.PREFIX_NOT) {
528 ASTFactory.prefixExpression(TokenType.BANG, expression); 542 ASTFactory.prefixExpression(TokenType.BANG, expression);
529 } else if (assignment == AssignmentKind.SIMPLE_LEFT) { 543 } else if (assignment == AssignmentKind.SIMPLE_LEFT) {
530 ASTFactory.assignmentExpression(expression, TokenType.EQ, ASTFactory.ide ntifier2("_")); 544 ASTFactory.assignmentExpression(expression, TokenType.EQ, ASTFactory.ide ntifier3("_"));
531 } else if (assignment == AssignmentKind.SIMPLE_RIGHT) { 545 } else if (assignment == AssignmentKind.SIMPLE_RIGHT) {
532 ASTFactory.assignmentExpression(ASTFactory.identifier2("_"), TokenType.E Q, expression); 546 ASTFactory.assignmentExpression(ASTFactory.identifier3("_"), TokenType.E Q, expression);
533 } 547 }
534 break; 548 break;
535 } 549 }
536 return identifier; 550 return identifier;
537 } 551 }
538 /** 552 /**
539 * Return the top-most node in the AST structure containing the given identifi er. 553 * Return the top-most node in the AST structure containing the given identifi er.
540 * @param identifier the identifier in the AST structure being traversed 554 * @param identifier the identifier in the AST structure being traversed
541 * @return the root of the AST structure containing the identifier 555 * @return the root of the AST structure containing the identifier
542 */ 556 */
543 ASTNode topMostNode(SimpleIdentifier identifier) { 557 ASTNode topMostNode(SimpleIdentifier identifier) {
544 ASTNode child = identifier; 558 ASTNode child = identifier;
545 ASTNode parent20 = identifier.parent; 559 ASTNode parent19 = identifier.parent;
546 while (parent20 != null) { 560 while (parent19 != null) {
547 child = parent20; 561 child = parent19;
548 parent20 = parent20.parent; 562 parent19 = parent19.parent;
549 } 563 }
550 return child; 564 return child;
551 } 565 }
552 static dartSuite() { 566 static dartSuite() {
553 _ut.group('SimpleIdentifierTest', () { 567 _ut.group('SimpleIdentifierTest', () {
554 _ut.test('test_inDeclarationContext_argumentDefinition', () { 568 _ut.test('test_inDeclarationContext_argumentDefinition', () {
555 final __test = new SimpleIdentifierTest(); 569 final __test = new SimpleIdentifierTest();
556 runJUnitTest(__test, __test.test_inDeclarationContext_argumentDefinition ); 570 runJUnitTest(__test, __test.test_inDeclarationContext_argumentDefinition );
557 }); 571 });
558 _ut.test('test_inDeclarationContext_catch_exception', () { 572 _ut.test('test_inDeclarationContext_catch_exception', () {
559 final __test = new SimpleIdentifierTest(); 573 final __test = new SimpleIdentifierTest();
560 runJUnitTest(__test, __test.test_inDeclarationContext_catch_exception); 574 runJUnitTest(__test, __test.test_inDeclarationContext_catch_exception);
561 }); 575 });
562 _ut.test('test_inDeclarationContext_catch_stack', () { 576 _ut.test('test_inDeclarationContext_catch_stack', () {
563 final __test = new SimpleIdentifierTest(); 577 final __test = new SimpleIdentifierTest();
564 runJUnitTest(__test, __test.test_inDeclarationContext_catch_stack); 578 runJUnitTest(__test, __test.test_inDeclarationContext_catch_stack);
565 }); 579 });
566 _ut.test('test_inDeclarationContext_classDeclaration', () { 580 _ut.test('test_inDeclarationContext_classDeclaration', () {
567 final __test = new SimpleIdentifierTest(); 581 final __test = new SimpleIdentifierTest();
568 runJUnitTest(__test, __test.test_inDeclarationContext_classDeclaration); 582 runJUnitTest(__test, __test.test_inDeclarationContext_classDeclaration);
569 }); 583 });
570 _ut.test('test_inDeclarationContext_classTypeAlias', () { 584 _ut.test('test_inDeclarationContext_classTypeAlias', () {
571 final __test = new SimpleIdentifierTest(); 585 final __test = new SimpleIdentifierTest();
572 runJUnitTest(__test, __test.test_inDeclarationContext_classTypeAlias); 586 runJUnitTest(__test, __test.test_inDeclarationContext_classTypeAlias);
573 }); 587 });
574 _ut.test('test_inDeclarationContext_constructorDeclaration', () { 588 _ut.test('test_inDeclarationContext_constructorDeclaration', () {
575 final __test = new SimpleIdentifierTest(); 589 final __test = new SimpleIdentifierTest();
576 runJUnitTest(__test, __test.test_inDeclarationContext_constructorDeclara tion); 590 runJUnitTest(__test, __test.test_inDeclarationContext_constructorDeclara tion);
577 }); 591 });
592 _ut.test('test_inDeclarationContext_fieldFormalParameter', () {
593 final __test = new SimpleIdentifierTest();
594 runJUnitTest(__test, __test.test_inDeclarationContext_fieldFormalParamet er);
595 });
578 _ut.test('test_inDeclarationContext_functionDeclaration', () { 596 _ut.test('test_inDeclarationContext_functionDeclaration', () {
579 final __test = new SimpleIdentifierTest(); 597 final __test = new SimpleIdentifierTest();
580 runJUnitTest(__test, __test.test_inDeclarationContext_functionDeclaratio n); 598 runJUnitTest(__test, __test.test_inDeclarationContext_functionDeclaratio n);
581 }); 599 });
582 _ut.test('test_inDeclarationContext_functionTypeAlias', () { 600 _ut.test('test_inDeclarationContext_functionTypeAlias', () {
583 final __test = new SimpleIdentifierTest(); 601 final __test = new SimpleIdentifierTest();
584 runJUnitTest(__test, __test.test_inDeclarationContext_functionTypeAlias) ; 602 runJUnitTest(__test, __test.test_inDeclarationContext_functionTypeAlias) ;
585 }); 603 });
586 _ut.test('test_inDeclarationContext_label_false', () { 604 _ut.test('test_inDeclarationContext_label_false', () {
587 final __test = new SimpleIdentifierTest(); 605 final __test = new SimpleIdentifierTest();
588 runJUnitTest(__test, __test.test_inDeclarationContext_label_false); 606 runJUnitTest(__test, __test.test_inDeclarationContext_label_false);
589 }); 607 });
590 _ut.test('test_inDeclarationContext_label_true', () { 608 _ut.test('test_inDeclarationContext_label_true', () {
591 final __test = new SimpleIdentifierTest(); 609 final __test = new SimpleIdentifierTest();
592 runJUnitTest(__test, __test.test_inDeclarationContext_label_true); 610 runJUnitTest(__test, __test.test_inDeclarationContext_label_true);
593 }); 611 });
594 _ut.test('test_inDeclarationContext_methodDeclaration', () { 612 _ut.test('test_inDeclarationContext_methodDeclaration', () {
595 final __test = new SimpleIdentifierTest(); 613 final __test = new SimpleIdentifierTest();
596 runJUnitTest(__test, __test.test_inDeclarationContext_methodDeclaration) ; 614 runJUnitTest(__test, __test.test_inDeclarationContext_methodDeclaration) ;
597 }); 615 });
598 _ut.test('test_inDeclarationContext_normalFormalParameter', () { 616 _ut.test('test_inDeclarationContext_simpleFormalParameter', () {
599 final __test = new SimpleIdentifierTest(); 617 final __test = new SimpleIdentifierTest();
600 runJUnitTest(__test, __test.test_inDeclarationContext_normalFormalParame ter); 618 runJUnitTest(__test, __test.test_inDeclarationContext_simpleFormalParame ter);
601 }); 619 });
602 _ut.test('test_inDeclarationContext_typeParameter_bound', () { 620 _ut.test('test_inDeclarationContext_typeParameter_bound', () {
603 final __test = new SimpleIdentifierTest(); 621 final __test = new SimpleIdentifierTest();
604 runJUnitTest(__test, __test.test_inDeclarationContext_typeParameter_boun d); 622 runJUnitTest(__test, __test.test_inDeclarationContext_typeParameter_boun d);
605 }); 623 });
606 _ut.test('test_inDeclarationContext_typeParameter_name', () { 624 _ut.test('test_inDeclarationContext_typeParameter_name', () {
607 final __test = new SimpleIdentifierTest(); 625 final __test = new SimpleIdentifierTest();
608 runJUnitTest(__test, __test.test_inDeclarationContext_typeParameter_name ); 626 runJUnitTest(__test, __test.test_inDeclarationContext_typeParameter_name );
609 }); 627 });
610 _ut.test('test_inDeclarationContext_variableDeclaration', () { 628 _ut.test('test_inDeclarationContext_variableDeclaration', () {
611 final __test = new SimpleIdentifierTest(); 629 final __test = new SimpleIdentifierTest();
612 runJUnitTest(__test, __test.test_inDeclarationContext_variableDeclaratio n); 630 runJUnitTest(__test, __test.test_inDeclarationContext_variableDeclaratio n);
613 }); 631 });
614 _ut.test('test_inGetterContext', () { 632 _ut.test('test_inGetterContext', () {
615 final __test = new SimpleIdentifierTest(); 633 final __test = new SimpleIdentifierTest();
616 runJUnitTest(__test, __test.test_inGetterContext); 634 runJUnitTest(__test, __test.test_inGetterContext);
617 }); 635 });
636 _ut.test('test_inReferenceContext', () {
637 final __test = new SimpleIdentifierTest();
638 runJUnitTest(__test, __test.test_inReferenceContext);
639 });
618 _ut.test('test_inSetterContext', () { 640 _ut.test('test_inSetterContext', () {
619 final __test = new SimpleIdentifierTest(); 641 final __test = new SimpleIdentifierTest();
620 runJUnitTest(__test, __test.test_inSetterContext); 642 runJUnitTest(__test, __test.test_inSetterContext);
621 }); 643 });
622 }); 644 });
623 } 645 }
624 } 646 }
625 class AssignmentKind { 647 class AssignmentKind implements Comparable<AssignmentKind> {
626 static final AssignmentKind BINARY = new AssignmentKind('BINARY', 0); 648 static final AssignmentKind BINARY = new AssignmentKind('BINARY', 0);
627 static final AssignmentKind COMPOUND_LEFT = new AssignmentKind('COMPOUND_LEFT' , 1); 649 static final AssignmentKind COMPOUND_LEFT = new AssignmentKind('COMPOUND_LEFT' , 1);
628 static final AssignmentKind COMPOUND_RIGHT = new AssignmentKind('COMPOUND_RIGH T', 2); 650 static final AssignmentKind COMPOUND_RIGHT = new AssignmentKind('COMPOUND_RIGH T', 2);
629 static final AssignmentKind POSTFIX_INC = new AssignmentKind('POSTFIX_INC', 3) ; 651 static final AssignmentKind POSTFIX_INC = new AssignmentKind('POSTFIX_INC', 3) ;
630 static final AssignmentKind PREFIX_DEC = new AssignmentKind('PREFIX_DEC', 4); 652 static final AssignmentKind PREFIX_DEC = new AssignmentKind('PREFIX_DEC', 4);
631 static final AssignmentKind PREFIX_INC = new AssignmentKind('PREFIX_INC', 5); 653 static final AssignmentKind PREFIX_INC = new AssignmentKind('PREFIX_INC', 5);
632 static final AssignmentKind PREFIX_NOT = new AssignmentKind('PREFIX_NOT', 6); 654 static final AssignmentKind PREFIX_NOT = new AssignmentKind('PREFIX_NOT', 6);
633 static final AssignmentKind SIMPLE_LEFT = new AssignmentKind('SIMPLE_LEFT', 7) ; 655 static final AssignmentKind SIMPLE_LEFT = new AssignmentKind('SIMPLE_LEFT', 7) ;
634 static final AssignmentKind SIMPLE_RIGHT = new AssignmentKind('SIMPLE_RIGHT', 8); 656 static final AssignmentKind SIMPLE_RIGHT = new AssignmentKind('SIMPLE_RIGHT', 8);
635 static final AssignmentKind NONE = new AssignmentKind('NONE', 9); 657 static final AssignmentKind NONE = new AssignmentKind('NONE', 9);
636 static final List<AssignmentKind> values = [BINARY, COMPOUND_LEFT, COMPOUND_RI GHT, POSTFIX_INC, PREFIX_DEC, PREFIX_INC, PREFIX_NOT, SIMPLE_LEFT, SIMPLE_RIGHT, NONE]; 658 static final List<AssignmentKind> values = [BINARY, COMPOUND_LEFT, COMPOUND_RI GHT, POSTFIX_INC, PREFIX_DEC, PREFIX_INC, PREFIX_NOT, SIMPLE_LEFT, SIMPLE_RIGHT, NONE];
637 final String __name; 659 final String __name;
638 final int __ordinal; 660 final int __ordinal;
639 int get ordinal => __ordinal; 661 int get ordinal => __ordinal;
640 AssignmentKind(this.__name, this.__ordinal) { 662 AssignmentKind(this.__name, this.__ordinal) {
641 } 663 }
664 int compareTo(AssignmentKind other) => __ordinal - other.__ordinal;
642 String toString() => __name; 665 String toString() => __name;
643 } 666 }
644 class WrapperKind { 667 class WrapperKind implements Comparable<WrapperKind> {
645 static final WrapperKind PREFIXED_LEFT = new WrapperKind('PREFIXED_LEFT', 0); 668 static final WrapperKind PREFIXED_LEFT = new WrapperKind('PREFIXED_LEFT', 0);
646 static final WrapperKind PREFIXED_RIGHT = new WrapperKind('PREFIXED_RIGHT', 1) ; 669 static final WrapperKind PREFIXED_RIGHT = new WrapperKind('PREFIXED_RIGHT', 1) ;
647 static final WrapperKind PROPERTY_LEFT = new WrapperKind('PROPERTY_LEFT', 2); 670 static final WrapperKind PROPERTY_LEFT = new WrapperKind('PROPERTY_LEFT', 2);
648 static final WrapperKind PROPERTY_RIGHT = new WrapperKind('PROPERTY_RIGHT', 3) ; 671 static final WrapperKind PROPERTY_RIGHT = new WrapperKind('PROPERTY_RIGHT', 3) ;
649 static final WrapperKind NONE = new WrapperKind('NONE', 4); 672 static final WrapperKind NONE = new WrapperKind('NONE', 4);
650 static final List<WrapperKind> values = [PREFIXED_LEFT, PREFIXED_RIGHT, PROPER TY_LEFT, PROPERTY_RIGHT, NONE]; 673 static final List<WrapperKind> values = [PREFIXED_LEFT, PREFIXED_RIGHT, PROPER TY_LEFT, PROPERTY_RIGHT, NONE];
651 final String __name; 674 final String __name;
652 final int __ordinal; 675 final int __ordinal;
653 int get ordinal => __ordinal; 676 int get ordinal => __ordinal;
654 WrapperKind(this.__name, this.__ordinal) { 677 WrapperKind(this.__name, this.__ordinal) {
655 } 678 }
679 int compareTo(WrapperKind other) => __ordinal - other.__ordinal;
656 String toString() => __name; 680 String toString() => __name;
657 } 681 }
658 class ConstantEvaluatorTest extends ParserTestCase { 682 class ConstantEvaluatorTest extends ParserTestCase {
659 void fail_constructor() { 683 void fail_constructor() {
660 Object value = getConstantValue("?"); 684 Object value = getConstantValue("?");
661 JUnitTestCase.assertEquals(null, value); 685 JUnitTestCase.assertEquals(null, value);
662 } 686 }
663 void fail_identifier_class() { 687 void fail_identifier_class() {
664 Object value = getConstantValue("?"); 688 Object value = getConstantValue("?");
665 JUnitTestCase.assertEquals(null, value); 689 JUnitTestCase.assertEquals(null, value);
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 void test_unary_negated_double() { 929 void test_unary_negated_double() {
906 Object value = getConstantValue("-42.3"); 930 Object value = getConstantValue("-42.3");
907 EngineTestCase.assertInstanceOf(double, value); 931 EngineTestCase.assertInstanceOf(double, value);
908 JUnitTestCase.assertEquals(-42.3, ((value as double))); 932 JUnitTestCase.assertEquals(-42.3, ((value as double)));
909 } 933 }
910 void test_unary_negated_integer() { 934 void test_unary_negated_integer() {
911 Object value = getConstantValue("-42"); 935 Object value = getConstantValue("-42");
912 EngineTestCase.assertInstanceOf(int, value); 936 EngineTestCase.assertInstanceOf(int, value);
913 JUnitTestCase.assertEquals(-42, ((value as int))); 937 JUnitTestCase.assertEquals(-42, ((value as int)));
914 } 938 }
915 Object getConstantValue(String source) => ParserTestCase.parseExpression(sourc e, []).accept(new ConstantEvaluator(null)); 939 Object getConstantValue(String source) => ParserTestCase.parseExpression(sourc e, []).accept(new ConstantEvaluator());
916 static dartSuite() { 940 static dartSuite() {
917 _ut.group('ConstantEvaluatorTest', () { 941 _ut.group('ConstantEvaluatorTest', () {
918 _ut.test('test_binary_bitAnd', () { 942 _ut.test('test_binary_bitAnd', () {
919 final __test = new ConstantEvaluatorTest(); 943 final __test = new ConstantEvaluatorTest();
920 runJUnitTest(__test, __test.test_binary_bitAnd); 944 runJUnitTest(__test, __test.test_binary_bitAnd);
921 }); 945 });
922 _ut.test('test_binary_bitOr', () { 946 _ut.test('test_binary_bitOr', () {
923 final __test = new ConstantEvaluatorTest(); 947 final __test = new ConstantEvaluatorTest();
924 runJUnitTest(__test, __test.test_binary_bitOr); 948 runJUnitTest(__test, __test.test_binary_bitOr);
925 }); 949 });
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 runJUnitTest(__test, __test.test_unary_negated_integer); 1136 runJUnitTest(__test, __test.test_unary_negated_integer);
1113 }); 1137 });
1114 }); 1138 });
1115 } 1139 }
1116 } 1140 }
1117 class ToSourceVisitorTest extends EngineTestCase { 1141 class ToSourceVisitorTest extends EngineTestCase {
1118 void test_visitAdjacentStrings() { 1142 void test_visitAdjacentStrings() {
1119 assertSource("'a' 'b'", ASTFactory.adjacentStrings([ASTFactory.string2("a"), ASTFactory.string2("b")])); 1143 assertSource("'a' 'b'", ASTFactory.adjacentStrings([ASTFactory.string2("a"), ASTFactory.string2("b")]));
1120 } 1144 }
1121 void test_visitAnnotation_constant() { 1145 void test_visitAnnotation_constant() {
1122 assertSource("@A", ASTFactory.annotation(ASTFactory.identifier2("A"))); 1146 assertSource("@A", ASTFactory.annotation(ASTFactory.identifier3("A")));
1123 } 1147 }
1124 void test_visitAnnotation_constructor() { 1148 void test_visitAnnotation_constructor() {
1125 assertSource("@A.c()", ASTFactory.annotation2(ASTFactory.identifier2("A"), A STFactory.identifier2("c"), ASTFactory.argumentList([]))); 1149 assertSource("@A.c()", ASTFactory.annotation2(ASTFactory.identifier3("A"), A STFactory.identifier3("c"), ASTFactory.argumentList([])));
1126 } 1150 }
1127 void test_visitArgumentDefinitionTest() { 1151 void test_visitArgumentDefinitionTest() {
1128 assertSource("?a", ASTFactory.argumentDefinitionTest("a")); 1152 assertSource("?a", ASTFactory.argumentDefinitionTest("a"));
1129 } 1153 }
1130 void test_visitArgumentList() { 1154 void test_visitArgumentList() {
1131 assertSource("(a, b)", ASTFactory.argumentList([ASTFactory.identifier2("a"), ASTFactory.identifier2("b")])); 1155 assertSource("(a, b)", ASTFactory.argumentList([ASTFactory.identifier3("a"), ASTFactory.identifier3("b")]));
1132 } 1156 }
1133 void test_visitAsExpression() { 1157 void test_visitAsExpression() {
1134 assertSource("e as T", ASTFactory.asExpression(ASTFactory.identifier2("e"), ASTFactory.typeName3("T", []))); 1158 assertSource("e as T", ASTFactory.asExpression(ASTFactory.identifier3("e"), ASTFactory.typeName4("T", [])));
1135 } 1159 }
1136 void test_visitAssertStatement() { 1160 void test_visitAssertStatement() {
1137 assertSource("assert (a);", ASTFactory.assertStatement(ASTFactory.identifier 2("a"))); 1161 assertSource("assert (a);", ASTFactory.assertStatement(ASTFactory.identifier 3("a")));
1138 } 1162 }
1139 void test_visitAssignmentExpression() { 1163 void test_visitAssignmentExpression() {
1140 assertSource("a = b", ASTFactory.assignmentExpression(ASTFactory.identifier2 ("a"), TokenType.EQ, ASTFactory.identifier2("b"))); 1164 assertSource("a = b", ASTFactory.assignmentExpression(ASTFactory.identifier3 ("a"), TokenType.EQ, ASTFactory.identifier3("b")));
1141 } 1165 }
1142 void test_visitBinaryExpression() { 1166 void test_visitBinaryExpression() {
1143 assertSource("a + b", ASTFactory.binaryExpression(ASTFactory.identifier2("a" ), TokenType.PLUS, ASTFactory.identifier2("b"))); 1167 assertSource("a + b", ASTFactory.binaryExpression(ASTFactory.identifier3("a" ), TokenType.PLUS, ASTFactory.identifier3("b")));
1144 } 1168 }
1145 void test_visitBlock_empty() { 1169 void test_visitBlock_empty() {
1146 assertSource("{}", ASTFactory.block([])); 1170 assertSource("{}", ASTFactory.block([]));
1147 } 1171 }
1148 void test_visitBlock_nonEmpty() { 1172 void test_visitBlock_nonEmpty() {
1149 assertSource("{break; break;}", ASTFactory.block([ASTFactory.breakStatement( ), ASTFactory.breakStatement()])); 1173 assertSource("{break; break;}", ASTFactory.block([ASTFactory.breakStatement( ), ASTFactory.breakStatement()]));
1150 } 1174 }
1151 void test_visitBlockFunctionBody() { 1175 void test_visitBlockFunctionBody() {
1152 assertSource("{}", ASTFactory.blockFunctionBody([])); 1176 assertSource("{}", ASTFactory.blockFunctionBody([]));
1153 } 1177 }
1154 void test_visitBooleanLiteral_false() { 1178 void test_visitBooleanLiteral_false() {
1155 assertSource("false", ASTFactory.booleanLiteral(false)); 1179 assertSource("false", ASTFactory.booleanLiteral(false));
1156 } 1180 }
1157 void test_visitBooleanLiteral_true() { 1181 void test_visitBooleanLiteral_true() {
1158 assertSource("true", ASTFactory.booleanLiteral(true)); 1182 assertSource("true", ASTFactory.booleanLiteral(true));
1159 } 1183 }
1160 void test_visitBreakStatement_label() { 1184 void test_visitBreakStatement_label() {
1161 assertSource("break l;", ASTFactory.breakStatement2("l")); 1185 assertSource("break l;", ASTFactory.breakStatement2("l"));
1162 } 1186 }
1163 void test_visitBreakStatement_noLabel() { 1187 void test_visitBreakStatement_noLabel() {
1164 assertSource("break;", ASTFactory.breakStatement()); 1188 assertSource("break;", ASTFactory.breakStatement());
1165 } 1189 }
1166 void test_visitCascadeExpression_field() { 1190 void test_visitCascadeExpression_field() {
1167 assertSource("a..b..c", ASTFactory.cascadeExpression(ASTFactory.identifier2( "a"), [ASTFactory.cascadedPropertyAccess("b"), ASTFactory.cascadedPropertyAccess ("c")])); 1191 assertSource("a..b..c", ASTFactory.cascadeExpression(ASTFactory.identifier3( "a"), [ASTFactory.cascadedPropertyAccess("b"), ASTFactory.cascadedPropertyAccess ("c")]));
1168 } 1192 }
1169 void test_visitCascadeExpression_index() { 1193 void test_visitCascadeExpression_index() {
1170 assertSource("a..[0]..[1]", ASTFactory.cascadeExpression(ASTFactory.identifi er2("a"), [ASTFactory.cascadedIndexExpression(ASTFactory.integer(0)), ASTFactory .cascadedIndexExpression(ASTFactory.integer(1))])); 1194 assertSource("a..[0]..[1]", ASTFactory.cascadeExpression(ASTFactory.identifi er3("a"), [ASTFactory.cascadedIndexExpression(ASTFactory.integer(0)), ASTFactory .cascadedIndexExpression(ASTFactory.integer(1))]));
1171 } 1195 }
1172 void test_visitCascadeExpression_method() { 1196 void test_visitCascadeExpression_method() {
1173 assertSource("a..b()..c()", ASTFactory.cascadeExpression(ASTFactory.identifi er2("a"), [ASTFactory.cascadedMethodInvocation("b", []), ASTFactory.cascadedMeth odInvocation("c", [])])); 1197 assertSource("a..b()..c()", ASTFactory.cascadeExpression(ASTFactory.identifi er3("a"), [ASTFactory.cascadedMethodInvocation("b", []), ASTFactory.cascadedMeth odInvocation("c", [])]));
1174 } 1198 }
1175 void test_visitCatchClause_catch_noStack() { 1199 void test_visitCatchClause_catch_noStack() {
1176 assertSource("catch (e) {}", ASTFactory.catchClause("e", [])); 1200 assertSource("catch (e) {}", ASTFactory.catchClause("e", []));
1177 } 1201 }
1178 void test_visitCatchClause_catch_stack() { 1202 void test_visitCatchClause_catch_stack() {
1179 assertSource("catch (e, s) {}", ASTFactory.catchClause2("e", "s", [])); 1203 assertSource("catch (e, s) {}", ASTFactory.catchClause2("e", "s", []));
1180 } 1204 }
1181 void test_visitCatchClause_on() { 1205 void test_visitCatchClause_on() {
1182 assertSource("on E {}", ASTFactory.catchClause3(ASTFactory.typeName3("E", [] ), [])); 1206 assertSource("on E {}", ASTFactory.catchClause3(ASTFactory.typeName4("E", [] ), []));
1183 } 1207 }
1184 void test_visitCatchClause_on_catch() { 1208 void test_visitCatchClause_on_catch() {
1185 assertSource("on E catch (e) {}", ASTFactory.catchClause4(ASTFactory.typeNam e3("E", []), "e", [])); 1209 assertSource("on E catch (e) {}", ASTFactory.catchClause4(ASTFactory.typeNam e4("E", []), "e", []));
1186 } 1210 }
1187 void test_visitClassDeclaration_abstract() { 1211 void test_visitClassDeclaration_abstract() {
1188 assertSource("abstract class C {}", ASTFactory.classDeclaration(Keyword.ABST RACT, "C", null, null, null, null, [])); 1212 assertSource("abstract class C {}", ASTFactory.classDeclaration(Keyword.ABST RACT, "C", null, null, null, null, []));
1189 } 1213 }
1190 void test_visitClassDeclaration_empty() { 1214 void test_visitClassDeclaration_empty() {
1191 assertSource("class C {}", ASTFactory.classDeclaration(null, "C", null, null , null, null, [])); 1215 assertSource("class C {}", ASTFactory.classDeclaration(null, "C", null, null , null, null, []));
1192 } 1216 }
1193 void test_visitClassDeclaration_extends() { 1217 void test_visitClassDeclaration_extends() {
1194 assertSource("class C extends A {}", ASTFactory.classDeclaration(null, "C", null, ASTFactory.extendsClause(ASTFactory.typeName3("A", [])), null, null, [])); 1218 assertSource("class C extends A {}", ASTFactory.classDeclaration(null, "C", null, ASTFactory.extendsClause(ASTFactory.typeName4("A", [])), null, null, []));
1195 } 1219 }
1196 void test_visitClassDeclaration_extends_implements() { 1220 void test_visitClassDeclaration_extends_implements() {
1197 assertSource("class C extends A implements B {}", ASTFactory.classDeclaratio n(null, "C", null, ASTFactory.extendsClause(ASTFactory.typeName3("A", [])), null , ASTFactory.implementsClause([ASTFactory.typeName3("B", [])]), [])); 1221 assertSource("class C extends A implements B {}", ASTFactory.classDeclaratio n(null, "C", null, ASTFactory.extendsClause(ASTFactory.typeName4("A", [])), null , ASTFactory.implementsClause([ASTFactory.typeName4("B", [])]), []));
1198 } 1222 }
1199 void test_visitClassDeclaration_extends_with() { 1223 void test_visitClassDeclaration_extends_with() {
1200 assertSource("class C extends A with M {}", ASTFactory.classDeclaration(null , "C", null, ASTFactory.extendsClause(ASTFactory.typeName3("A", [])), ASTFactory .withClause([ASTFactory.typeName3("M", [])]), null, [])); 1224 assertSource("class C extends A with M {}", ASTFactory.classDeclaration(null , "C", null, ASTFactory.extendsClause(ASTFactory.typeName4("A", [])), ASTFactory .withClause([ASTFactory.typeName4("M", [])]), null, []));
1201 } 1225 }
1202 void test_visitClassDeclaration_extends_with_implements() { 1226 void test_visitClassDeclaration_extends_with_implements() {
1203 assertSource("class C extends A with M implements B {}", ASTFactory.classDec laration(null, "C", null, ASTFactory.extendsClause(ASTFactory.typeName3("A", []) ), ASTFactory.withClause([ASTFactory.typeName3("M", [])]), ASTFactory.implements Clause([ASTFactory.typeName3("B", [])]), [])); 1227 assertSource("class C extends A with M implements B {}", ASTFactory.classDec laration(null, "C", null, ASTFactory.extendsClause(ASTFactory.typeName4("A", []) ), ASTFactory.withClause([ASTFactory.typeName4("M", [])]), ASTFactory.implements Clause([ASTFactory.typeName4("B", [])]), []));
1204 } 1228 }
1205 void test_visitClassDeclaration_implements() { 1229 void test_visitClassDeclaration_implements() {
1206 assertSource("class C implements B {}", ASTFactory.classDeclaration(null, "C ", null, null, null, ASTFactory.implementsClause([ASTFactory.typeName3("B", [])] ), [])); 1230 assertSource("class C implements B {}", ASTFactory.classDeclaration(null, "C ", null, null, null, ASTFactory.implementsClause([ASTFactory.typeName4("B", [])] ), []));
1207 } 1231 }
1208 void test_visitClassDeclaration_multipleMember() { 1232 void test_visitClassDeclaration_multipleMember() {
1209 assertSource("class C {var a; var b;}", ASTFactory.classDeclaration(null, "C ", null, null, null, null, [ASTFactory.fieldDeclaration2(false, Keyword.VAR, [AS TFactory.variableDeclaration("a")]), ASTFactory.fieldDeclaration2(false, Keyword .VAR, [ASTFactory.variableDeclaration("b")])])); 1233 assertSource("class C {var a; var b;}", ASTFactory.classDeclaration(null, "C ", null, null, null, null, [ASTFactory.fieldDeclaration2(false, Keyword.VAR, [AS TFactory.variableDeclaration("a")]), ASTFactory.fieldDeclaration2(false, Keyword .VAR, [ASTFactory.variableDeclaration("b")])]));
1210 } 1234 }
1211 void test_visitClassDeclaration_parameters() { 1235 void test_visitClassDeclaration_parameters() {
1212 assertSource("class C<E> {}", ASTFactory.classDeclaration(null, "C", ASTFact ory.typeParameterList(["E"]), null, null, null, [])); 1236 assertSource("class C<E> {}", ASTFactory.classDeclaration(null, "C", ASTFact ory.typeParameterList(["E"]), null, null, null, []));
1213 } 1237 }
1214 void test_visitClassDeclaration_parameters_extends() { 1238 void test_visitClassDeclaration_parameters_extends() {
1215 assertSource("class C<E> extends A {}", ASTFactory.classDeclaration(null, "C ", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsClause(ASTFactory.type Name3("A", [])), null, null, [])); 1239 assertSource("class C<E> extends A {}", ASTFactory.classDeclaration(null, "C ", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsClause(ASTFactory.type Name4("A", [])), null, null, []));
1216 } 1240 }
1217 void test_visitClassDeclaration_parameters_extends_implements() { 1241 void test_visitClassDeclaration_parameters_extends_implements() {
1218 assertSource("class C<E> extends A implements B {}", ASTFactory.classDeclara tion(null, "C", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsClause(AS TFactory.typeName3("A", [])), null, ASTFactory.implementsClause([ASTFactory.type Name3("B", [])]), [])); 1242 assertSource("class C<E> extends A implements B {}", ASTFactory.classDeclara tion(null, "C", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsClause(AS TFactory.typeName4("A", [])), null, ASTFactory.implementsClause([ASTFactory.type Name4("B", [])]), []));
1219 } 1243 }
1220 void test_visitClassDeclaration_parameters_extends_with() { 1244 void test_visitClassDeclaration_parameters_extends_with() {
1221 assertSource("class C<E> extends A with M {}", ASTFactory.classDeclaration(n ull, "C", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsClause(ASTFacto ry.typeName3("A", [])), ASTFactory.withClause([ASTFactory.typeName3("M", [])]), null, [])); 1245 assertSource("class C<E> extends A with M {}", ASTFactory.classDeclaration(n ull, "C", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsClause(ASTFacto ry.typeName4("A", [])), ASTFactory.withClause([ASTFactory.typeName4("M", [])]), null, []));
1222 } 1246 }
1223 void test_visitClassDeclaration_parameters_extends_with_implements() { 1247 void test_visitClassDeclaration_parameters_extends_with_implements() {
1224 assertSource("class C<E> extends A with M implements B {}", ASTFactory.class Declaration(null, "C", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsCl ause(ASTFactory.typeName3("A", [])), ASTFactory.withClause([ASTFactory.typeName3 ("M", [])]), ASTFactory.implementsClause([ASTFactory.typeName3("B", [])]), [])); 1248 assertSource("class C<E> extends A with M implements B {}", ASTFactory.class Declaration(null, "C", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsCl ause(ASTFactory.typeName4("A", [])), ASTFactory.withClause([ASTFactory.typeName4 ("M", [])]), ASTFactory.implementsClause([ASTFactory.typeName4("B", [])]), []));
1225 } 1249 }
1226 void test_visitClassDeclaration_parameters_implements() { 1250 void test_visitClassDeclaration_parameters_implements() {
1227 assertSource("class C<E> implements B {}", ASTFactory.classDeclaration(null, "C", ASTFactory.typeParameterList(["E"]), null, null, ASTFactory.implementsClau se([ASTFactory.typeName3("B", [])]), [])); 1251 assertSource("class C<E> implements B {}", ASTFactory.classDeclaration(null, "C", ASTFactory.typeParameterList(["E"]), null, null, ASTFactory.implementsClau se([ASTFactory.typeName4("B", [])]), []));
1228 } 1252 }
1229 void test_visitClassDeclaration_singleMember() { 1253 void test_visitClassDeclaration_singleMember() {
1230 assertSource("class C {var a;}", ASTFactory.classDeclaration(null, "C", null , null, null, null, [ASTFactory.fieldDeclaration2(false, Keyword.VAR, [ASTFactor y.variableDeclaration("a")])])); 1254 assertSource("class C {var a;}", ASTFactory.classDeclaration(null, "C", null , null, null, null, [ASTFactory.fieldDeclaration2(false, Keyword.VAR, [ASTFactor y.variableDeclaration("a")])]));
1231 } 1255 }
1232 void test_visitClassTypeAlias_abstract() { 1256 void test_visitClassTypeAlias_abstract() {
1233 assertSource("typedef C = abstract S with M1;", ASTFactory.classTypeAlias("C ", null, Keyword.ABSTRACT, ASTFactory.typeName3("S", []), ASTFactory.withClause( [ASTFactory.typeName3("M1", [])]), null)); 1257 assertSource("typedef C = abstract S with M1;", ASTFactory.classTypeAlias("C ", null, Keyword.ABSTRACT, ASTFactory.typeName4("S", []), ASTFactory.withClause( [ASTFactory.typeName4("M1", [])]), null));
1234 } 1258 }
1235 void test_visitClassTypeAlias_abstract_implements() { 1259 void test_visitClassTypeAlias_abstract_implements() {
1236 assertSource("typedef C = abstract S with M1 implements I;", ASTFactory.clas sTypeAlias("C", null, Keyword.ABSTRACT, ASTFactory.typeName3("S", []), ASTFactor y.withClause([ASTFactory.typeName3("M1", [])]), ASTFactory.implementsClause([AST Factory.typeName3("I", [])]))); 1260 assertSource("typedef C = abstract S with M1 implements I;", ASTFactory.clas sTypeAlias("C", null, Keyword.ABSTRACT, ASTFactory.typeName4("S", []), ASTFactor y.withClause([ASTFactory.typeName4("M1", [])]), ASTFactory.implementsClause([AST Factory.typeName4("I", [])])));
1237 } 1261 }
1238 void test_visitClassTypeAlias_generic() { 1262 void test_visitClassTypeAlias_generic() {
1239 assertSource("typedef C<E> = S<E> with M1<E>;", ASTFactory.classTypeAlias("C ", ASTFactory.typeParameterList(["E"]), null, ASTFactory.typeName3("S", [ASTFact ory.typeName3("E", [])]), ASTFactory.withClause([ASTFactory.typeName3("M1", [AST Factory.typeName3("E", [])])]), null)); 1263 assertSource("typedef C<E> = S<E> with M1<E>;", ASTFactory.classTypeAlias("C ", ASTFactory.typeParameterList(["E"]), null, ASTFactory.typeName4("S", [ASTFact ory.typeName4("E", [])]), ASTFactory.withClause([ASTFactory.typeName4("M1", [AST Factory.typeName4("E", [])])]), null));
1240 } 1264 }
1241 void test_visitClassTypeAlias_implements() { 1265 void test_visitClassTypeAlias_implements() {
1242 assertSource("typedef C = S with M1 implements I;", ASTFactory.classTypeAlia s("C", null, null, ASTFactory.typeName3("S", []), ASTFactory.withClause([ASTFact ory.typeName3("M1", [])]), ASTFactory.implementsClause([ASTFactory.typeName3("I" , [])]))); 1266 assertSource("typedef C = S with M1 implements I;", ASTFactory.classTypeAlia s("C", null, null, ASTFactory.typeName4("S", []), ASTFactory.withClause([ASTFact ory.typeName4("M1", [])]), ASTFactory.implementsClause([ASTFactory.typeName4("I" , [])])));
1243 } 1267 }
1244 void test_visitClassTypeAlias_minimal() { 1268 void test_visitClassTypeAlias_minimal() {
1245 assertSource("typedef C = S with M1;", ASTFactory.classTypeAlias("C", null, null, ASTFactory.typeName3("S", []), ASTFactory.withClause([ASTFactory.typeName3 ("M1", [])]), null)); 1269 assertSource("typedef C = S with M1;", ASTFactory.classTypeAlias("C", null, null, ASTFactory.typeName4("S", []), ASTFactory.withClause([ASTFactory.typeName4 ("M1", [])]), null));
1246 } 1270 }
1247 void test_visitClassTypeAlias_parameters_abstract() { 1271 void test_visitClassTypeAlias_parameters_abstract() {
1248 assertSource("typedef C<E> = abstract S with M1;", ASTFactory.classTypeAlias ("C", ASTFactory.typeParameterList(["E"]), Keyword.ABSTRACT, ASTFactory.typeName 3("S", []), ASTFactory.withClause([ASTFactory.typeName3("M1", [])]), null)); 1272 assertSource("typedef C<E> = abstract S with M1;", ASTFactory.classTypeAlias ("C", ASTFactory.typeParameterList(["E"]), Keyword.ABSTRACT, ASTFactory.typeName 4("S", []), ASTFactory.withClause([ASTFactory.typeName4("M1", [])]), null));
1249 } 1273 }
1250 void test_visitClassTypeAlias_parameters_abstract_implements() { 1274 void test_visitClassTypeAlias_parameters_abstract_implements() {
1251 assertSource("typedef C<E> = abstract S with M1 implements I;", ASTFactory.c lassTypeAlias("C", ASTFactory.typeParameterList(["E"]), Keyword.ABSTRACT, ASTFac tory.typeName3("S", []), ASTFactory.withClause([ASTFactory.typeName3("M1", [])]) , ASTFactory.implementsClause([ASTFactory.typeName3("I", [])]))); 1275 assertSource("typedef C<E> = abstract S with M1 implements I;", ASTFactory.c lassTypeAlias("C", ASTFactory.typeParameterList(["E"]), Keyword.ABSTRACT, ASTFac tory.typeName4("S", []), ASTFactory.withClause([ASTFactory.typeName4("M1", [])]) , ASTFactory.implementsClause([ASTFactory.typeName4("I", [])])));
1252 } 1276 }
1253 void test_visitClassTypeAlias_parameters_implements() { 1277 void test_visitClassTypeAlias_parameters_implements() {
1254 assertSource("typedef C<E> = S with M1 implements I;", ASTFactory.classTypeA lias("C", ASTFactory.typeParameterList(["E"]), null, ASTFactory.typeName3("S", [ ]), ASTFactory.withClause([ASTFactory.typeName3("M1", [])]), ASTFactory.implemen tsClause([ASTFactory.typeName3("I", [])]))); 1278 assertSource("typedef C<E> = S with M1 implements I;", ASTFactory.classTypeA lias("C", ASTFactory.typeParameterList(["E"]), null, ASTFactory.typeName4("S", [ ]), ASTFactory.withClause([ASTFactory.typeName4("M1", [])]), ASTFactory.implemen tsClause([ASTFactory.typeName4("I", [])])));
1255 } 1279 }
1256 void test_visitComment() { 1280 void test_visitComment() {
1257 assertSource("", Comment.createBlockComment(<Token> [TokenFactory.token2("/* comment */")])); 1281 assertSource("", Comment.createBlockComment(<Token> [TokenFactory.token2("/* comment */")]));
1258 } 1282 }
1259 void test_visitCommentReference() { 1283 void test_visitCommentReference() {
1260 assertSource("", new CommentReference.full(null, ASTFactory.identifier2("a") )); 1284 assertSource("", new CommentReference.full(null, ASTFactory.identifier3("a") ));
1261 } 1285 }
1262 void test_visitCompilationUnit_declaration() { 1286 void test_visitCompilationUnit_declaration() {
1263 assertSource("var a;", ASTFactory.compilationUnit2([ASTFactory.topLevelVaria bleDeclaration2(Keyword.VAR, [ASTFactory.variableDeclaration("a")])])); 1287 assertSource("var a;", ASTFactory.compilationUnit2([ASTFactory.topLevelVaria bleDeclaration2(Keyword.VAR, [ASTFactory.variableDeclaration("a")])]));
1264 } 1288 }
1265 void test_visitCompilationUnit_directive() { 1289 void test_visitCompilationUnit_directive() {
1266 assertSource("library l;", ASTFactory.compilationUnit3([ASTFactory.libraryDi rective2("l")])); 1290 assertSource("library l;", ASTFactory.compilationUnit3([ASTFactory.libraryDi rective2("l")]));
1267 } 1291 }
1268 void test_visitCompilationUnit_directive_declaration() { 1292 void test_visitCompilationUnit_directive_declaration() {
1269 assertSource("library l; var a;", ASTFactory.compilationUnit4(ASTFactory.lis t([(ASTFactory.libraryDirective2("l") as Directive)]), ASTFactory.list([(ASTFact ory.topLevelVariableDeclaration2(Keyword.VAR, [ASTFactory.variableDeclaration("a ")]) as CompilationUnitMember)]))); 1293 assertSource("library l; var a;", ASTFactory.compilationUnit4(ASTFactory.lis t([(ASTFactory.libraryDirective2("l") as Directive)]), ASTFactory.list([(ASTFact ory.topLevelVariableDeclaration2(Keyword.VAR, [ASTFactory.variableDeclaration("a ")]) as CompilationUnitMember)])));
1270 } 1294 }
1271 void test_visitCompilationUnit_empty() { 1295 void test_visitCompilationUnit_empty() {
1272 assertSource("", ASTFactory.compilationUnit()); 1296 assertSource("", ASTFactory.compilationUnit());
1273 } 1297 }
1274 void test_visitCompilationUnit_script() { 1298 void test_visitCompilationUnit_script() {
1275 assertSource("!#/bin/dartvm", ASTFactory.compilationUnit5("!#/bin/dartvm")); 1299 assertSource("!#/bin/dartvm", ASTFactory.compilationUnit5("!#/bin/dartvm"));
1276 } 1300 }
1277 void test_visitCompilationUnit_script_declaration() { 1301 void test_visitCompilationUnit_script_declaration() {
1278 assertSource("!#/bin/dartvm var a;", ASTFactory.compilationUnit6("!#/bin/dar tvm", [ASTFactory.topLevelVariableDeclaration2(Keyword.VAR, [ASTFactory.variable Declaration("a")])])); 1302 assertSource("!#/bin/dartvm var a;", ASTFactory.compilationUnit6("!#/bin/dar tvm", [ASTFactory.topLevelVariableDeclaration2(Keyword.VAR, [ASTFactory.variable Declaration("a")])]));
1279 } 1303 }
1280 void test_visitCompilationUnit_script_directive() { 1304 void test_visitCompilationUnit_script_directive() {
1281 assertSource("!#/bin/dartvm library l;", ASTFactory.compilationUnit7("!#/bin /dartvm", [ASTFactory.libraryDirective2("l")])); 1305 assertSource("!#/bin/dartvm library l;", ASTFactory.compilationUnit7("!#/bin /dartvm", [ASTFactory.libraryDirective2("l")]));
1282 } 1306 }
1283 void test_visitCompilationUnit_script_directives_declarations() { 1307 void test_visitCompilationUnit_script_directives_declarations() {
1284 assertSource("!#/bin/dartvm library l; var a;", ASTFactory.compilationUnit8( "!#/bin/dartvm", ASTFactory.list([(ASTFactory.libraryDirective2("l") as Directiv e)]), ASTFactory.list([(ASTFactory.topLevelVariableDeclaration2(Keyword.VAR, [AS TFactory.variableDeclaration("a")]) as CompilationUnitMember)]))); 1308 assertSource("!#/bin/dartvm library l; var a;", ASTFactory.compilationUnit8( "!#/bin/dartvm", ASTFactory.list([(ASTFactory.libraryDirective2("l") as Directiv e)]), ASTFactory.list([(ASTFactory.topLevelVariableDeclaration2(Keyword.VAR, [AS TFactory.variableDeclaration("a")]) as CompilationUnitMember)])));
1285 } 1309 }
1286 void test_visitConditionalExpression() { 1310 void test_visitConditionalExpression() {
1287 assertSource("a ? b : c", ASTFactory.conditionalExpression(ASTFactory.identi fier2("a"), ASTFactory.identifier2("b"), ASTFactory.identifier2("c"))); 1311 assertSource("a ? b : c", ASTFactory.conditionalExpression(ASTFactory.identi fier3("a"), ASTFactory.identifier3("b"), ASTFactory.identifier3("c")));
1288 } 1312 }
1289 void test_visitConstructorDeclaration_const() { 1313 void test_visitConstructorDeclaration_const() {
1290 assertSource("const C() {}", ASTFactory.constructorDeclaration2(Keyword.CONS T, null, ASTFactory.identifier2("C"), null, ASTFactory.formalParameterList([]), null, ASTFactory.blockFunctionBody([]))); 1314 assertSource("const C() {}", ASTFactory.constructorDeclaration2(Keyword.CONS T, null, ASTFactory.identifier3("C"), null, ASTFactory.formalParameterList([]), null, ASTFactory.blockFunctionBody([])));
1291 } 1315 }
1292 void test_visitConstructorDeclaration_external() { 1316 void test_visitConstructorDeclaration_external() {
1293 assertSource("external C();", ASTFactory.constructorDeclaration(ASTFactory.i dentifier2("C"), null, ASTFactory.formalParameterList([]), null)); 1317 assertSource("external C();", ASTFactory.constructorDeclaration(ASTFactory.i dentifier3("C"), null, ASTFactory.formalParameterList([]), null));
1294 } 1318 }
1295 void test_visitConstructorDeclaration_minimal() { 1319 void test_visitConstructorDeclaration_minimal() {
1296 assertSource("C() {}", ASTFactory.constructorDeclaration2(null, null, ASTFac tory.identifier2("C"), null, ASTFactory.formalParameterList([]), null, ASTFactor y.blockFunctionBody([]))); 1320 assertSource("C() {}", ASTFactory.constructorDeclaration2(null, null, ASTFac tory.identifier3("C"), null, ASTFactory.formalParameterList([]), null, ASTFactor y.blockFunctionBody([])));
1297 } 1321 }
1298 void test_visitConstructorDeclaration_multipleInitializers() { 1322 void test_visitConstructorDeclaration_multipleInitializers() {
1299 assertSource("C() : a = b, c = d {}", ASTFactory.constructorDeclaration2(nul l, null, ASTFactory.identifier2("C"), null, ASTFactory.formalParameterList([]), ASTFactory.list([(ASTFactory.constructorFieldInitializer(false, "a", ASTFactory. identifier2("b")) as ConstructorInitializer), ASTFactory.constructorFieldInitial izer(false, "c", ASTFactory.identifier2("d"))]), ASTFactory.blockFunctionBody([] ))); 1323 assertSource("C() : a = b, c = d {}", ASTFactory.constructorDeclaration2(nul l, null, ASTFactory.identifier3("C"), null, ASTFactory.formalParameterList([]), ASTFactory.list([(ASTFactory.constructorFieldInitializer(false, "a", ASTFactory. identifier3("b")) as ConstructorInitializer), ASTFactory.constructorFieldInitial izer(false, "c", ASTFactory.identifier3("d"))]), ASTFactory.blockFunctionBody([] )));
1300 } 1324 }
1301 void test_visitConstructorDeclaration_multipleParameters() { 1325 void test_visitConstructorDeclaration_multipleParameters() {
1302 assertSource("C(var a, var b) {}", ASTFactory.constructorDeclaration2(null, null, ASTFactory.identifier2("C"), null, ASTFactory.formalParameterList([ASTFact ory.simpleFormalParameter(Keyword.VAR, "a"), ASTFactory.simpleFormalParameter(Ke yword.VAR, "b")]), null, ASTFactory.blockFunctionBody([]))); 1326 assertSource("C(var a, var b) {}", ASTFactory.constructorDeclaration2(null, null, ASTFactory.identifier3("C"), null, ASTFactory.formalParameterList([ASTFact ory.simpleFormalParameter(Keyword.VAR, "a"), ASTFactory.simpleFormalParameter(Ke yword.VAR, "b")]), null, ASTFactory.blockFunctionBody([])));
1303 } 1327 }
1304 void test_visitConstructorDeclaration_named() { 1328 void test_visitConstructorDeclaration_named() {
1305 assertSource("C.m() {}", ASTFactory.constructorDeclaration2(null, null, ASTF actory.identifier2("C"), "m", ASTFactory.formalParameterList([]), null, ASTFacto ry.blockFunctionBody([]))); 1329 assertSource("C.m() {}", ASTFactory.constructorDeclaration2(null, null, ASTF actory.identifier3("C"), "m", ASTFactory.formalParameterList([]), null, ASTFacto ry.blockFunctionBody([])));
1306 } 1330 }
1307 void test_visitConstructorDeclaration_singleInitializer() { 1331 void test_visitConstructorDeclaration_singleInitializer() {
1308 assertSource("C() : a = b {}", ASTFactory.constructorDeclaration2(null, null , ASTFactory.identifier2("C"), null, ASTFactory.formalParameterList([]), ASTFact ory.list([(ASTFactory.constructorFieldInitializer(false, "a", ASTFactory.identif ier2("b")) as ConstructorInitializer)]), ASTFactory.blockFunctionBody([]))); 1332 assertSource("C() : a = b {}", ASTFactory.constructorDeclaration2(null, null , ASTFactory.identifier3("C"), null, ASTFactory.formalParameterList([]), ASTFact ory.list([(ASTFactory.constructorFieldInitializer(false, "a", ASTFactory.identif ier3("b")) as ConstructorInitializer)]), ASTFactory.blockFunctionBody([])));
1309 } 1333 }
1310 void test_visitConstructorFieldInitializer_withoutThis() { 1334 void test_visitConstructorFieldInitializer_withoutThis() {
1311 assertSource("a = b", ASTFactory.constructorFieldInitializer(false, "a", AST Factory.identifier2("b"))); 1335 assertSource("a = b", ASTFactory.constructorFieldInitializer(false, "a", AST Factory.identifier3("b")));
1312 } 1336 }
1313 void test_visitConstructorFieldInitializer_withThis() { 1337 void test_visitConstructorFieldInitializer_withThis() {
1314 assertSource("this.a = b", ASTFactory.constructorFieldInitializer(true, "a", ASTFactory.identifier2("b"))); 1338 assertSource("this.a = b", ASTFactory.constructorFieldInitializer(true, "a", ASTFactory.identifier3("b")));
1315 } 1339 }
1316 void test_visitConstructorName_named_prefix() { 1340 void test_visitConstructorName_named_prefix() {
1317 assertSource("p.C.n", ASTFactory.constructorName(ASTFactory.typeName3("p.C.n ", []), null)); 1341 assertSource("p.C.n", ASTFactory.constructorName(ASTFactory.typeName4("p.C.n ", []), null));
1318 } 1342 }
1319 void test_visitConstructorName_unnamed_noPrefix() { 1343 void test_visitConstructorName_unnamed_noPrefix() {
1320 assertSource("C", ASTFactory.constructorName(ASTFactory.typeName3("C", []), null)); 1344 assertSource("C", ASTFactory.constructorName(ASTFactory.typeName4("C", []), null));
1321 } 1345 }
1322 void test_visitConstructorName_unnamed_prefix() { 1346 void test_visitConstructorName_unnamed_prefix() {
1323 assertSource("p.C", ASTFactory.constructorName(ASTFactory.typeName2(ASTFacto ry.identifier4("p", "C"), []), null)); 1347 assertSource("p.C", ASTFactory.constructorName(ASTFactory.typeName3(ASTFacto ry.identifier5("p", "C"), []), null));
1324 } 1348 }
1325 void test_visitContinueStatement_label() { 1349 void test_visitContinueStatement_label() {
1326 assertSource("continue l;", ASTFactory.continueStatement2("l")); 1350 assertSource("continue l;", ASTFactory.continueStatement2("l"));
1327 } 1351 }
1328 void test_visitContinueStatement_noLabel() { 1352 void test_visitContinueStatement_noLabel() {
1329 assertSource("continue;", ASTFactory.continueStatement()); 1353 assertSource("continue;", ASTFactory.continueStatement());
1330 } 1354 }
1331 void test_visitDefaultFormalParameter_named_noValue() { 1355 void test_visitDefaultFormalParameter_named_noValue() {
1332 assertSource("p", ASTFactory.namedFormalParameter(ASTFactory.simpleFormalPar ameter3("p"), null)); 1356 assertSource("p", ASTFactory.namedFormalParameter(ASTFactory.simpleFormalPar ameter3("p"), null));
1333 } 1357 }
1334 void test_visitDefaultFormalParameter_named_value() { 1358 void test_visitDefaultFormalParameter_named_value() {
1335 assertSource("p : 0", ASTFactory.namedFormalParameter(ASTFactory.simpleForma lParameter3("p"), ASTFactory.integer(0))); 1359 assertSource("p : 0", ASTFactory.namedFormalParameter(ASTFactory.simpleForma lParameter3("p"), ASTFactory.integer(0)));
1336 } 1360 }
1337 void test_visitDefaultFormalParameter_positional_noValue() { 1361 void test_visitDefaultFormalParameter_positional_noValue() {
1338 assertSource("p", ASTFactory.positionalFormalParameter(ASTFactory.simpleForm alParameter3("p"), null)); 1362 assertSource("p", ASTFactory.positionalFormalParameter(ASTFactory.simpleForm alParameter3("p"), null));
1339 } 1363 }
1340 void test_visitDefaultFormalParameter_positional_value() { 1364 void test_visitDefaultFormalParameter_positional_value() {
1341 assertSource("p = 0", ASTFactory.positionalFormalParameter(ASTFactory.simple FormalParameter3("p"), ASTFactory.integer(0))); 1365 assertSource("p = 0", ASTFactory.positionalFormalParameter(ASTFactory.simple FormalParameter3("p"), ASTFactory.integer(0)));
1342 } 1366 }
1343 void test_visitDoStatement() { 1367 void test_visitDoStatement() {
1344 assertSource("do {} while (c);", ASTFactory.doStatement(ASTFactory.block([]) , ASTFactory.identifier2("c"))); 1368 assertSource("do {} while (c);", ASTFactory.doStatement(ASTFactory.block([]) , ASTFactory.identifier3("c")));
1345 } 1369 }
1346 void test_visitDoubleLiteral() { 1370 void test_visitDoubleLiteral() {
1347 assertSource("4.2", ASTFactory.doubleLiteral(4.2)); 1371 assertSource("4.2", ASTFactory.doubleLiteral(4.2));
1348 } 1372 }
1349 void test_visitEmptyFunctionBody() { 1373 void test_visitEmptyFunctionBody() {
1350 assertSource(";", ASTFactory.emptyFunctionBody()); 1374 assertSource(";", ASTFactory.emptyFunctionBody());
1351 } 1375 }
1352 void test_visitEmptyStatement() { 1376 void test_visitEmptyStatement() {
1353 assertSource(";", ASTFactory.emptyStatement()); 1377 assertSource(";", ASTFactory.emptyStatement());
1354 } 1378 }
1355 void test_visitExportDirective_combinator() { 1379 void test_visitExportDirective_combinator() {
1356 assertSource("export 'a.dart' show A;", ASTFactory.exportDirective2("a.dart" , [(ASTFactory.showCombinator([ASTFactory.identifier2("A")]) as Combinator)])); 1380 assertSource("export 'a.dart' show A;", ASTFactory.exportDirective2("a.dart" , [(ASTFactory.showCombinator([ASTFactory.identifier3("A")]) as Combinator)]));
1357 } 1381 }
1358 void test_visitExportDirective_combinators() { 1382 void test_visitExportDirective_combinators() {
1359 assertSource("export 'a.dart' show A hide B;", ASTFactory.exportDirective2(" a.dart", [ASTFactory.showCombinator([ASTFactory.identifier2("A")]), ASTFactory.h ideCombinator([ASTFactory.identifier2("B")])])); 1383 assertSource("export 'a.dart' show A hide B;", ASTFactory.exportDirective2(" a.dart", [ASTFactory.showCombinator([ASTFactory.identifier3("A")]), ASTFactory.h ideCombinator([ASTFactory.identifier3("B")])]));
1360 } 1384 }
1361 void test_visitExportDirective_minimal() { 1385 void test_visitExportDirective_minimal() {
1362 assertSource("export 'a.dart';", ASTFactory.exportDirective2("a.dart", [])); 1386 assertSource("export 'a.dart';", ASTFactory.exportDirective2("a.dart", []));
1363 } 1387 }
1364 void test_visitExpressionFunctionBody() { 1388 void test_visitExpressionFunctionBody() {
1365 assertSource("=> a;", ASTFactory.expressionFunctionBody(ASTFactory.identifie r2("a"))); 1389 assertSource("=> a;", ASTFactory.expressionFunctionBody(ASTFactory.identifie r3("a")));
1366 } 1390 }
1367 void test_visitExpressionStatement() { 1391 void test_visitExpressionStatement() {
1368 assertSource("a;", ASTFactory.expressionStatement(ASTFactory.identifier2("a" ))); 1392 assertSource("a;", ASTFactory.expressionStatement(ASTFactory.identifier3("a" )));
1369 } 1393 }
1370 void test_visitExtendsClause() { 1394 void test_visitExtendsClause() {
1371 assertSource("extends C", ASTFactory.extendsClause(ASTFactory.typeName3("C", []))); 1395 assertSource("extends C", ASTFactory.extendsClause(ASTFactory.typeName4("C", [])));
1372 } 1396 }
1373 void test_visitFieldDeclaration_instance() { 1397 void test_visitFieldDeclaration_instance() {
1374 assertSource("var a;", ASTFactory.fieldDeclaration2(false, Keyword.VAR, [AST Factory.variableDeclaration("a")])); 1398 assertSource("var a;", ASTFactory.fieldDeclaration2(false, Keyword.VAR, [AST Factory.variableDeclaration("a")]));
1375 } 1399 }
1376 void test_visitFieldDeclaration_static() { 1400 void test_visitFieldDeclaration_static() {
1377 assertSource("static var a;", ASTFactory.fieldDeclaration2(true, Keyword.VAR , [ASTFactory.variableDeclaration("a")])); 1401 assertSource("static var a;", ASTFactory.fieldDeclaration2(true, Keyword.VAR , [ASTFactory.variableDeclaration("a")]));
1378 } 1402 }
1379 void test_visitFieldFormalParameter_keyword() { 1403 void test_visitFieldFormalParameter_keyword() {
1380 assertSource("var this.a", ASTFactory.fieldFormalParameter(Keyword.VAR, null , "a")); 1404 assertSource("var this.a", ASTFactory.fieldFormalParameter(Keyword.VAR, null , "a"));
1381 } 1405 }
1382 void test_visitFieldFormalParameter_keywordAndType() { 1406 void test_visitFieldFormalParameter_keywordAndType() {
1383 assertSource("final A this.a", ASTFactory.fieldFormalParameter(Keyword.FINAL , ASTFactory.typeName3("A", []), "a")); 1407 assertSource("final A this.a", ASTFactory.fieldFormalParameter(Keyword.FINAL , ASTFactory.typeName4("A", []), "a"));
1384 } 1408 }
1385 void test_visitFieldFormalParameter_type() { 1409 void test_visitFieldFormalParameter_type() {
1386 assertSource("A this.a", ASTFactory.fieldFormalParameter(null, ASTFactory.ty peName3("A", []), "a")); 1410 assertSource("A this.a", ASTFactory.fieldFormalParameter(null, ASTFactory.ty peName4("A", []), "a"));
1387 } 1411 }
1388 void test_visitForEachStatement() { 1412 void test_visitForEachStatement() {
1389 assertSource("for (a in b) {}", ASTFactory.forEachStatement(ASTFactory.decla redIdentifier3("a"), ASTFactory.identifier2("b"), ASTFactory.block([]))); 1413 assertSource("for (a in b) {}", ASTFactory.forEachStatement(ASTFactory.decla redIdentifier3("a"), ASTFactory.identifier3("b"), ASTFactory.block([])));
1390 } 1414 }
1391 void test_visitFormalParameterList_empty() { 1415 void test_visitFormalParameterList_empty() {
1392 assertSource("()", ASTFactory.formalParameterList([])); 1416 assertSource("()", ASTFactory.formalParameterList([]));
1393 } 1417 }
1394 void test_visitFormalParameterList_n() { 1418 void test_visitFormalParameterList_n() {
1395 assertSource("({a : 0})", ASTFactory.formalParameterList([ASTFactory.namedFo rmalParameter(ASTFactory.simpleFormalParameter3("a"), ASTFactory.integer(0))])); 1419 assertSource("({a : 0})", ASTFactory.formalParameterList([ASTFactory.namedFo rmalParameter(ASTFactory.simpleFormalParameter3("a"), ASTFactory.integer(0))]));
1396 } 1420 }
1397 void test_visitFormalParameterList_nn() { 1421 void test_visitFormalParameterList_nn() {
1398 assertSource("({a : 0, b : 1})", ASTFactory.formalParameterList([ASTFactory. namedFormalParameter(ASTFactory.simpleFormalParameter3("a"), ASTFactory.integer( 0)), ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter3("b"), AST Factory.integer(1))])); 1422 assertSource("({a : 0, b : 1})", ASTFactory.formalParameterList([ASTFactory. namedFormalParameter(ASTFactory.simpleFormalParameter3("a"), ASTFactory.integer( 0)), ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter3("b"), AST Factory.integer(1))]));
1399 } 1423 }
(...skipping 27 matching lines...) Expand all
1427 void test_visitFormalParameterList_rrnn() { 1451 void test_visitFormalParameterList_rrnn() {
1428 assertSource("(a, b, {c : 3, d : 4})", ASTFactory.formalParameterList([ASTFa ctory.simpleFormalParameter3("a"), ASTFactory.simpleFormalParameter3("b"), ASTFa ctory.namedFormalParameter(ASTFactory.simpleFormalParameter3("c"), ASTFactory.in teger(3)), ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter3("d" ), ASTFactory.integer(4))])); 1452 assertSource("(a, b, {c : 3, d : 4})", ASTFactory.formalParameterList([ASTFa ctory.simpleFormalParameter3("a"), ASTFactory.simpleFormalParameter3("b"), ASTFa ctory.namedFormalParameter(ASTFactory.simpleFormalParameter3("c"), ASTFactory.in teger(3)), ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter3("d" ), ASTFactory.integer(4))]));
1429 } 1453 }
1430 void test_visitFormalParameterList_rrp() { 1454 void test_visitFormalParameterList_rrp() {
1431 assertSource("(a, b, [c = 3])", ASTFactory.formalParameterList([ASTFactory.s impleFormalParameter3("a"), ASTFactory.simpleFormalParameter3("b"), ASTFactory.p ositionalFormalParameter(ASTFactory.simpleFormalParameter3("c"), ASTFactory.inte ger(3))])); 1455 assertSource("(a, b, [c = 3])", ASTFactory.formalParameterList([ASTFactory.s impleFormalParameter3("a"), ASTFactory.simpleFormalParameter3("b"), ASTFactory.p ositionalFormalParameter(ASTFactory.simpleFormalParameter3("c"), ASTFactory.inte ger(3))]));
1432 } 1456 }
1433 void test_visitFormalParameterList_rrpp() { 1457 void test_visitFormalParameterList_rrpp() {
1434 assertSource("(a, b, [c = 3, d = 4])", ASTFactory.formalParameterList([ASTFa ctory.simpleFormalParameter3("a"), ASTFactory.simpleFormalParameter3("b"), ASTFa ctory.positionalFormalParameter(ASTFactory.simpleFormalParameter3("c"), ASTFacto ry.integer(3)), ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalPara meter3("d"), ASTFactory.integer(4))])); 1458 assertSource("(a, b, [c = 3, d = 4])", ASTFactory.formalParameterList([ASTFa ctory.simpleFormalParameter3("a"), ASTFactory.simpleFormalParameter3("b"), ASTFa ctory.positionalFormalParameter(ASTFactory.simpleFormalParameter3("c"), ASTFacto ry.integer(3)), ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalPara meter3("d"), ASTFactory.integer(4))]));
1435 } 1459 }
1436 void test_visitForStatement_c() { 1460 void test_visitForStatement_c() {
1437 assertSource("for (; c;) {}", ASTFactory.forStatement((null as Expression), ASTFactory.identifier2("c"), null, ASTFactory.block([]))); 1461 assertSource("for (; c;) {}", ASTFactory.forStatement((null as Expression), ASTFactory.identifier3("c"), null, ASTFactory.block([])));
1438 } 1462 }
1439 void test_visitForStatement_cu() { 1463 void test_visitForStatement_cu() {
1440 assertSource("for (; c; u) {}", ASTFactory.forStatement((null as Expression) , ASTFactory.identifier2("c"), ASTFactory.list([(ASTFactory.identifier2("u") as Expression)]), ASTFactory.block([]))); 1464 assertSource("for (; c; u) {}", ASTFactory.forStatement((null as Expression) , ASTFactory.identifier3("c"), ASTFactory.list([(ASTFactory.identifier3("u") as Expression)]), ASTFactory.block([])));
1441 } 1465 }
1442 void test_visitForStatement_e() { 1466 void test_visitForStatement_e() {
1443 assertSource("for (e;;) {}", ASTFactory.forStatement(ASTFactory.identifier2( "e"), null, null, ASTFactory.block([]))); 1467 assertSource("for (e;;) {}", ASTFactory.forStatement(ASTFactory.identifier3( "e"), null, null, ASTFactory.block([])));
1444 } 1468 }
1445 void test_visitForStatement_ec() { 1469 void test_visitForStatement_ec() {
1446 assertSource("for (e; c;) {}", ASTFactory.forStatement(ASTFactory.identifier 2("e"), ASTFactory.identifier2("c"), null, ASTFactory.block([]))); 1470 assertSource("for (e; c;) {}", ASTFactory.forStatement(ASTFactory.identifier 3("e"), ASTFactory.identifier3("c"), null, ASTFactory.block([])));
1447 } 1471 }
1448 void test_visitForStatement_ecu() { 1472 void test_visitForStatement_ecu() {
1449 assertSource("for (e; c; u) {}", ASTFactory.forStatement(ASTFactory.identifi er2("e"), ASTFactory.identifier2("c"), ASTFactory.list([(ASTFactory.identifier2( "u") as Expression)]), ASTFactory.block([]))); 1473 assertSource("for (e; c; u) {}", ASTFactory.forStatement(ASTFactory.identifi er3("e"), ASTFactory.identifier3("c"), ASTFactory.list([(ASTFactory.identifier3( "u") as Expression)]), ASTFactory.block([])));
1450 } 1474 }
1451 void test_visitForStatement_eu() { 1475 void test_visitForStatement_eu() {
1452 assertSource("for (e;; u) {}", ASTFactory.forStatement(ASTFactory.identifier 2("e"), null, ASTFactory.list([(ASTFactory.identifier2("u") as Expression)]), AS TFactory.block([]))); 1476 assertSource("for (e;; u) {}", ASTFactory.forStatement(ASTFactory.identifier 3("e"), null, ASTFactory.list([(ASTFactory.identifier3("u") as Expression)]), AS TFactory.block([])));
1453 } 1477 }
1454 void test_visitForStatement_i() { 1478 void test_visitForStatement_i() {
1455 assertSource("for (var i;;) {}", ASTFactory.forStatement2(ASTFactory.variabl eDeclarationList2(Keyword.VAR, [ASTFactory.variableDeclaration("i")]), null, nul l, ASTFactory.block([]))); 1479 assertSource("for (var i;;) {}", ASTFactory.forStatement2(ASTFactory.variabl eDeclarationList2(Keyword.VAR, [ASTFactory.variableDeclaration("i")]), null, nul l, ASTFactory.block([])));
1456 } 1480 }
1457 void test_visitForStatement_ic() { 1481 void test_visitForStatement_ic() {
1458 assertSource("for (var i; c;) {}", ASTFactory.forStatement2(ASTFactory.varia bleDeclarationList2(Keyword.VAR, [ASTFactory.variableDeclaration("i")]), ASTFact ory.identifier2("c"), null, ASTFactory.block([]))); 1482 assertSource("for (var i; c;) {}", ASTFactory.forStatement2(ASTFactory.varia bleDeclarationList2(Keyword.VAR, [ASTFactory.variableDeclaration("i")]), ASTFact ory.identifier3("c"), null, ASTFactory.block([])));
1459 } 1483 }
1460 void test_visitForStatement_icu() { 1484 void test_visitForStatement_icu() {
1461 assertSource("for (var i; c; u) {}", ASTFactory.forStatement2(ASTFactory.var iableDeclarationList2(Keyword.VAR, [ASTFactory.variableDeclaration("i")]), ASTFa ctory.identifier2("c"), ASTFactory.list([(ASTFactory.identifier2("u") as Express ion)]), ASTFactory.block([]))); 1485 assertSource("for (var i; c; u) {}", ASTFactory.forStatement2(ASTFactory.var iableDeclarationList2(Keyword.VAR, [ASTFactory.variableDeclaration("i")]), ASTFa ctory.identifier3("c"), ASTFactory.list([(ASTFactory.identifier3("u") as Express ion)]), ASTFactory.block([])));
1462 } 1486 }
1463 void test_visitForStatement_iu() { 1487 void test_visitForStatement_iu() {
1464 assertSource("for (var i;; u) {}", ASTFactory.forStatement2(ASTFactory.varia bleDeclarationList2(Keyword.VAR, [ASTFactory.variableDeclaration("i")]), null, A STFactory.list([(ASTFactory.identifier2("u") as Expression)]), ASTFactory.block( []))); 1488 assertSource("for (var i;; u) {}", ASTFactory.forStatement2(ASTFactory.varia bleDeclarationList2(Keyword.VAR, [ASTFactory.variableDeclaration("i")]), null, A STFactory.list([(ASTFactory.identifier3("u") as Expression)]), ASTFactory.block( [])));
1465 } 1489 }
1466 void test_visitForStatement_u() { 1490 void test_visitForStatement_u() {
1467 assertSource("for (;; u) {}", ASTFactory.forStatement((null as Expression), null, ASTFactory.list([(ASTFactory.identifier2("u") as Expression)]), ASTFactory .block([]))); 1491 assertSource("for (;; u) {}", ASTFactory.forStatement((null as Expression), null, ASTFactory.list([(ASTFactory.identifier3("u") as Expression)]), ASTFactory .block([])));
1468 } 1492 }
1469 void test_visitFunctionDeclaration_getter() { 1493 void test_visitFunctionDeclaration_getter() {
1470 assertSource("get f() {}", ASTFactory.functionDeclaration(null, Keyword.GET, "f", ASTFactory.functionExpression())); 1494 assertSource("get f() {}", ASTFactory.functionDeclaration(null, Keyword.GET, "f", ASTFactory.functionExpression()));
1471 } 1495 }
1472 void test_visitFunctionDeclaration_normal() { 1496 void test_visitFunctionDeclaration_normal() {
1473 assertSource("f() {}", ASTFactory.functionDeclaration(null, null, "f", ASTFa ctory.functionExpression())); 1497 assertSource("f() {}", ASTFactory.functionDeclaration(null, null, "f", ASTFa ctory.functionExpression()));
1474 } 1498 }
1475 void test_visitFunctionDeclaration_setter() { 1499 void test_visitFunctionDeclaration_setter() {
1476 assertSource("set f() {}", ASTFactory.functionDeclaration(null, Keyword.SET, "f", ASTFactory.functionExpression())); 1500 assertSource("set f() {}", ASTFactory.functionDeclaration(null, Keyword.SET, "f", ASTFactory.functionExpression()));
1477 } 1501 }
1478 void test_visitFunctionDeclarationStatement() { 1502 void test_visitFunctionDeclarationStatement() {
1479 assertSource("f() {};", ASTFactory.functionDeclarationStatement(null, null, "f", ASTFactory.functionExpression())); 1503 assertSource("f() {};", ASTFactory.functionDeclarationStatement(null, null, "f", ASTFactory.functionExpression()));
1480 } 1504 }
1481 void test_visitFunctionExpression() { 1505 void test_visitFunctionExpression() {
1482 assertSource("() {}", ASTFactory.functionExpression()); 1506 assertSource("() {}", ASTFactory.functionExpression());
1483 } 1507 }
1484 void test_visitFunctionExpressionInvocation() { 1508 void test_visitFunctionExpressionInvocation() {
1485 assertSource("f()", ASTFactory.functionExpressionInvocation(ASTFactory.ident ifier2("f"), [])); 1509 assertSource("f()", ASTFactory.functionExpressionInvocation(ASTFactory.ident ifier3("f"), []));
1486 } 1510 }
1487 void test_visitFunctionTypedFormalParameter_noType() { 1511 void test_visitFunctionTypedFormalParameter_noType() {
1488 assertSource("f()", ASTFactory.functionTypedFormalParameter(null, "f", [])); 1512 assertSource("f()", ASTFactory.functionTypedFormalParameter(null, "f", []));
1489 } 1513 }
1490 void test_visitFunctionTypedFormalParameter_type() { 1514 void test_visitFunctionTypedFormalParameter_type() {
1491 assertSource("T f()", ASTFactory.functionTypedFormalParameter(ASTFactory.typ eName3("T", []), "f", [])); 1515 assertSource("T f()", ASTFactory.functionTypedFormalParameter(ASTFactory.typ eName4("T", []), "f", []));
1492 } 1516 }
1493 void test_visitIfStatement_withElse() { 1517 void test_visitIfStatement_withElse() {
1494 assertSource("if (c) {} else {}", ASTFactory.ifStatement2(ASTFactory.identif ier2("c"), ASTFactory.block([]), ASTFactory.block([]))); 1518 assertSource("if (c) {} else {}", ASTFactory.ifStatement2(ASTFactory.identif ier3("c"), ASTFactory.block([]), ASTFactory.block([])));
1495 } 1519 }
1496 void test_visitIfStatement_withoutElse() { 1520 void test_visitIfStatement_withoutElse() {
1497 assertSource("if (c) {}", ASTFactory.ifStatement(ASTFactory.identifier2("c") , ASTFactory.block([]))); 1521 assertSource("if (c) {}", ASTFactory.ifStatement(ASTFactory.identifier3("c") , ASTFactory.block([])));
1498 } 1522 }
1499 void test_visitImplementsClause_multiple() { 1523 void test_visitImplementsClause_multiple() {
1500 assertSource("implements A, B", ASTFactory.implementsClause([ASTFactory.type Name3("A", []), ASTFactory.typeName3("B", [])])); 1524 assertSource("implements A, B", ASTFactory.implementsClause([ASTFactory.type Name4("A", []), ASTFactory.typeName4("B", [])]));
1501 } 1525 }
1502 void test_visitImplementsClause_single() { 1526 void test_visitImplementsClause_single() {
1503 assertSource("implements A", ASTFactory.implementsClause([ASTFactory.typeNam e3("A", [])])); 1527 assertSource("implements A", ASTFactory.implementsClause([ASTFactory.typeNam e4("A", [])]));
1504 } 1528 }
1505 void test_visitImportDirective_combinator() { 1529 void test_visitImportDirective_combinator() {
1506 assertSource("import 'a.dart' show A;", ASTFactory.importDirective2("a.dart" , null, [ASTFactory.showCombinator([ASTFactory.identifier2("A")])])); 1530 assertSource("import 'a.dart' show A;", ASTFactory.importDirective2("a.dart" , null, [ASTFactory.showCombinator([ASTFactory.identifier3("A")])]));
1507 } 1531 }
1508 void test_visitImportDirective_combinators() { 1532 void test_visitImportDirective_combinators() {
1509 assertSource("import 'a.dart' show A hide B;", ASTFactory.importDirective2(" a.dart", null, [ASTFactory.showCombinator([ASTFactory.identifier2("A")]), ASTFac tory.hideCombinator([ASTFactory.identifier2("B")])])); 1533 assertSource("import 'a.dart' show A hide B;", ASTFactory.importDirective2(" a.dart", null, [ASTFactory.showCombinator([ASTFactory.identifier3("A")]), ASTFac tory.hideCombinator([ASTFactory.identifier3("B")])]));
1510 } 1534 }
1511 void test_visitImportDirective_minimal() { 1535 void test_visitImportDirective_minimal() {
1512 assertSource("import 'a.dart';", ASTFactory.importDirective2("a.dart", null, [])); 1536 assertSource("import 'a.dart';", ASTFactory.importDirective2("a.dart", null, []));
1513 } 1537 }
1514 void test_visitImportDirective_prefix() { 1538 void test_visitImportDirective_prefix() {
1515 assertSource("import 'a.dart' as p;", ASTFactory.importDirective2("a.dart", "p", [])); 1539 assertSource("import 'a.dart' as p;", ASTFactory.importDirective2("a.dart", "p", []));
1516 } 1540 }
1517 void test_visitImportDirective_prefix_combinator() { 1541 void test_visitImportDirective_prefix_combinator() {
1518 assertSource("import 'a.dart' as p show A;", ASTFactory.importDirective2("a. dart", "p", [ASTFactory.showCombinator([ASTFactory.identifier2("A")])])); 1542 assertSource("import 'a.dart' as p show A;", ASTFactory.importDirective2("a. dart", "p", [ASTFactory.showCombinator([ASTFactory.identifier3("A")])]));
1519 } 1543 }
1520 void test_visitImportDirective_prefix_combinators() { 1544 void test_visitImportDirective_prefix_combinators() {
1521 assertSource("import 'a.dart' as p show A hide B;", ASTFactory.importDirecti ve2("a.dart", "p", [ASTFactory.showCombinator([ASTFactory.identifier2("A")]), AS TFactory.hideCombinator([ASTFactory.identifier2("B")])])); 1545 assertSource("import 'a.dart' as p show A hide B;", ASTFactory.importDirecti ve2("a.dart", "p", [ASTFactory.showCombinator([ASTFactory.identifier3("A")]), AS TFactory.hideCombinator([ASTFactory.identifier3("B")])]));
1522 } 1546 }
1523 void test_visitImportHideCombinator_multiple() { 1547 void test_visitImportHideCombinator_multiple() {
1524 assertSource("hide a, b", ASTFactory.hideCombinator([ASTFactory.identifier2( "a"), ASTFactory.identifier2("b")])); 1548 assertSource("hide a, b", ASTFactory.hideCombinator([ASTFactory.identifier3( "a"), ASTFactory.identifier3("b")]));
1525 } 1549 }
1526 void test_visitImportHideCombinator_single() { 1550 void test_visitImportHideCombinator_single() {
1527 assertSource("hide a", ASTFactory.hideCombinator([ASTFactory.identifier2("a" )])); 1551 assertSource("hide a", ASTFactory.hideCombinator([ASTFactory.identifier3("a" )]));
1528 } 1552 }
1529 void test_visitImportShowCombinator_multiple() { 1553 void test_visitImportShowCombinator_multiple() {
1530 assertSource("show a, b", ASTFactory.showCombinator([ASTFactory.identifier2( "a"), ASTFactory.identifier2("b")])); 1554 assertSource("show a, b", ASTFactory.showCombinator([ASTFactory.identifier3( "a"), ASTFactory.identifier3("b")]));
1531 } 1555 }
1532 void test_visitImportShowCombinator_single() { 1556 void test_visitImportShowCombinator_single() {
1533 assertSource("show a", ASTFactory.showCombinator([ASTFactory.identifier2("a" )])); 1557 assertSource("show a", ASTFactory.showCombinator([ASTFactory.identifier3("a" )]));
1534 } 1558 }
1535 void test_visitIndexExpression() { 1559 void test_visitIndexExpression() {
1536 assertSource("a[i]", ASTFactory.indexExpression(ASTFactory.identifier2("a"), ASTFactory.identifier2("i"))); 1560 assertSource("a[i]", ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("i")));
1537 } 1561 }
1538 void test_visitInstanceCreationExpression_const() { 1562 void test_visitInstanceCreationExpression_const() {
1539 assertSource("const C()", ASTFactory.instanceCreationExpression2(Keyword.CON ST, ASTFactory.typeName3("C", []), [])); 1563 assertSource("const C()", ASTFactory.instanceCreationExpression2(Keyword.CON ST, ASTFactory.typeName4("C", []), []));
1540 } 1564 }
1541 void test_visitInstanceCreationExpression_named() { 1565 void test_visitInstanceCreationExpression_named() {
1542 assertSource("new C.c()", ASTFactory.instanceCreationExpression3(Keyword.NEW , ASTFactory.typeName3("C", []), "c", [])); 1566 assertSource("new C.c()", ASTFactory.instanceCreationExpression3(Keyword.NEW , ASTFactory.typeName4("C", []), "c", []));
1543 } 1567 }
1544 void test_visitInstanceCreationExpression_unnamed() { 1568 void test_visitInstanceCreationExpression_unnamed() {
1545 assertSource("new C()", ASTFactory.instanceCreationExpression2(Keyword.NEW, ASTFactory.typeName3("C", []), [])); 1569 assertSource("new C()", ASTFactory.instanceCreationExpression2(Keyword.NEW, ASTFactory.typeName4("C", []), []));
1546 } 1570 }
1547 void test_visitIntegerLiteral() { 1571 void test_visitIntegerLiteral() {
1548 assertSource("42", ASTFactory.integer(42)); 1572 assertSource("42", ASTFactory.integer(42));
1549 } 1573 }
1550 void test_visitInterpolationExpression_expression() { 1574 void test_visitInterpolationExpression_expression() {
1551 assertSource("\${a}", ASTFactory.interpolationExpression(ASTFactory.identifi er2("a"))); 1575 assertSource("\${a}", ASTFactory.interpolationExpression(ASTFactory.identifi er3("a")));
1552 } 1576 }
1553 void test_visitInterpolationExpression_identifier() { 1577 void test_visitInterpolationExpression_identifier() {
1554 assertSource("\$a", ASTFactory.interpolationExpression2("a")); 1578 assertSource("\$a", ASTFactory.interpolationExpression2("a"));
1555 } 1579 }
1556 void test_visitInterpolationString() { 1580 void test_visitInterpolationString() {
1557 assertSource("'x", ASTFactory.interpolationString("'x", "x")); 1581 assertSource("'x", ASTFactory.interpolationString("'x", "x"));
1558 } 1582 }
1559 void test_visitIsExpression_negated() { 1583 void test_visitIsExpression_negated() {
1560 assertSource("a is! C", ASTFactory.isExpression(ASTFactory.identifier2("a"), true, ASTFactory.typeName3("C", []))); 1584 assertSource("a is! C", ASTFactory.isExpression(ASTFactory.identifier3("a"), true, ASTFactory.typeName4("C", [])));
1561 } 1585 }
1562 void test_visitIsExpression_normal() { 1586 void test_visitIsExpression_normal() {
1563 assertSource("a is C", ASTFactory.isExpression(ASTFactory.identifier2("a"), false, ASTFactory.typeName3("C", []))); 1587 assertSource("a is C", ASTFactory.isExpression(ASTFactory.identifier3("a"), false, ASTFactory.typeName4("C", [])));
1564 } 1588 }
1565 void test_visitLabel() { 1589 void test_visitLabel() {
1566 assertSource("a:", ASTFactory.label("a")); 1590 assertSource("a:", ASTFactory.label2("a"));
1567 } 1591 }
1568 void test_visitLabeledStatement_multiple() { 1592 void test_visitLabeledStatement_multiple() {
1569 assertSource("a: b: return;", ASTFactory.labeledStatement(ASTFactory.list([A STFactory.label("a"), ASTFactory.label("b")]), ASTFactory.returnStatement())); 1593 assertSource("a: b: return;", ASTFactory.labeledStatement(ASTFactory.list([A STFactory.label2("a"), ASTFactory.label2("b")]), ASTFactory.returnStatement()));
1570 } 1594 }
1571 void test_visitLabeledStatement_single() { 1595 void test_visitLabeledStatement_single() {
1572 assertSource("a: return;", ASTFactory.labeledStatement(ASTFactory.list([ASTF actory.label("a")]), ASTFactory.returnStatement())); 1596 assertSource("a: return;", ASTFactory.labeledStatement(ASTFactory.list([ASTF actory.label2("a")]), ASTFactory.returnStatement()));
1573 } 1597 }
1574 void test_visitLibraryDirective() { 1598 void test_visitLibraryDirective() {
1575 assertSource("library l;", ASTFactory.libraryDirective2("l")); 1599 assertSource("library l;", ASTFactory.libraryDirective2("l"));
1576 } 1600 }
1577 void test_visitLibraryIdentifier_multiple() { 1601 void test_visitLibraryIdentifier_multiple() {
1578 assertSource("a.b.c", ASTFactory.libraryIdentifier([ASTFactory.identifier2(" a"), ASTFactory.identifier2("b"), ASTFactory.identifier2("c")])); 1602 assertSource("a.b.c", ASTFactory.libraryIdentifier([ASTFactory.identifier3(" a"), ASTFactory.identifier3("b"), ASTFactory.identifier3("c")]));
1579 } 1603 }
1580 void test_visitLibraryIdentifier_single() { 1604 void test_visitLibraryIdentifier_single() {
1581 assertSource("a", ASTFactory.libraryIdentifier([ASTFactory.identifier2("a")] )); 1605 assertSource("a", ASTFactory.libraryIdentifier([ASTFactory.identifier3("a")] ));
1582 } 1606 }
1583 void test_visitListLiteral_const() { 1607 void test_visitListLiteral_const() {
1584 assertSource("const []", ASTFactory.listLiteral2(Keyword.CONST, null, [])); 1608 assertSource("const []", ASTFactory.listLiteral2(Keyword.CONST, null, []));
1585 } 1609 }
1586 void test_visitListLiteral_empty() { 1610 void test_visitListLiteral_empty() {
1587 assertSource("[]", ASTFactory.listLiteral([])); 1611 assertSource("[]", ASTFactory.listLiteral([]));
1588 } 1612 }
1589 void test_visitListLiteral_nonEmpty() { 1613 void test_visitListLiteral_nonEmpty() {
1590 assertSource("[a, b, c]", ASTFactory.listLiteral([ASTFactory.identifier2("a" ), ASTFactory.identifier2("b"), ASTFactory.identifier2("c")])); 1614 assertSource("[a, b, c]", ASTFactory.listLiteral([ASTFactory.identifier3("a" ), ASTFactory.identifier3("b"), ASTFactory.identifier3("c")]));
1591 } 1615 }
1592 void test_visitMapLiteral_const() { 1616 void test_visitMapLiteral_const() {
1593 assertSource("const {}", ASTFactory.mapLiteral(Keyword.CONST, null, [])); 1617 assertSource("const {}", ASTFactory.mapLiteral(Keyword.CONST, null, []));
1594 } 1618 }
1595 void test_visitMapLiteral_empty() { 1619 void test_visitMapLiteral_empty() {
1596 assertSource("{}", ASTFactory.mapLiteral2([])); 1620 assertSource("{}", ASTFactory.mapLiteral2([]));
1597 } 1621 }
1598 void test_visitMapLiteral_nonEmpty() { 1622 void test_visitMapLiteral_nonEmpty() {
1599 assertSource("{'a' : a, 'b' : b, 'c' : c}", ASTFactory.mapLiteral2([ASTFacto ry.mapLiteralEntry("a", ASTFactory.identifier2("a")), ASTFactory.mapLiteralEntry ("b", ASTFactory.identifier2("b")), ASTFactory.mapLiteralEntry("c", ASTFactory.i dentifier2("c"))])); 1623 assertSource("{'a' : a, 'b' : b, 'c' : c}", ASTFactory.mapLiteral2([ASTFacto ry.mapLiteralEntry("a", ASTFactory.identifier3("a")), ASTFactory.mapLiteralEntry ("b", ASTFactory.identifier3("b")), ASTFactory.mapLiteralEntry("c", ASTFactory.i dentifier3("c"))]));
1600 } 1624 }
1601 void test_visitMapLiteralEntry() { 1625 void test_visitMapLiteralEntry() {
1602 assertSource("'a' : b", ASTFactory.mapLiteralEntry("a", ASTFactory.identifie r2("b"))); 1626 assertSource("'a' : b", ASTFactory.mapLiteralEntry("a", ASTFactory.identifie r3("b")));
1603 } 1627 }
1604 void test_visitMethodDeclaration_external() { 1628 void test_visitMethodDeclaration_external() {
1605 assertSource("external m();", ASTFactory.methodDeclaration(null, null, null, null, ASTFactory.identifier2("m"), ASTFactory.formalParameterList([]))); 1629 assertSource("external m();", ASTFactory.methodDeclaration(null, null, null, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([])));
1606 } 1630 }
1607 void test_visitMethodDeclaration_external_returnType() { 1631 void test_visitMethodDeclaration_external_returnType() {
1608 assertSource("external T m();", ASTFactory.methodDeclaration(null, ASTFactor y.typeName3("T", []), null, null, ASTFactory.identifier2("m"), ASTFactory.formal ParameterList([]))); 1632 assertSource("external T m();", ASTFactory.methodDeclaration(null, ASTFactor y.typeName4("T", []), null, null, ASTFactory.identifier3("m"), ASTFactory.formal ParameterList([])));
1609 } 1633 }
1610 void test_visitMethodDeclaration_getter() { 1634 void test_visitMethodDeclaration_getter() {
1611 assertSource("get m {}", ASTFactory.methodDeclaration2(null, null, Keyword.G ET, null, ASTFactory.identifier2("m"), null, ASTFactory.blockFunctionBody([]))); 1635 assertSource("get m {}", ASTFactory.methodDeclaration2(null, null, Keyword.G ET, null, ASTFactory.identifier3("m"), null, ASTFactory.blockFunctionBody([])));
1612 } 1636 }
1613 void test_visitMethodDeclaration_getter_returnType() { 1637 void test_visitMethodDeclaration_getter_returnType() {
1614 assertSource("T get m {}", ASTFactory.methodDeclaration2(null, ASTFactory.ty peName3("T", []), Keyword.GET, null, ASTFactory.identifier2("m"), null, ASTFacto ry.blockFunctionBody([]))); 1638 assertSource("T get m {}", ASTFactory.methodDeclaration2(null, ASTFactory.ty peName4("T", []), Keyword.GET, null, ASTFactory.identifier3("m"), null, ASTFacto ry.blockFunctionBody([])));
1615 } 1639 }
1616 void test_visitMethodDeclaration_getter_seturnType() { 1640 void test_visitMethodDeclaration_getter_seturnType() {
1617 assertSource("T set m(var v) {}", ASTFactory.methodDeclaration2(null, ASTFac tory.typeName3("T", []), Keyword.SET, null, ASTFactory.identifier2("m"), ASTFact ory.formalParameterList([ASTFactory.simpleFormalParameter(Keyword.VAR, "v")]), A STFactory.blockFunctionBody([]))); 1641 assertSource("T set m(var v) {}", ASTFactory.methodDeclaration2(null, ASTFac tory.typeName4("T", []), Keyword.SET, null, ASTFactory.identifier3("m"), ASTFact ory.formalParameterList([ASTFactory.simpleFormalParameter(Keyword.VAR, "v")]), A STFactory.blockFunctionBody([])));
1618 } 1642 }
1619 void test_visitMethodDeclaration_minimal() { 1643 void test_visitMethodDeclaration_minimal() {
1620 assertSource("m() {}", ASTFactory.methodDeclaration2(null, null, null, null, ASTFactory.identifier2("m"), ASTFactory.formalParameterList([]), ASTFactory.blo ckFunctionBody([]))); 1644 assertSource("m() {}", ASTFactory.methodDeclaration2(null, null, null, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([]), ASTFactory.blo ckFunctionBody([])));
1621 } 1645 }
1622 void test_visitMethodDeclaration_multipleParameters() { 1646 void test_visitMethodDeclaration_multipleParameters() {
1623 assertSource("m(var a, var b) {}", ASTFactory.methodDeclaration2(null, null, null, null, ASTFactory.identifier2("m"), ASTFactory.formalParameterList([ASTFac tory.simpleFormalParameter(Keyword.VAR, "a"), ASTFactory.simpleFormalParameter(K eyword.VAR, "b")]), ASTFactory.blockFunctionBody([]))); 1647 assertSource("m(var a, var b) {}", ASTFactory.methodDeclaration2(null, null, null, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([ASTFac tory.simpleFormalParameter(Keyword.VAR, "a"), ASTFactory.simpleFormalParameter(K eyword.VAR, "b")]), ASTFactory.blockFunctionBody([])));
1624 } 1648 }
1625 void test_visitMethodDeclaration_operator() { 1649 void test_visitMethodDeclaration_operator() {
1626 assertSource("operator +() {}", ASTFactory.methodDeclaration2(null, null, nu ll, Keyword.OPERATOR, ASTFactory.identifier2("+"), ASTFactory.formalParameterLis t([]), ASTFactory.blockFunctionBody([]))); 1650 assertSource("operator +() {}", ASTFactory.methodDeclaration2(null, null, nu ll, Keyword.OPERATOR, ASTFactory.identifier3("+"), ASTFactory.formalParameterLis t([]), ASTFactory.blockFunctionBody([])));
1627 } 1651 }
1628 void test_visitMethodDeclaration_operator_returnType() { 1652 void test_visitMethodDeclaration_operator_returnType() {
1629 assertSource("T operator +() {}", ASTFactory.methodDeclaration2(null, ASTFac tory.typeName3("T", []), null, Keyword.OPERATOR, ASTFactory.identifier2("+"), AS TFactory.formalParameterList([]), ASTFactory.blockFunctionBody([]))); 1653 assertSource("T operator +() {}", ASTFactory.methodDeclaration2(null, ASTFac tory.typeName4("T", []), null, Keyword.OPERATOR, ASTFactory.identifier3("+"), AS TFactory.formalParameterList([]), ASTFactory.blockFunctionBody([])));
1630 } 1654 }
1631 void test_visitMethodDeclaration_returnType() { 1655 void test_visitMethodDeclaration_returnType() {
1632 assertSource("T m() {}", ASTFactory.methodDeclaration2(null, ASTFactory.type Name3("T", []), null, null, ASTFactory.identifier2("m"), ASTFactory.formalParame terList([]), ASTFactory.blockFunctionBody([]))); 1656 assertSource("T m() {}", ASTFactory.methodDeclaration2(null, ASTFactory.type Name4("T", []), null, null, ASTFactory.identifier3("m"), ASTFactory.formalParame terList([]), ASTFactory.blockFunctionBody([])));
1633 } 1657 }
1634 void test_visitMethodDeclaration_setter() { 1658 void test_visitMethodDeclaration_setter() {
1635 assertSource("set m(var v) {}", ASTFactory.methodDeclaration2(null, null, Ke yword.SET, null, ASTFactory.identifier2("m"), ASTFactory.formalParameterList([AS TFactory.simpleFormalParameter(Keyword.VAR, "v")]), ASTFactory.blockFunctionBody ([]))); 1659 assertSource("set m(var v) {}", ASTFactory.methodDeclaration2(null, null, Ke yword.SET, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([AS TFactory.simpleFormalParameter(Keyword.VAR, "v")]), ASTFactory.blockFunctionBody ([])));
1636 } 1660 }
1637 void test_visitMethodDeclaration_static() { 1661 void test_visitMethodDeclaration_static() {
1638 assertSource("static m() {}", ASTFactory.methodDeclaration2(Keyword.STATIC, null, null, null, ASTFactory.identifier2("m"), ASTFactory.formalParameterList([] ), ASTFactory.blockFunctionBody([]))); 1662 assertSource("static m() {}", ASTFactory.methodDeclaration2(Keyword.STATIC, null, null, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([] ), ASTFactory.blockFunctionBody([])));
1639 } 1663 }
1640 void test_visitMethodDeclaration_static_returnType() { 1664 void test_visitMethodDeclaration_static_returnType() {
1641 assertSource("static T m() {}", ASTFactory.methodDeclaration2(Keyword.STATIC , ASTFactory.typeName3("T", []), null, null, ASTFactory.identifier2("m"), ASTFac tory.formalParameterList([]), ASTFactory.blockFunctionBody([]))); 1665 assertSource("static T m() {}", ASTFactory.methodDeclaration2(Keyword.STATIC , ASTFactory.typeName4("T", []), null, null, ASTFactory.identifier3("m"), ASTFac tory.formalParameterList([]), ASTFactory.blockFunctionBody([])));
1642 } 1666 }
1643 void test_visitMethodInvocation_noTarget() { 1667 void test_visitMethodInvocation_noTarget() {
1644 assertSource("m()", ASTFactory.methodInvocation2("m", [])); 1668 assertSource("m()", ASTFactory.methodInvocation2("m", []));
1645 } 1669 }
1646 void test_visitMethodInvocation_target() { 1670 void test_visitMethodInvocation_target() {
1647 assertSource("t.m()", ASTFactory.methodInvocation(ASTFactory.identifier2("t" ), "m", [])); 1671 assertSource("t.m()", ASTFactory.methodInvocation(ASTFactory.identifier3("t" ), "m", []));
1648 } 1672 }
1649 void test_visitNamedExpression() { 1673 void test_visitNamedExpression() {
1650 assertSource("a: b", ASTFactory.namedExpression("a", ASTFactory.identifier2( "b"))); 1674 assertSource("a: b", ASTFactory.namedExpression2("a", ASTFactory.identifier3 ("b")));
1651 } 1675 }
1652 void test_visitNamedFormalParameter() { 1676 void test_visitNamedFormalParameter() {
1653 assertSource("var a : 0", ASTFactory.namedFormalParameter(ASTFactory.simpleF ormalParameter(Keyword.VAR, "a"), ASTFactory.integer(0))); 1677 assertSource("var a : 0", ASTFactory.namedFormalParameter(ASTFactory.simpleF ormalParameter(Keyword.VAR, "a"), ASTFactory.integer(0)));
1654 } 1678 }
1679 void test_visitNativeFunctionBody() {
1680 assertSource("native 'str';", ASTFactory.nativeFunctionBody("str"));
1681 }
1655 void test_visitNullLiteral() { 1682 void test_visitNullLiteral() {
1656 assertSource("null", ASTFactory.nullLiteral()); 1683 assertSource("null", ASTFactory.nullLiteral());
1657 } 1684 }
1658 void test_visitParenthesizedExpression() { 1685 void test_visitParenthesizedExpression() {
1659 assertSource("(a)", ASTFactory.parenthesizedExpression(ASTFactory.identifier 2("a"))); 1686 assertSource("(a)", ASTFactory.parenthesizedExpression(ASTFactory.identifier 3("a")));
1660 } 1687 }
1661 void test_visitPartDirective() { 1688 void test_visitPartDirective() {
1662 assertSource("part 'a.dart';", ASTFactory.partDirective2("a.dart")); 1689 assertSource("part 'a.dart';", ASTFactory.partDirective2("a.dart"));
1663 } 1690 }
1664 void test_visitPartOfDirective() { 1691 void test_visitPartOfDirective() {
1665 assertSource("part of l;", ASTFactory.partOfDirective(ASTFactory.libraryIden tifier2(["l"]))); 1692 assertSource("part of l;", ASTFactory.partOfDirective(ASTFactory.libraryIden tifier2(["l"])));
1666 } 1693 }
1667 void test_visitPositionalFormalParameter() { 1694 void test_visitPositionalFormalParameter() {
1668 assertSource("var a = 0", ASTFactory.positionalFormalParameter(ASTFactory.si mpleFormalParameter(Keyword.VAR, "a"), ASTFactory.integer(0))); 1695 assertSource("var a = 0", ASTFactory.positionalFormalParameter(ASTFactory.si mpleFormalParameter(Keyword.VAR, "a"), ASTFactory.integer(0)));
1669 } 1696 }
1670 void test_visitPostfixExpression() { 1697 void test_visitPostfixExpression() {
1671 assertSource("a++", ASTFactory.postfixExpression(ASTFactory.identifier2("a") , TokenType.PLUS_PLUS)); 1698 assertSource("a++", ASTFactory.postfixExpression(ASTFactory.identifier3("a") , TokenType.PLUS_PLUS));
1672 } 1699 }
1673 void test_visitPrefixedIdentifier() { 1700 void test_visitPrefixedIdentifier() {
1674 assertSource("a.b", ASTFactory.identifier4("a", "b")); 1701 assertSource("a.b", ASTFactory.identifier5("a", "b"));
1675 } 1702 }
1676 void test_visitPrefixExpression() { 1703 void test_visitPrefixExpression() {
1677 assertSource("-a", ASTFactory.prefixExpression(TokenType.MINUS, ASTFactory.i dentifier2("a"))); 1704 assertSource("-a", ASTFactory.prefixExpression(TokenType.MINUS, ASTFactory.i dentifier3("a")));
1678 } 1705 }
1679 void test_visitPropertyAccess() { 1706 void test_visitPropertyAccess() {
1680 assertSource("a.b", ASTFactory.propertyAccess2(ASTFactory.identifier2("a"), "b")); 1707 assertSource("a.b", ASTFactory.propertyAccess2(ASTFactory.identifier3("a"), "b"));
1681 } 1708 }
1682 void test_visitRedirectingConstructorInvocation_named() { 1709 void test_visitRedirectingConstructorInvocation_named() {
1683 assertSource("this.c()", ASTFactory.redirectingConstructorInvocation2("c", [ ])); 1710 assertSource("this.c()", ASTFactory.redirectingConstructorInvocation2("c", [ ]));
1684 } 1711 }
1685 void test_visitRedirectingConstructorInvocation_unnamed() { 1712 void test_visitRedirectingConstructorInvocation_unnamed() {
1686 assertSource("this()", ASTFactory.redirectingConstructorInvocation([])); 1713 assertSource("this()", ASTFactory.redirectingConstructorInvocation([]));
1687 } 1714 }
1688 void test_visitReturnStatement_expression() { 1715 void test_visitReturnStatement_expression() {
1689 assertSource("return a;", ASTFactory.returnStatement2(ASTFactory.identifier2 ("a"))); 1716 assertSource("return a;", ASTFactory.returnStatement2(ASTFactory.identifier3 ("a")));
1690 } 1717 }
1691 void test_visitReturnStatement_noExpression() { 1718 void test_visitReturnStatement_noExpression() {
1692 assertSource("return;", ASTFactory.returnStatement()); 1719 assertSource("return;", ASTFactory.returnStatement());
1693 } 1720 }
1694 void test_visitScriptTag() { 1721 void test_visitScriptTag() {
1695 String scriptTag = "!#/bin/dart.exe"; 1722 String scriptTag = "!#/bin/dart.exe";
1696 assertSource(scriptTag, ASTFactory.scriptTag(scriptTag)); 1723 assertSource(scriptTag, ASTFactory.scriptTag(scriptTag));
1697 } 1724 }
1698 void test_visitSimpleFormalParameter_keyword() { 1725 void test_visitSimpleFormalParameter_keyword() {
1699 assertSource("var a", ASTFactory.simpleFormalParameter(Keyword.VAR, "a")); 1726 assertSource("var a", ASTFactory.simpleFormalParameter(Keyword.VAR, "a"));
1700 } 1727 }
1701 void test_visitSimpleFormalParameter_keyword_type() { 1728 void test_visitSimpleFormalParameter_keyword_type() {
1702 assertSource("final A a", ASTFactory.simpleFormalParameter2(Keyword.FINAL, A STFactory.typeName3("A", []), "a")); 1729 assertSource("final A a", ASTFactory.simpleFormalParameter2(Keyword.FINAL, A STFactory.typeName4("A", []), "a"));
1703 } 1730 }
1704 void test_visitSimpleFormalParameter_type() { 1731 void test_visitSimpleFormalParameter_type() {
1705 assertSource("A a", ASTFactory.simpleFormalParameter4(ASTFactory.typeName3(" A", []), "a")); 1732 assertSource("A a", ASTFactory.simpleFormalParameter4(ASTFactory.typeName4(" A", []), "a"));
1706 } 1733 }
1707 void test_visitSimpleIdentifier() { 1734 void test_visitSimpleIdentifier() {
1708 assertSource("a", ASTFactory.identifier2("a")); 1735 assertSource("a", ASTFactory.identifier3("a"));
1709 } 1736 }
1710 void test_visitSimpleStringLiteral() { 1737 void test_visitSimpleStringLiteral() {
1711 assertSource("'a'", ASTFactory.string2("a")); 1738 assertSource("'a'", ASTFactory.string2("a"));
1712 } 1739 }
1713 void test_visitStringInterpolation() { 1740 void test_visitStringInterpolation() {
1714 assertSource("'a\${e}b'", ASTFactory.string([ASTFactory.interpolationString( "'a", "a"), ASTFactory.interpolationExpression(ASTFactory.identifier2("e")), AST Factory.interpolationString("b'", "b")])); 1741 assertSource("'a\${e}b'", ASTFactory.string([ASTFactory.interpolationString( "'a", "a"), ASTFactory.interpolationExpression(ASTFactory.identifier3("e")), AST Factory.interpolationString("b'", "b")]));
1715 } 1742 }
1716 void test_visitSuperConstructorInvocation() { 1743 void test_visitSuperConstructorInvocation() {
1717 assertSource("super()", ASTFactory.superConstructorInvocation([])); 1744 assertSource("super()", ASTFactory.superConstructorInvocation([]));
1718 } 1745 }
1719 void test_visitSuperConstructorInvocation_named() { 1746 void test_visitSuperConstructorInvocation_named() {
1720 assertSource("super.c()", ASTFactory.superConstructorInvocation2("c", [])); 1747 assertSource("super.c()", ASTFactory.superConstructorInvocation2("c", []));
1721 } 1748 }
1722 void test_visitSuperExpression() { 1749 void test_visitSuperExpression() {
1723 assertSource("super", ASTFactory.superExpression()); 1750 assertSource("super", ASTFactory.superExpression());
1724 } 1751 }
1725 void test_visitSwitchCase_multipleLabels() { 1752 void test_visitSwitchCase_multipleLabels() {
1726 assertSource("l1: l2: case a: {}", ASTFactory.switchCase2(ASTFactory.list([A STFactory.label("l1"), ASTFactory.label("l2")]), ASTFactory.identifier2("a"), [A STFactory.block([])])); 1753 assertSource("l1: l2: case a: {}", ASTFactory.switchCase2(ASTFactory.list([A STFactory.label2("l1"), ASTFactory.label2("l2")]), ASTFactory.identifier3("a"), [ASTFactory.block([])]));
1727 } 1754 }
1728 void test_visitSwitchCase_multipleStatements() { 1755 void test_visitSwitchCase_multipleStatements() {
1729 assertSource("case a: {} {}", ASTFactory.switchCase(ASTFactory.identifier2(" a"), [ASTFactory.block([]), ASTFactory.block([])])); 1756 assertSource("case a: {} {}", ASTFactory.switchCase(ASTFactory.identifier3(" a"), [ASTFactory.block([]), ASTFactory.block([])]));
1730 } 1757 }
1731 void test_visitSwitchCase_noLabels() { 1758 void test_visitSwitchCase_noLabels() {
1732 assertSource("case a: {}", ASTFactory.switchCase(ASTFactory.identifier2("a") , [ASTFactory.block([])])); 1759 assertSource("case a: {}", ASTFactory.switchCase(ASTFactory.identifier3("a") , [ASTFactory.block([])]));
1733 } 1760 }
1734 void test_visitSwitchCase_singleLabel() { 1761 void test_visitSwitchCase_singleLabel() {
1735 assertSource("l1: case a: {}", ASTFactory.switchCase2(ASTFactory.list([ASTFa ctory.label("l1")]), ASTFactory.identifier2("a"), [ASTFactory.block([])])); 1762 assertSource("l1: case a: {}", ASTFactory.switchCase2(ASTFactory.list([ASTFa ctory.label2("l1")]), ASTFactory.identifier3("a"), [ASTFactory.block([])]));
1736 } 1763 }
1737 void test_visitSwitchDefault_multipleLabels() { 1764 void test_visitSwitchDefault_multipleLabels() {
1738 assertSource("l1: l2: default: {}", ASTFactory.switchDefault(ASTFactory.list ([ASTFactory.label("l1"), ASTFactory.label("l2")]), [ASTFactory.block([])])); 1765 assertSource("l1: l2: default: {}", ASTFactory.switchDefault(ASTFactory.list ([ASTFactory.label2("l1"), ASTFactory.label2("l2")]), [ASTFactory.block([])]));
1739 } 1766 }
1740 void test_visitSwitchDefault_multipleStatements() { 1767 void test_visitSwitchDefault_multipleStatements() {
1741 assertSource("default: {} {}", ASTFactory.switchDefault2([ASTFactory.block([ ]), ASTFactory.block([])])); 1768 assertSource("default: {} {}", ASTFactory.switchDefault2([ASTFactory.block([ ]), ASTFactory.block([])]));
1742 } 1769 }
1743 void test_visitSwitchDefault_noLabels() { 1770 void test_visitSwitchDefault_noLabels() {
1744 assertSource("default: {}", ASTFactory.switchDefault2([ASTFactory.block([])] )); 1771 assertSource("default: {}", ASTFactory.switchDefault2([ASTFactory.block([])] ));
1745 } 1772 }
1746 void test_visitSwitchDefault_singleLabel() { 1773 void test_visitSwitchDefault_singleLabel() {
1747 assertSource("l1: default: {}", ASTFactory.switchDefault(ASTFactory.list([AS TFactory.label("l1")]), [ASTFactory.block([])])); 1774 assertSource("l1: default: {}", ASTFactory.switchDefault(ASTFactory.list([AS TFactory.label2("l1")]), [ASTFactory.block([])]));
1748 } 1775 }
1749 void test_visitSwitchStatement() { 1776 void test_visitSwitchStatement() {
1750 assertSource("switch (a) {case 'b': {} default: {}}", ASTFactory.switchState ment(ASTFactory.identifier2("a"), [ASTFactory.switchCase(ASTFactory.string2("b") , [ASTFactory.block([])]), ASTFactory.switchDefault2([ASTFactory.block([])])])); 1777 assertSource("switch (a) {case 'b': {} default: {}}", ASTFactory.switchState ment(ASTFactory.identifier3("a"), [ASTFactory.switchCase(ASTFactory.string2("b") , [ASTFactory.block([])]), ASTFactory.switchDefault2([ASTFactory.block([])])]));
1751 } 1778 }
1752 void test_visitThisExpression() { 1779 void test_visitThisExpression() {
1753 assertSource("this", ASTFactory.thisExpression()); 1780 assertSource("this", ASTFactory.thisExpression());
1754 } 1781 }
1755 void test_visitThrowStatement() { 1782 void test_visitThrowStatement() {
1756 assertSource("throw e", ASTFactory.throwExpression2(ASTFactory.identifier2(" e"))); 1783 assertSource("throw e", ASTFactory.throwExpression2(ASTFactory.identifier3(" e")));
1757 } 1784 }
1758 void test_visitTopLevelVariableDeclaration_multiple() { 1785 void test_visitTopLevelVariableDeclaration_multiple() {
1759 assertSource("var a;", ASTFactory.topLevelVariableDeclaration2(Keyword.VAR, [ASTFactory.variableDeclaration("a")])); 1786 assertSource("var a;", ASTFactory.topLevelVariableDeclaration2(Keyword.VAR, [ASTFactory.variableDeclaration("a")]));
1760 } 1787 }
1761 void test_visitTopLevelVariableDeclaration_single() { 1788 void test_visitTopLevelVariableDeclaration_single() {
1762 assertSource("var a, b;", ASTFactory.topLevelVariableDeclaration2(Keyword.VA R, [ASTFactory.variableDeclaration("a"), ASTFactory.variableDeclaration("b")])); 1789 assertSource("var a, b;", ASTFactory.topLevelVariableDeclaration2(Keyword.VA R, [ASTFactory.variableDeclaration("a"), ASTFactory.variableDeclaration("b")]));
1763 } 1790 }
1764 void test_visitTryStatement_catch() { 1791 void test_visitTryStatement_catch() {
1765 assertSource("try {} on E {}", ASTFactory.tryStatement2(ASTFactory.block([]) , [ASTFactory.catchClause3(ASTFactory.typeName3("E", []), [])])); 1792 assertSource("try {} on E {}", ASTFactory.tryStatement2(ASTFactory.block([]) , [ASTFactory.catchClause3(ASTFactory.typeName4("E", []), [])]));
1766 } 1793 }
1767 void test_visitTryStatement_catches() { 1794 void test_visitTryStatement_catches() {
1768 assertSource("try {} on E {} on F {}", ASTFactory.tryStatement2(ASTFactory.b lock([]), [ASTFactory.catchClause3(ASTFactory.typeName3("E", []), []), ASTFactor y.catchClause3(ASTFactory.typeName3("F", []), [])])); 1795 assertSource("try {} on E {} on F {}", ASTFactory.tryStatement2(ASTFactory.b lock([]), [ASTFactory.catchClause3(ASTFactory.typeName4("E", []), []), ASTFactor y.catchClause3(ASTFactory.typeName4("F", []), [])]));
1769 } 1796 }
1770 void test_visitTryStatement_catchFinally() { 1797 void test_visitTryStatement_catchFinally() {
1771 assertSource("try {} on E {} finally {}", ASTFactory.tryStatement3(ASTFactor y.block([]), ASTFactory.list([ASTFactory.catchClause3(ASTFactory.typeName3("E", []), [])]), ASTFactory.block([]))); 1798 assertSource("try {} on E {} finally {}", ASTFactory.tryStatement3(ASTFactor y.block([]), ASTFactory.list([ASTFactory.catchClause3(ASTFactory.typeName4("E", []), [])]), ASTFactory.block([])));
1772 } 1799 }
1773 void test_visitTryStatement_finally() { 1800 void test_visitTryStatement_finally() {
1774 assertSource("try {} finally {}", ASTFactory.tryStatement(ASTFactory.block([ ]), ASTFactory.block([]))); 1801 assertSource("try {} finally {}", ASTFactory.tryStatement(ASTFactory.block([ ]), ASTFactory.block([])));
1775 } 1802 }
1776 void test_visitTypeAlias_generic() { 1803 void test_visitTypeAlias_generic() {
1777 assertSource("typedef A F<B>();", ASTFactory.typeAlias(ASTFactory.typeName3( "A", []), "F", ASTFactory.typeParameterList(["B"]), ASTFactory.formalParameterLi st([]))); 1804 assertSource("typedef A F<B>();", ASTFactory.typeAlias(ASTFactory.typeName4( "A", []), "F", ASTFactory.typeParameterList(["B"]), ASTFactory.formalParameterLi st([])));
1778 } 1805 }
1779 void test_visitTypeAlias_nonGeneric() { 1806 void test_visitTypeAlias_nonGeneric() {
1780 assertSource("typedef A F();", ASTFactory.typeAlias(ASTFactory.typeName3("A" , []), "F", null, ASTFactory.formalParameterList([]))); 1807 assertSource("typedef A F();", ASTFactory.typeAlias(ASTFactory.typeName4("A" , []), "F", null, ASTFactory.formalParameterList([])));
1781 } 1808 }
1782 void test_visitTypeArgumentList_multiple() { 1809 void test_visitTypeArgumentList_multiple() {
1783 assertSource("<E, F>", ASTFactory.typeArgumentList([ASTFactory.typeName3("E" , []), ASTFactory.typeName3("F", [])])); 1810 assertSource("<E, F>", ASTFactory.typeArgumentList([ASTFactory.typeName4("E" , []), ASTFactory.typeName4("F", [])]));
1784 } 1811 }
1785 void test_visitTypeArgumentList_single() { 1812 void test_visitTypeArgumentList_single() {
1786 assertSource("<E>", ASTFactory.typeArgumentList([ASTFactory.typeName3("E", [ ])])); 1813 assertSource("<E>", ASTFactory.typeArgumentList([ASTFactory.typeName4("E", [ ])]));
1787 } 1814 }
1788 void test_visitTypeName_multipleArgs() { 1815 void test_visitTypeName_multipleArgs() {
1789 assertSource("C<D, E>", ASTFactory.typeName3("C", [ASTFactory.typeName3("D", []), ASTFactory.typeName3("E", [])])); 1816 assertSource("C<D, E>", ASTFactory.typeName4("C", [ASTFactory.typeName4("D", []), ASTFactory.typeName4("E", [])]));
1790 } 1817 }
1791 void test_visitTypeName_nestedArg() { 1818 void test_visitTypeName_nestedArg() {
1792 assertSource("C<D<E>>", ASTFactory.typeName3("C", [ASTFactory.typeName3("D", [ASTFactory.typeName3("E", [])])])); 1819 assertSource("C<D<E>>", ASTFactory.typeName4("C", [ASTFactory.typeName4("D", [ASTFactory.typeName4("E", [])])]));
1793 } 1820 }
1794 void test_visitTypeName_noArgs() { 1821 void test_visitTypeName_noArgs() {
1795 assertSource("C", ASTFactory.typeName3("C", [])); 1822 assertSource("C", ASTFactory.typeName4("C", []));
1796 } 1823 }
1797 void test_visitTypeName_singleArg() { 1824 void test_visitTypeName_singleArg() {
1798 assertSource("C<D>", ASTFactory.typeName3("C", [ASTFactory.typeName3("D", [] )])); 1825 assertSource("C<D>", ASTFactory.typeName4("C", [ASTFactory.typeName4("D", [] )]));
1799 } 1826 }
1800 void test_visitTypeParameter_withExtends() { 1827 void test_visitTypeParameter_withExtends() {
1801 assertSource("E extends C", ASTFactory.typeParameter2("E", ASTFactory.typeNa me3("C", []))); 1828 assertSource("E extends C", ASTFactory.typeParameter2("E", ASTFactory.typeNa me4("C", [])));
1802 } 1829 }
1803 void test_visitTypeParameter_withoutExtends() { 1830 void test_visitTypeParameter_withoutExtends() {
1804 assertSource("E", ASTFactory.typeParameter("E")); 1831 assertSource("E", ASTFactory.typeParameter("E"));
1805 } 1832 }
1806 void test_visitTypeParameterList_multiple() { 1833 void test_visitTypeParameterList_multiple() {
1807 assertSource("<E, F>", ASTFactory.typeParameterList(["E", "F"])); 1834 assertSource("<E, F>", ASTFactory.typeParameterList(["E", "F"]));
1808 } 1835 }
1809 void test_visitTypeParameterList_single() { 1836 void test_visitTypeParameterList_single() {
1810 assertSource("<E>", ASTFactory.typeParameterList(["E"])); 1837 assertSource("<E>", ASTFactory.typeParameterList(["E"]));
1811 } 1838 }
1812 void test_visitVariableDeclaration_initialized() { 1839 void test_visitVariableDeclaration_initialized() {
1813 assertSource("a = b", ASTFactory.variableDeclaration2("a", ASTFactory.identi fier2("b"))); 1840 assertSource("a = b", ASTFactory.variableDeclaration2("a", ASTFactory.identi fier3("b")));
1814 } 1841 }
1815 void test_visitVariableDeclaration_uninitialized() { 1842 void test_visitVariableDeclaration_uninitialized() {
1816 assertSource("a", ASTFactory.variableDeclaration("a")); 1843 assertSource("a", ASTFactory.variableDeclaration("a"));
1817 } 1844 }
1818 void test_visitVariableDeclarationList_const_type() { 1845 void test_visitVariableDeclarationList_const_type() {
1819 assertSource("const C a, b", ASTFactory.variableDeclarationList(Keyword.CONS T, ASTFactory.typeName3("C", []), [ASTFactory.variableDeclaration("a"), ASTFacto ry.variableDeclaration("b")])); 1846 assertSource("const C a, b", ASTFactory.variableDeclarationList(Keyword.CONS T, ASTFactory.typeName4("C", []), [ASTFactory.variableDeclaration("a"), ASTFacto ry.variableDeclaration("b")]));
1820 } 1847 }
1821 void test_visitVariableDeclarationList_final_noType() { 1848 void test_visitVariableDeclarationList_final_noType() {
1822 assertSource("final a, b", ASTFactory.variableDeclarationList2(Keyword.FINAL , [ASTFactory.variableDeclaration("a"), ASTFactory.variableDeclaration("b")])); 1849 assertSource("final a, b", ASTFactory.variableDeclarationList2(Keyword.FINAL , [ASTFactory.variableDeclaration("a"), ASTFactory.variableDeclaration("b")]));
1823 } 1850 }
1824 void test_visitVariableDeclarationList_type() { 1851 void test_visitVariableDeclarationList_type() {
1825 assertSource("C a, b", ASTFactory.variableDeclarationList(null, ASTFactory.t ypeName3("C", []), [ASTFactory.variableDeclaration("a"), ASTFactory.variableDecl aration("b")])); 1852 assertSource("C a, b", ASTFactory.variableDeclarationList(null, ASTFactory.t ypeName4("C", []), [ASTFactory.variableDeclaration("a"), ASTFactory.variableDecl aration("b")]));
1826 } 1853 }
1827 void test_visitVariableDeclarationList_var() { 1854 void test_visitVariableDeclarationList_var() {
1828 assertSource("var a, b", ASTFactory.variableDeclarationList2(Keyword.VAR, [A STFactory.variableDeclaration("a"), ASTFactory.variableDeclaration("b")])); 1855 assertSource("var a, b", ASTFactory.variableDeclarationList2(Keyword.VAR, [A STFactory.variableDeclaration("a"), ASTFactory.variableDeclaration("b")]));
1829 } 1856 }
1830 void test_visitVariableDeclarationStatement() { 1857 void test_visitVariableDeclarationStatement() {
1831 assertSource("C c;", ASTFactory.variableDeclarationStatement(null, ASTFactor y.typeName3("C", []), [ASTFactory.variableDeclaration("c")])); 1858 assertSource("C c;", ASTFactory.variableDeclarationStatement(null, ASTFactor y.typeName4("C", []), [ASTFactory.variableDeclaration("c")]));
1832 } 1859 }
1833 void test_visitWhileStatement() { 1860 void test_visitWhileStatement() {
1834 assertSource("while (c) {}", ASTFactory.whileStatement(ASTFactory.identifier 2("c"), ASTFactory.block([]))); 1861 assertSource("while (c) {}", ASTFactory.whileStatement(ASTFactory.identifier 3("c"), ASTFactory.block([])));
1835 } 1862 }
1836 void test_visitWithClause_multiple() { 1863 void test_visitWithClause_multiple() {
1837 assertSource("with A, B, C", ASTFactory.withClause([ASTFactory.typeName3("A" , []), ASTFactory.typeName3("B", []), ASTFactory.typeName3("C", [])])); 1864 assertSource("with A, B, C", ASTFactory.withClause([ASTFactory.typeName4("A" , []), ASTFactory.typeName4("B", []), ASTFactory.typeName4("C", [])]));
1838 } 1865 }
1839 void test_visitWithClause_single() { 1866 void test_visitWithClause_single() {
1840 assertSource("with A", ASTFactory.withClause([ASTFactory.typeName3("A", [])] )); 1867 assertSource("with A", ASTFactory.withClause([ASTFactory.typeName4("A", [])] ));
1841 } 1868 }
1842 /** 1869 /**
1843 * Assert that a {@code ToSourceVisitor} will produce the expected source when visiting the given 1870 * Assert that a {@code ToSourceVisitor} will produce the expected source when visiting the given
1844 * node. 1871 * node.
1845 * @param expectedSource the source string that the visitor is expected to pro duce 1872 * @param expectedSource the source string that the visitor is expected to pro duce
1846 * @param node the AST node being visited to produce the actual source 1873 * @param node the AST node being visited to produce the actual source
1847 * @throws AFE if the visitor does not produce the expected source for the giv en node 1874 * @throws AFE if the visitor does not produce the expected source for the giv en node
1848 */ 1875 */
1849 void assertSource(String expectedSource, ASTNode node) { 1876 void assertSource(String expectedSource, ASTNode node) {
1850 PrintStringWriter writer = new PrintStringWriter(); 1877 PrintStringWriter writer = new PrintStringWriter();
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
2562 runJUnitTest(__test, __test.test_visitMethodInvocation_target); 2589 runJUnitTest(__test, __test.test_visitMethodInvocation_target);
2563 }); 2590 });
2564 _ut.test('test_visitNamedExpression', () { 2591 _ut.test('test_visitNamedExpression', () {
2565 final __test = new ToSourceVisitorTest(); 2592 final __test = new ToSourceVisitorTest();
2566 runJUnitTest(__test, __test.test_visitNamedExpression); 2593 runJUnitTest(__test, __test.test_visitNamedExpression);
2567 }); 2594 });
2568 _ut.test('test_visitNamedFormalParameter', () { 2595 _ut.test('test_visitNamedFormalParameter', () {
2569 final __test = new ToSourceVisitorTest(); 2596 final __test = new ToSourceVisitorTest();
2570 runJUnitTest(__test, __test.test_visitNamedFormalParameter); 2597 runJUnitTest(__test, __test.test_visitNamedFormalParameter);
2571 }); 2598 });
2599 _ut.test('test_visitNativeFunctionBody', () {
2600 final __test = new ToSourceVisitorTest();
2601 runJUnitTest(__test, __test.test_visitNativeFunctionBody);
2602 });
2572 _ut.test('test_visitNullLiteral', () { 2603 _ut.test('test_visitNullLiteral', () {
2573 final __test = new ToSourceVisitorTest(); 2604 final __test = new ToSourceVisitorTest();
2574 runJUnitTest(__test, __test.test_visitNullLiteral); 2605 runJUnitTest(__test, __test.test_visitNullLiteral);
2575 }); 2606 });
2576 _ut.test('test_visitParenthesizedExpression', () { 2607 _ut.test('test_visitParenthesizedExpression', () {
2577 final __test = new ToSourceVisitorTest(); 2608 final __test = new ToSourceVisitorTest();
2578 runJUnitTest(__test, __test.test_visitParenthesizedExpression); 2609 runJUnitTest(__test, __test.test_visitParenthesizedExpression);
2579 }); 2610 });
2580 _ut.test('test_visitPartDirective', () { 2611 _ut.test('test_visitPartDirective', () {
2581 final __test = new ToSourceVisitorTest(); 2612 final __test = new ToSourceVisitorTest();
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
2820 }); 2851 });
2821 } 2852 }
2822 } 2853 }
2823 main() { 2854 main() {
2824 ConstantEvaluatorTest.dartSuite(); 2855 ConstantEvaluatorTest.dartSuite();
2825 NodeLocatorTest.dartSuite(); 2856 NodeLocatorTest.dartSuite();
2826 ToSourceVisitorTest.dartSuite(); 2857 ToSourceVisitorTest.dartSuite();
2827 IndexExpressionTest.dartSuite(); 2858 IndexExpressionTest.dartSuite();
2828 SimpleIdentifierTest.dartSuite(); 2859 SimpleIdentifierTest.dartSuite();
2829 } 2860 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698