| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.summarize_ast; | 5 library serialization.summarize_ast; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/ast/token.dart'; | 8 import 'package:analyzer/dart/ast/token.dart'; |
| 9 import 'package:analyzer/dart/ast/visitor.dart'; | 9 import 'package:analyzer/dart/ast/visitor.dart'; |
| 10 import 'package:analyzer/src/generated/utilities_dart.dart'; | 10 import 'package:analyzer/src/generated/utilities_dart.dart'; |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 } | 402 } |
| 403 | 403 |
| 404 /** | 404 /** |
| 405 * Serialize a [Combinator] into an [UnlinkedCombinator]. | 405 * Serialize a [Combinator] into an [UnlinkedCombinator]. |
| 406 */ | 406 */ |
| 407 UnlinkedCombinatorBuilder serializeCombinator(Combinator combinator) { | 407 UnlinkedCombinatorBuilder serializeCombinator(Combinator combinator) { |
| 408 UnlinkedCombinatorBuilder b = new UnlinkedCombinatorBuilder(); | 408 UnlinkedCombinatorBuilder b = new UnlinkedCombinatorBuilder(); |
| 409 if (combinator is ShowCombinator) { | 409 if (combinator is ShowCombinator) { |
| 410 b.shows = | 410 b.shows = |
| 411 combinator.shownNames.map((SimpleIdentifier id) => id.name).toList(); | 411 combinator.shownNames.map((SimpleIdentifier id) => id.name).toList(); |
| 412 b.offset = combinator.offset; |
| 413 b.end = combinator.end; |
| 412 } else if (combinator is HideCombinator) { | 414 } else if (combinator is HideCombinator) { |
| 413 b.hides = | 415 b.hides = |
| 414 combinator.hiddenNames.map((SimpleIdentifier id) => id.name).toList(); | 416 combinator.hiddenNames.map((SimpleIdentifier id) => id.name).toList(); |
| 415 } else { | 417 } else { |
| 416 throw new StateError( | 418 throw new StateError( |
| 417 'Unexpected combinator type: ${combinator.runtimeType}'); | 419 'Unexpected combinator type: ${combinator.runtimeType}'); |
| 418 } | 420 } |
| 419 return b; | 421 return b; |
| 420 } | 422 } |
| 421 | 423 |
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1125 /** | 1127 /** |
| 1126 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. | 1128 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. |
| 1127 */ | 1129 */ |
| 1128 class _TypeParameterScope extends _Scope { | 1130 class _TypeParameterScope extends _Scope { |
| 1129 /** | 1131 /** |
| 1130 * Get the number of [_ScopedTypeParameter]s defined in this | 1132 * Get the number of [_ScopedTypeParameter]s defined in this |
| 1131 * [_TypeParameterScope]. | 1133 * [_TypeParameterScope]. |
| 1132 */ | 1134 */ |
| 1133 int get length => _definedNames.length; | 1135 int get length => _definedNames.length; |
| 1134 } | 1136 } |
| OLD | NEW |