| 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 library serialization.elements; | 5 library serialization.elements; |
| 6 | 6 |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 * Serialize documentation from the given [element], creating an | 714 * Serialize documentation from the given [element], creating an |
| 715 * [UnlinkedDocumentationComment]. | 715 * [UnlinkedDocumentationComment]. |
| 716 * | 716 * |
| 717 * If [element] has no documentation, `null` is returned. | 717 * If [element] has no documentation, `null` is returned. |
| 718 */ | 718 */ |
| 719 UnlinkedDocumentationCommentBuilder serializeDocumentation(Element element) { | 719 UnlinkedDocumentationCommentBuilder serializeDocumentation(Element element) { |
| 720 if (element.documentationComment == null) { | 720 if (element.documentationComment == null) { |
| 721 return null; | 721 return null; |
| 722 } | 722 } |
| 723 return new UnlinkedDocumentationCommentBuilder( | 723 return new UnlinkedDocumentationCommentBuilder( |
| 724 text: element.documentationComment); | 724 text: element.documentationComment, |
| 725 offset: element.docRange.offset, |
| 726 length: element.docRange.length); |
| 725 } | 727 } |
| 726 | 728 |
| 727 /** | 729 /** |
| 728 * Serialize the given [enumElement], creating an [UnlinkedEnum]. | 730 * Serialize the given [enumElement], creating an [UnlinkedEnum]. |
| 729 */ | 731 */ |
| 730 UnlinkedEnumBuilder serializeEnum(ClassElement enumElement) { | 732 UnlinkedEnumBuilder serializeEnum(ClassElement enumElement) { |
| 731 UnlinkedEnumBuilder b = new UnlinkedEnumBuilder(); | 733 UnlinkedEnumBuilder b = new UnlinkedEnumBuilder(); |
| 732 b.name = enumElement.name; | 734 b.name = enumElement.name; |
| 733 b.nameOffset = enumElement.nameOffset; | 735 b.nameOffset = enumElement.nameOffset; |
| 734 List<UnlinkedEnumValueBuilder> values = <UnlinkedEnumValueBuilder>[]; | 736 List<UnlinkedEnumValueBuilder> values = <UnlinkedEnumValueBuilder>[]; |
| (...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1710 exportNames.add(new LinkedExportNameBuilder( | 1712 exportNames.add(new LinkedExportNameBuilder( |
| 1711 name: name, | 1713 name: name, |
| 1712 dependency: serializeDependency(dependentLibrary), | 1714 dependency: serializeDependency(dependentLibrary), |
| 1713 unit: unit, | 1715 unit: unit, |
| 1714 kind: kind)); | 1716 kind: kind)); |
| 1715 } | 1717 } |
| 1716 pb.exportNames = exportNames; | 1718 pb.exportNames = exportNames; |
| 1717 return pb; | 1719 return pb; |
| 1718 } | 1720 } |
| 1719 } | 1721 } |
| OLD | NEW |