| 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 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 b.uri = importElement.uri; | 846 b.uri = importElement.uri; |
| 847 b.uriOffset = importElement.uriOffset; | 847 b.uriOffset = importElement.uriOffset; |
| 848 b.uriEnd = importElement.uriEnd; | 848 b.uriEnd = importElement.uriEnd; |
| 849 } | 849 } |
| 850 return b; | 850 return b; |
| 851 } | 851 } |
| 852 | 852 |
| 853 /** | 853 /** |
| 854 * Serialize the given [label], creating an [UnlinkedLabelBuilder]. | 854 * Serialize the given [label], creating an [UnlinkedLabelBuilder]. |
| 855 */ | 855 */ |
| 856 UnlinkedLabelBuilder serializeLabel(LabelElementImpl label) { | 856 UnlinkedLabelBuilder serializeLabel(LabelElement label) { |
| 857 LabelElementImpl labelImpl = label as LabelElementImpl; |
| 857 UnlinkedLabelBuilder b = new UnlinkedLabelBuilder(); | 858 UnlinkedLabelBuilder b = new UnlinkedLabelBuilder(); |
| 858 b.name = label.name; | 859 b.name = labelImpl.name; |
| 859 b.nameOffset = label.nameOffset; | 860 b.nameOffset = labelImpl.nameOffset; |
| 860 b.isOnSwitchMember = label.isOnSwitchMember; | 861 b.isOnSwitchMember = labelImpl.isOnSwitchMember; |
| 861 b.isOnSwitchStatement = label.isOnSwitchStatement; | 862 b.isOnSwitchStatement = labelImpl.isOnSwitchStatement; |
| 862 return b; | 863 return b; |
| 863 } | 864 } |
| 864 | 865 |
| 865 /** | 866 /** |
| 866 * Serialize the given [parameter] into an [UnlinkedParam]. | 867 * Serialize the given [parameter] into an [UnlinkedParam]. |
| 867 */ | 868 */ |
| 868 UnlinkedParamBuilder serializeParam(ParameterElement parameter, | 869 UnlinkedParamBuilder serializeParam(ParameterElement parameter, |
| 869 [Element context]) { | 870 [Element context]) { |
| 870 context ??= parameter; | 871 context ??= parameter; |
| 871 UnlinkedParamBuilder b = new UnlinkedParamBuilder(); | 872 UnlinkedParamBuilder b = new UnlinkedParamBuilder(); |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1621 exportNames.add(new LinkedExportNameBuilder( | 1622 exportNames.add(new LinkedExportNameBuilder( |
| 1622 name: name, | 1623 name: name, |
| 1623 dependency: serializeDependency(dependentLibrary), | 1624 dependency: serializeDependency(dependentLibrary), |
| 1624 unit: unit, | 1625 unit: unit, |
| 1625 kind: kind)); | 1626 kind: kind)); |
| 1626 } | 1627 } |
| 1627 pb.exportNames = exportNames; | 1628 pb.exportNames = exportNames; |
| 1628 return pb; | 1629 return pb; |
| 1629 } | 1630 } |
| 1630 } | 1631 } |
| OLD | NEW |