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 | 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'; |
11 import 'package:analyzer-experimental/src/generated/error.dart'; | 11 import 'package:analyzer_experimental/src/generated/error.dart'; |
12 import 'package:analyzer-experimental/src/generated/scanner.dart'; | 12 import 'package:analyzer_experimental/src/generated/scanner.dart'; |
13 import 'package:analyzer-experimental/src/generated/ast.dart'; | 13 import 'package:analyzer_experimental/src/generated/ast.dart'; |
14 import 'package:analyzer-experimental/src/generated/utilities_dart.dart'; | 14 import 'package:analyzer_experimental/src/generated/utilities_dart.dart'; |
15 import 'package:analyzer-experimental/src/generated/element.dart' show ClassElem
ent; | 15 import 'package:analyzer_experimental/src/generated/element.dart' show ClassElem
ent; |
16 import 'package:unittest/unittest.dart' as _ut; | 16 import 'package:unittest/unittest.dart' as _ut; |
17 import 'parser_test.dart' show ParserTestCase; | 17 import 'parser_test.dart' show ParserTestCase; |
18 import 'test_support.dart'; | 18 import 'test_support.dart'; |
19 import 'scanner_test.dart' show TokenFactory; | 19 import 'scanner_test.dart' show TokenFactory; |
20 | 20 |
21 class NodeLocatorTest extends ParserTestCase { | 21 class NodeLocatorTest extends ParserTestCase { |
22 void test_offset() { | 22 void test_offset() { |
23 CompilationUnit unit = ParserTestCase.parseCompilationUnit("library myLib;",
[]); | 23 CompilationUnit unit = ParserTestCase.parseCompilationUnit("library myLib;",
[]); |
24 assertLocate(unit, 10, SimpleIdentifier); | 24 assertLocate(unit, 10, SimpleIdentifier); |
25 } | 25 } |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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)); | 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)); |
350 static TypeArgumentList typeArgumentList(List<TypeName> typeNames) => new Type
ArgumentList.full(TokenFactory.token3(TokenType.LT), list(typeNames), TokenFacto
ry.token3(TokenType.GT)); | 350 static TypeArgumentList typeArgumentList(List<TypeName> typeNames) => new Type
ArgumentList.full(TokenFactory.token3(TokenType.LT), list(typeNames), TokenFacto
ry.token3(TokenType.GT)); |
351 /** | 351 /** |
352 * Create a type name whose name has been resolved to the given element and wh
ose type has been | 352 * 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. | 353 * resolved to the type of the given element. |
354 * <p> | 354 * <p> |
355 * <b>Note:</b> This method does not correctly handle class elements that have
type parameters. | 355 * <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 | 356 * @param element the element defining the type represented by the type name |
357 * @return the type name that was created | 357 * @return the type name that was created |
358 */ | 358 */ |
359 static TypeName typeName(ClassElement element52, List<TypeName> arguments) { | 359 static TypeName typeName(ClassElement element55, List<TypeName> arguments) { |
360 SimpleIdentifier name21 = identifier2(element52.name); | 360 SimpleIdentifier name21 = identifier2(element55.name); |
361 name21.element = element52; | 361 name21.element = element55; |
362 TypeName typeName = typeName2(name21, arguments); | 362 TypeName typeName = typeName2(name21, arguments); |
363 typeName.type = element52.type; | 363 typeName.type = element55.type; |
364 return typeName; | 364 return typeName; |
365 } | 365 } |
366 static TypeName typeName2(Identifier name, List<TypeName> arguments) { | 366 static TypeName typeName2(Identifier name, List<TypeName> arguments) { |
367 if (arguments.length == 0) { | 367 if (arguments.length == 0) { |
368 return new TypeName.full(name, null); | 368 return new TypeName.full(name, null); |
369 } | 369 } |
370 return new TypeName.full(name, typeArgumentList(arguments)); | 370 return new TypeName.full(name, typeArgumentList(arguments)); |
371 } | 371 } |
372 static TypeName typeName3(String name, List<TypeName> arguments) { | 372 static TypeName typeName3(String name, List<TypeName> arguments) { |
373 if (arguments.length == 0) { | 373 if (arguments.length == 0) { |
(...skipping 2446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2820 }); | 2820 }); |
2821 } | 2821 } |
2822 } | 2822 } |
2823 main() { | 2823 main() { |
2824 ConstantEvaluatorTest.dartSuite(); | 2824 ConstantEvaluatorTest.dartSuite(); |
2825 NodeLocatorTest.dartSuite(); | 2825 NodeLocatorTest.dartSuite(); |
2826 ToSourceVisitorTest.dartSuite(); | 2826 ToSourceVisitorTest.dartSuite(); |
2827 IndexExpressionTest.dartSuite(); | 2827 IndexExpressionTest.dartSuite(); |
2828 SimpleIdentifierTest.dartSuite(); | 2828 SimpleIdentifierTest.dartSuite(); |
2829 } | 2829 } |
OLD | NEW |