| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Defines static information collected by the type checker and used later by | 5 /// Defines static information collected by the type checker and used later by |
| 6 /// emitters to generate code. | 6 /// emitters to generate code. |
| 7 library ddc.src.info; | 7 library ddc.src.info; |
| 8 | 8 |
| 9 import 'dart:mirrors'; | 9 import 'dart:mirrors'; |
| 10 | 10 |
| 11 import 'package:analyzer/src/generated/ast.dart'; | 11 import 'package:analyzer/src/generated/ast.dart'; |
| 12 import 'package:analyzer/src/generated/element.dart'; | 12 import 'package:analyzer/src/generated/element.dart'; |
| 13 import 'package:analyzer/src/generated/scanner.dart' | 13 import 'package:analyzer/src/generated/scanner.dart' |
| 14 show Token, TokenType, SyntheticStringToken; | 14 show Token, TokenType, SyntheticStringToken; |
| 15 import 'package:logging/logging.dart' show Level; | 15 import 'package:logging/logging.dart' show Level; |
| 16 | 16 |
| 17 import 'package:ddc/src/checker/rules.dart'; | 17 import 'package:dev_compiler/src/checker/rules.dart'; |
| 18 import 'package:ddc/src/utils.dart' as utils; | 18 import 'package:dev_compiler/src/utils.dart' as utils; |
| 19 | 19 |
| 20 /// Represents a summary of the results collected by running the program | 20 /// Represents a summary of the results collected by running the program |
| 21 /// checker. | 21 /// checker. |
| 22 class CheckerResults { | 22 class CheckerResults { |
| 23 final List<LibraryInfo> libraries; | 23 final List<LibraryInfo> libraries; |
| 24 final TypeRules rules; | 24 final TypeRules rules; |
| 25 final bool failure; | 25 final bool failure; |
| 26 | 26 |
| 27 CheckerResults(this.libraries, this.rules, this.failure); | 27 CheckerResults(this.libraries, this.rules, this.failure); |
| 28 } | 28 } |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 for (var cls in lib.declarations.values.where((d) => d is ClassMirror)) { | 569 for (var cls in lib.declarations.values.where((d) => d is ClassMirror)) { |
| 570 if (cls.isSubtypeOf(infoMirror)) { | 570 if (cls.isSubtypeOf(infoMirror)) { |
| 571 allTypes.add(cls); | 571 allTypes.add(cls); |
| 572 baseTypes.add(cls.superclass); | 572 baseTypes.add(cls.superclass); |
| 573 } | 573 } |
| 574 } | 574 } |
| 575 allTypes.removeAll(baseTypes); | 575 allTypes.removeAll(baseTypes); |
| 576 return new List<Type>.from(allTypes.map((mirror) => mirror.reflectedType)) | 576 return new List<Type>.from(allTypes.map((mirror) => mirror.reflectedType)) |
| 577 ..sort((t1, t2) => '$t1'.compareTo('$t2')); | 577 ..sort((t1, t2) => '$t1'.compareTo('$t2')); |
| 578 }(); | 578 }(); |
| OLD | NEW |