| 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 'package:analyzer/dart/element/element.dart'; | 7 import 'package:analyzer/dart/element/element.dart'; |
| 8 import 'package:analyzer/dart/element/type.dart'; | 8 import 'package:analyzer/dart/element/type.dart'; |
| 9 import 'package:analyzer/src/dart/element/element.dart'; | 9 import 'package:analyzer/src/dart/element/element.dart'; |
| 10 import 'package:analyzer/src/dart/element/type.dart'; | 10 import 'package:analyzer/src/dart/element/type.dart'; |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 return b; | 499 return b; |
| 500 } | 500 } |
| 501 | 501 |
| 502 /** | 502 /** |
| 503 * Serialize the given [importElement] yielding an [UnlinkedImportBuilder]. | 503 * Serialize the given [importElement] yielding an [UnlinkedImportBuilder]. |
| 504 * Also, add linked information about it to the [linkedImports] list. | 504 * Also, add linked information about it to the [linkedImports] list. |
| 505 */ | 505 */ |
| 506 UnlinkedImportBuilder serializeImport(ImportElement importElement) { | 506 UnlinkedImportBuilder serializeImport(ImportElement importElement) { |
| 507 UnlinkedImportBuilder b = new UnlinkedImportBuilder(); | 507 UnlinkedImportBuilder b = new UnlinkedImportBuilder(); |
| 508 b.isDeferred = importElement.isDeferred; | 508 b.isDeferred = importElement.isDeferred; |
| 509 b.offset = importElement.nameOffset; | |
| 510 b.combinators = importElement.combinators.map(serializeCombinator).toList(); | 509 b.combinators = importElement.combinators.map(serializeCombinator).toList(); |
| 511 if (importElement.prefix != null) { | 510 if (importElement.prefix != null) { |
| 512 b.prefixReference = serializePrefix(importElement.prefix); | 511 b.prefixReference = serializePrefix(importElement.prefix); |
| 513 b.prefixOffset = importElement.prefix.nameOffset; | 512 b.prefixOffset = importElement.prefix.nameOffset; |
| 514 } | 513 } |
| 515 if (importElement.isSynthetic) { | 514 if (importElement.isSynthetic) { |
| 516 b.isImplicit = true; | 515 b.isImplicit = true; |
| 517 } else { | 516 } else { |
| 517 b.offset = importElement.nameOffset; |
| 518 b.uri = importElement.uri; | 518 b.uri = importElement.uri; |
| 519 b.uriOffset = importElement.uriOffset; | 519 b.uriOffset = importElement.uriOffset; |
| 520 b.uriEnd = importElement.uriEnd; | 520 b.uriEnd = importElement.uriEnd; |
| 521 } | 521 } |
| 522 return b; | 522 return b; |
| 523 } | 523 } |
| 524 | 524 |
| 525 /** | 525 /** |
| 526 * Serialize the given [parameter] into an [UnlinkedParam]. | 526 * Serialize the given [parameter] into an [UnlinkedParam]. |
| 527 */ | 527 */ |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 exportNames.add(new LinkedExportNameBuilder( | 980 exportNames.add(new LinkedExportNameBuilder( |
| 981 name: name, | 981 name: name, |
| 982 dependency: serializeDependency(dependentLibrary), | 982 dependency: serializeDependency(dependentLibrary), |
| 983 unit: unit, | 983 unit: unit, |
| 984 kind: kind)); | 984 kind: kind)); |
| 985 } | 985 } |
| 986 pb.exportNames = exportNames; | 986 pb.exportNames = exportNames; |
| 987 return pb; | 987 return pb; |
| 988 } | 988 } |
| 989 } | 989 } |
| OLD | NEW |