| OLD | NEW |
| 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 library engine.ast_test; | 3 library engine.ast_test; |
| 4 import 'dart:collection'; | 4 import 'dart:collection'; |
| 5 import 'package:analyzer_experimental/src/generated/java_core.dart'; | 5 import 'package:analyzer_experimental/src/generated/java_core.dart'; |
| 6 import 'package:analyzer_experimental/src/generated/java_engine.dart'; | 6 import 'package:analyzer_experimental/src/generated/java_engine.dart'; |
| 7 import 'package:analyzer_experimental/src/generated/java_junit.dart'; | 7 import 'package:analyzer_experimental/src/generated/java_junit.dart'; |
| 8 import 'package:analyzer_experimental/src/generated/source.dart'; | 8 import 'package:analyzer_experimental/src/generated/source.dart'; |
| 9 import 'package:analyzer_experimental/src/generated/error.dart'; | 9 import 'package:analyzer_experimental/src/generated/error.dart'; |
| 10 import 'package:analyzer_experimental/src/generated/scanner.dart'; | 10 import 'package:analyzer_experimental/src/generated/scanner.dart'; |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 static DoubleLiteral doubleLiteral(double value) => new DoubleLiteral.full(Tok
enFactory.token2(value.toString()), value); | 272 static DoubleLiteral doubleLiteral(double value) => new DoubleLiteral.full(Tok
enFactory.token2(value.toString()), value); |
| 273 static EmptyFunctionBody emptyFunctionBody() => new EmptyFunctionBody.full(Tok
enFactory.token3(TokenType.SEMICOLON)); | 273 static EmptyFunctionBody emptyFunctionBody() => new EmptyFunctionBody.full(Tok
enFactory.token3(TokenType.SEMICOLON)); |
| 274 static EmptyStatement emptyStatement() => new EmptyStatement.full(TokenFactory
.token3(TokenType.SEMICOLON)); | 274 static EmptyStatement emptyStatement() => new EmptyStatement.full(TokenFactory
.token3(TokenType.SEMICOLON)); |
| 275 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)); | 275 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)); |
| 276 static ExportDirective exportDirective2(String uri, List<Combinator> combinato
rs) => exportDirective(new List<Annotation>(), uri, combinators); | 276 static ExportDirective exportDirective2(String uri, List<Combinator> combinato
rs) => exportDirective(new List<Annotation>(), uri, combinators); |
| 277 static ExpressionFunctionBody expressionFunctionBody(Expression expression) =>
new ExpressionFunctionBody.full(TokenFactory.token3(TokenType.FUNCTION), expres
sion, TokenFactory.token3(TokenType.SEMICOLON)); | 277 static ExpressionFunctionBody expressionFunctionBody(Expression expression) =>
new ExpressionFunctionBody.full(TokenFactory.token3(TokenType.FUNCTION), expres
sion, TokenFactory.token3(TokenType.SEMICOLON)); |
| 278 static ExpressionStatement expressionStatement(Expression expression) => new E
xpressionStatement.full(expression, TokenFactory.token3(TokenType.SEMICOLON)); | 278 static ExpressionStatement expressionStatement(Expression expression) => new E
xpressionStatement.full(expression, TokenFactory.token3(TokenType.SEMICOLON)); |
| 279 static ExtendsClause extendsClause(TypeName type) => new ExtendsClause.full(To
kenFactory.token(Keyword.EXTENDS), type); | 279 static ExtendsClause extendsClause(TypeName type) => new ExtendsClause.full(To
kenFactory.token(Keyword.EXTENDS), type); |
| 280 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)); | 280 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)); |
| 281 static FieldDeclaration fieldDeclaration2(bool isStatic, Keyword keyword, List
<VariableDeclaration> variables) => fieldDeclaration(isStatic, keyword, null, va
riables); | 281 static FieldDeclaration fieldDeclaration2(bool isStatic, Keyword keyword, List
<VariableDeclaration> variables) => fieldDeclaration(isStatic, keyword, null, va
riables); |
| 282 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)); | 282 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), null); |
| 283 static FieldFormalParameter fieldFormalParameter2(String identifier) => fieldF
ormalParameter(null, null, identifier); | 283 static FieldFormalParameter fieldFormalParameter2(Keyword keyword, TypeName ty
pe, String identifier, FormalParameterList parameterList) => new FieldFormalPara
meter.full(null, null, keyword == null ? null : TokenFactory.token(keyword), typ
e, TokenFactory.token(Keyword.THIS), TokenFactory.token3(TokenType.PERIOD), iden
tifier3(identifier), parameterList); |
| 284 static FieldFormalParameter fieldFormalParameter3(String identifier) => fieldF
ormalParameter(null, null, identifier); |
| 284 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); | 285 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); |
| 285 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)); | 286 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)); |
| 286 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); | 287 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); |
| 287 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); | 288 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); |
| 288 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); | 289 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); |
| 289 static FunctionDeclarationStatement functionDeclarationStatement(TypeName type
, Keyword keyword, String name, FunctionExpression functionExpression) => new Fu
nctionDeclarationStatement.full(functionDeclaration(type, keyword, name, functio
nExpression)); | 290 static FunctionDeclarationStatement functionDeclarationStatement(TypeName type
, Keyword keyword, String name, FunctionExpression functionExpression) => new Fu
nctionDeclarationStatement.full(functionDeclaration(type, keyword, name, functio
nExpression)); |
| 290 static FunctionExpression functionExpression() => new FunctionExpression.full(
formalParameterList([]), blockFunctionBody([])); | 291 static FunctionExpression functionExpression() => new FunctionExpression.full(
formalParameterList([]), blockFunctionBody([])); |
| 291 static FunctionExpression functionExpression2(FormalParameterList parameters,
FunctionBody body) => new FunctionExpression.full(parameters, body); | 292 static FunctionExpression functionExpression2(FormalParameterList parameters,
FunctionBody body) => new FunctionExpression.full(parameters, body); |
| 292 static FunctionExpressionInvocation functionExpressionInvocation(Expression fu
nction, List<Expression> arguments) => new FunctionExpressionInvocation.full(fun
ction, argumentList(arguments)); | 293 static FunctionExpressionInvocation functionExpressionInvocation(Expression fu
nction, List<Expression> arguments) => new FunctionExpressionInvocation.full(fun
ction, argumentList(arguments)); |
| 293 static FunctionTypedFormalParameter functionTypedFormalParameter(TypeName retu
rnType, String identifier, List<FormalParameter> parameters) => new FunctionType
dFormalParameter.full(null, null, returnType, identifier3(identifier), formalPar
ameterList(parameters)); | 294 static FunctionTypedFormalParameter functionTypedFormalParameter(TypeName retu
rnType, String identifier, List<FormalParameter> parameters) => new FunctionType
dFormalParameter.full(null, null, returnType, identifier3(identifier), formalPar
ameterList(parameters)); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 void test_inDeclarationContext_constructorDeclaration() { | 477 void test_inDeclarationContext_constructorDeclaration() { |
| 477 SimpleIdentifier identifier = ASTFactory.constructorDeclaration(ASTFactory.i
dentifier3("C"), "c", null, null).name; | 478 SimpleIdentifier identifier = ASTFactory.constructorDeclaration(ASTFactory.i
dentifier3("C"), "c", null, null).name; |
| 478 JUnitTestCase.assertTrue(identifier.inDeclarationContext()); | 479 JUnitTestCase.assertTrue(identifier.inDeclarationContext()); |
| 479 } | 480 } |
| 480 void test_inDeclarationContext_declaredIdentifier() { | 481 void test_inDeclarationContext_declaredIdentifier() { |
| 481 DeclaredIdentifier declaredIdentifier = ASTFactory.declaredIdentifier3("v"); | 482 DeclaredIdentifier declaredIdentifier = ASTFactory.declaredIdentifier3("v"); |
| 482 SimpleIdentifier identifier = declaredIdentifier.identifier; | 483 SimpleIdentifier identifier = declaredIdentifier.identifier; |
| 483 JUnitTestCase.assertTrue(identifier.inDeclarationContext()); | 484 JUnitTestCase.assertTrue(identifier.inDeclarationContext()); |
| 484 } | 485 } |
| 485 void test_inDeclarationContext_fieldFormalParameter() { | 486 void test_inDeclarationContext_fieldFormalParameter() { |
| 486 SimpleIdentifier identifier = ASTFactory.fieldFormalParameter2("p").identifi
er; | 487 SimpleIdentifier identifier = ASTFactory.fieldFormalParameter3("p").identifi
er; |
| 487 JUnitTestCase.assertFalse(identifier.inDeclarationContext()); | 488 JUnitTestCase.assertFalse(identifier.inDeclarationContext()); |
| 488 } | 489 } |
| 489 void test_inDeclarationContext_functionDeclaration() { | 490 void test_inDeclarationContext_functionDeclaration() { |
| 490 SimpleIdentifier identifier = ASTFactory.functionDeclaration(null, null, "f"
, null).name; | 491 SimpleIdentifier identifier = ASTFactory.functionDeclaration(null, null, "f"
, null).name; |
| 491 JUnitTestCase.assertTrue(identifier.inDeclarationContext()); | 492 JUnitTestCase.assertTrue(identifier.inDeclarationContext()); |
| 492 } | 493 } |
| 493 void test_inDeclarationContext_functionTypeAlias() { | 494 void test_inDeclarationContext_functionTypeAlias() { |
| 494 SimpleIdentifier identifier = ASTFactory.typeAlias(null, "F", null, null).na
me; | 495 SimpleIdentifier identifier = ASTFactory.typeAlias(null, "F", null, null).na
me; |
| 495 JUnitTestCase.assertTrue(identifier.inDeclarationContext()); | 496 JUnitTestCase.assertTrue(identifier.inDeclarationContext()); |
| 496 } | 497 } |
| (...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1491 } | 1492 } |
| 1492 void test_visitExtendsClause() { | 1493 void test_visitExtendsClause() { |
| 1493 assertSource("extends C", ASTFactory.extendsClause(ASTFactory.typeName4("C",
[]))); | 1494 assertSource("extends C", ASTFactory.extendsClause(ASTFactory.typeName4("C",
[]))); |
| 1494 } | 1495 } |
| 1495 void test_visitFieldDeclaration_instance() { | 1496 void test_visitFieldDeclaration_instance() { |
| 1496 assertSource("var a;", ASTFactory.fieldDeclaration2(false, Keyword.VAR, [AST
Factory.variableDeclaration("a")])); | 1497 assertSource("var a;", ASTFactory.fieldDeclaration2(false, Keyword.VAR, [AST
Factory.variableDeclaration("a")])); |
| 1497 } | 1498 } |
| 1498 void test_visitFieldDeclaration_static() { | 1499 void test_visitFieldDeclaration_static() { |
| 1499 assertSource("static var a;", ASTFactory.fieldDeclaration2(true, Keyword.VAR
, [ASTFactory.variableDeclaration("a")])); | 1500 assertSource("static var a;", ASTFactory.fieldDeclaration2(true, Keyword.VAR
, [ASTFactory.variableDeclaration("a")])); |
| 1500 } | 1501 } |
| 1502 void test_visitFieldFormalParameter_functionTyped() { |
| 1503 assertSource("A this.a(b)", ASTFactory.fieldFormalParameter2(null, ASTFactor
y.typeName4("A", []), "a", ASTFactory.formalParameterList([ASTFactory.simpleForm
alParameter3("b")]))); |
| 1504 } |
| 1501 void test_visitFieldFormalParameter_keyword() { | 1505 void test_visitFieldFormalParameter_keyword() { |
| 1502 assertSource("var this.a", ASTFactory.fieldFormalParameter(Keyword.VAR, null
, "a")); | 1506 assertSource("var this.a", ASTFactory.fieldFormalParameter(Keyword.VAR, null
, "a")); |
| 1503 } | 1507 } |
| 1504 void test_visitFieldFormalParameter_keywordAndType() { | 1508 void test_visitFieldFormalParameter_keywordAndType() { |
| 1505 assertSource("final A this.a", ASTFactory.fieldFormalParameter(Keyword.FINAL
, ASTFactory.typeName4("A", []), "a")); | 1509 assertSource("final A this.a", ASTFactory.fieldFormalParameter(Keyword.FINAL
, ASTFactory.typeName4("A", []), "a")); |
| 1506 } | 1510 } |
| 1507 void test_visitFieldFormalParameter_type() { | 1511 void test_visitFieldFormalParameter_type() { |
| 1508 assertSource("A this.a", ASTFactory.fieldFormalParameter(null, ASTFactory.ty
peName4("A", []), "a")); | 1512 assertSource("A this.a", ASTFactory.fieldFormalParameter(null, ASTFactory.ty
peName4("A", []), "a")); |
| 1509 } | 1513 } |
| 1510 void test_visitForEachStatement() { | 1514 void test_visitForEachStatement() { |
| (...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2327 runJUnitTest(__test, __test.test_visitExtendsClause); | 2331 runJUnitTest(__test, __test.test_visitExtendsClause); |
| 2328 }); | 2332 }); |
| 2329 _ut.test('test_visitFieldDeclaration_instance', () { | 2333 _ut.test('test_visitFieldDeclaration_instance', () { |
| 2330 final __test = new ToSourceVisitorTest(); | 2334 final __test = new ToSourceVisitorTest(); |
| 2331 runJUnitTest(__test, __test.test_visitFieldDeclaration_instance); | 2335 runJUnitTest(__test, __test.test_visitFieldDeclaration_instance); |
| 2332 }); | 2336 }); |
| 2333 _ut.test('test_visitFieldDeclaration_static', () { | 2337 _ut.test('test_visitFieldDeclaration_static', () { |
| 2334 final __test = new ToSourceVisitorTest(); | 2338 final __test = new ToSourceVisitorTest(); |
| 2335 runJUnitTest(__test, __test.test_visitFieldDeclaration_static); | 2339 runJUnitTest(__test, __test.test_visitFieldDeclaration_static); |
| 2336 }); | 2340 }); |
| 2341 _ut.test('test_visitFieldFormalParameter_functionTyped', () { |
| 2342 final __test = new ToSourceVisitorTest(); |
| 2343 runJUnitTest(__test, __test.test_visitFieldFormalParameter_functionTyped
); |
| 2344 }); |
| 2337 _ut.test('test_visitFieldFormalParameter_keyword', () { | 2345 _ut.test('test_visitFieldFormalParameter_keyword', () { |
| 2338 final __test = new ToSourceVisitorTest(); | 2346 final __test = new ToSourceVisitorTest(); |
| 2339 runJUnitTest(__test, __test.test_visitFieldFormalParameter_keyword); | 2347 runJUnitTest(__test, __test.test_visitFieldFormalParameter_keyword); |
| 2340 }); | 2348 }); |
| 2341 _ut.test('test_visitFieldFormalParameter_keywordAndType', () { | 2349 _ut.test('test_visitFieldFormalParameter_keywordAndType', () { |
| 2342 final __test = new ToSourceVisitorTest(); | 2350 final __test = new ToSourceVisitorTest(); |
| 2343 runJUnitTest(__test, __test.test_visitFieldFormalParameter_keywordAndTyp
e); | 2351 runJUnitTest(__test, __test.test_visitFieldFormalParameter_keywordAndTyp
e); |
| 2344 }); | 2352 }); |
| 2345 _ut.test('test_visitFieldFormalParameter_type', () { | 2353 _ut.test('test_visitFieldFormalParameter_type', () { |
| 2346 final __test = new ToSourceVisitorTest(); | 2354 final __test = new ToSourceVisitorTest(); |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2967 } | 2975 } |
| 2968 main() { | 2976 main() { |
| 2969 ConstantEvaluatorTest.dartSuite(); | 2977 ConstantEvaluatorTest.dartSuite(); |
| 2970 NodeLocatorTest.dartSuite(); | 2978 NodeLocatorTest.dartSuite(); |
| 2971 ToSourceVisitorTest.dartSuite(); | 2979 ToSourceVisitorTest.dartSuite(); |
| 2972 BreadthFirstVisitorTest.dartSuite(); | 2980 BreadthFirstVisitorTest.dartSuite(); |
| 2973 IndexExpressionTest.dartSuite(); | 2981 IndexExpressionTest.dartSuite(); |
| 2974 SimpleIdentifierTest.dartSuite(); | 2982 SimpleIdentifierTest.dartSuite(); |
| 2975 VariableDeclarationTest.dartSuite(); | 2983 VariableDeclarationTest.dartSuite(); |
| 2976 } | 2984 } |
| OLD | NEW |