OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
6 * This library serializes the Dart2Js AST into a compact and easy to use | 6 * This library serializes the Dart2Js AST into a compact and easy to use |
7 * [Element] tree useful for code exploration tools such as DartDoc. | 7 * [Element] tree useful for code exploration tools such as DartDoc. |
8 */ | 8 */ |
9 library universe_serializer; | 9 library universe_serializer; |
10 | 10 |
11 import 'dartdoc.dart'; | 11 import 'dartdoc.dart'; |
12 | 12 |
13 // TODO(rnystrom): Use "package:" URL (#4968). | 13 // TODO(rnystrom): Use "package:" URL (#4968). |
14 import '../../../../../pkg/pathos/lib/path.dart' as path; | 14 import 'package:pathos/path.dart' as path; |
15 import '../../compiler/implementation/mirrors/dart2js_mirror.dart' as dart2js; | 15 import '../../compiler/implementation/mirrors/dart2js_mirror.dart' as dart2js; |
16 import '../../compiler/implementation/mirrors/mirrors.dart'; | 16 import '../../compiler/implementation/mirrors/mirrors.dart'; |
17 import '../../compiler/implementation/mirrors/mirrors_util.dart'; | 17 import '../../compiler/implementation/mirrors/mirrors_util.dart'; |
18 import '../../libraries.dart'; | 18 import '../../libraries.dart'; |
19 | 19 |
20 String _stripUri(String uri) { | 20 String _stripUri(String uri) { |
21 String prefix = "/dart/"; | 21 String prefix = "/dart/"; |
22 int start = uri.indexOf(prefix); | 22 int start = uri.indexOf(prefix); |
23 if (start != -1) { | 23 if (start != -1) { |
24 return uri.substring(start + prefix.length); | 24 return uri.substring(start + prefix.length); |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 Reference.fromElement(LibraryElement e) : name = e.name, refId = e.id; | 523 Reference.fromElement(LibraryElement e) : name = e.name, refId = e.id; |
524 | 524 |
525 static String getId(Mirror mirror) { | 525 static String getId(Mirror mirror) { |
526 String id = _escapeId(mirror.simpleName); | 526 String id = _escapeId(mirror.simpleName); |
527 if (mirror.owner != null) { | 527 if (mirror.owner != null) { |
528 id = '${getId(mirror.owner)}/$id'; | 528 id = '${getId(mirror.owner)}/$id'; |
529 } | 529 } |
530 return id; | 530 return id; |
531 } | 531 } |
532 } | 532 } |
OLD | NEW |