| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library engine.testing.element_factory; | 5 library engine.testing.element_factory; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/src/generated/ast.dart'; | 9 import 'package:analyzer/src/generated/ast.dart'; |
| 10 import 'package:analyzer/src/generated/constant.dart'; | 10 import 'package:analyzer/src/generated/constant.dart'; |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 spec.prefix = prefix; | 435 spec.prefix = prefix; |
| 436 spec.combinators = combinators; | 436 spec.combinators = combinators; |
| 437 return spec; | 437 return spec; |
| 438 } | 438 } |
| 439 | 439 |
| 440 static LibraryElementImpl library( | 440 static LibraryElementImpl library( |
| 441 AnalysisContext context, String libraryName) { | 441 AnalysisContext context, String libraryName) { |
| 442 String fileName = "/$libraryName.dart"; | 442 String fileName = "/$libraryName.dart"; |
| 443 CompilationUnitElementImpl unit = compilationUnit(fileName); | 443 CompilationUnitElementImpl unit = compilationUnit(fileName); |
| 444 LibraryElementImpl library = | 444 LibraryElementImpl library = |
| 445 new LibraryElementImpl(context, libraryName, 0); | 445 new LibraryElementImpl(context, libraryName, 0, libraryName.length); |
| 446 library.definingCompilationUnit = unit; | 446 library.definingCompilationUnit = unit; |
| 447 return library; | 447 return library; |
| 448 } | 448 } |
| 449 | 449 |
| 450 static LocalVariableElementImpl localVariableElement(Identifier name) => | 450 static LocalVariableElementImpl localVariableElement(Identifier name) => |
| 451 new LocalVariableElementImpl.forNode(name); | 451 new LocalVariableElementImpl.forNode(name); |
| 452 | 452 |
| 453 static LocalVariableElementImpl localVariableElement2(String name) => | 453 static LocalVariableElementImpl localVariableElement2(String name) => |
| 454 new LocalVariableElementImpl(name, 0); | 454 new LocalVariableElementImpl(name, 0); |
| 455 | 455 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 } | 604 } |
| 605 return variable; | 605 return variable; |
| 606 } | 606 } |
| 607 | 607 |
| 608 static TypeParameterElementImpl typeParameterElement(String name) { | 608 static TypeParameterElementImpl typeParameterElement(String name) { |
| 609 TypeParameterElementImpl element = new TypeParameterElementImpl(name, 0); | 609 TypeParameterElementImpl element = new TypeParameterElementImpl(name, 0); |
| 610 element.type = new TypeParameterTypeImpl(element); | 610 element.type = new TypeParameterTypeImpl(element); |
| 611 return element; | 611 return element; |
| 612 } | 612 } |
| 613 } | 613 } |
| OLD | NEW |