| 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/visitor.dart'; | 8 import 'package:analyzer/dart/ast/visitor.dart'; |
| 9 import 'package:analyzer/src/generated/scanner.dart'; | 9 import 'package:analyzer/src/generated/scanner.dart'; |
| 10 import 'package:analyzer/src/generated/utilities_dart.dart'; | 10 import 'package:analyzer/src/generated/utilities_dart.dart'; |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 b.variables = variables; | 385 b.variables = variables; |
| 386 b.publicNamespace = computePublicNamespace(compilationUnit); | 386 b.publicNamespace = computePublicNamespace(compilationUnit); |
| 387 return b; | 387 return b; |
| 388 } | 388 } |
| 389 | 389 |
| 390 /** | 390 /** |
| 391 * Serialize the given [expression], creating an [UnlinkedConstBuilder]. | 391 * Serialize the given [expression], creating an [UnlinkedConstBuilder]. |
| 392 */ | 392 */ |
| 393 UnlinkedConstBuilder serializeConstExpr(Expression expression) { | 393 UnlinkedConstBuilder serializeConstExpr(Expression expression) { |
| 394 _ConstExprSerializer serializer = new _ConstExprSerializer(this); | 394 _ConstExprSerializer serializer = new _ConstExprSerializer(this); |
| 395 serializer.serialize(expression); | 395 return serializer.serialize(expression); |
| 396 return serializer.toBuilder(); | |
| 397 } | 396 } |
| 398 | 397 |
| 399 /** | 398 /** |
| 400 * Serialize a [Comment] node into an [UnlinkedDocumentationComment] object. | 399 * Serialize a [Comment] node into an [UnlinkedDocumentationComment] object. |
| 401 */ | 400 */ |
| 402 UnlinkedDocumentationCommentBuilder serializeDocumentation( | 401 UnlinkedDocumentationCommentBuilder serializeDocumentation( |
| 403 Comment documentationComment) { | 402 Comment documentationComment) { |
| 404 if (documentationComment == null) { | 403 if (documentationComment == null) { |
| 405 return null; | 404 return null; |
| 406 } | 405 } |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 /** | 890 /** |
| 892 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. | 891 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. |
| 893 */ | 892 */ |
| 894 class _TypeParameterScope extends _Scope { | 893 class _TypeParameterScope extends _Scope { |
| 895 /** | 894 /** |
| 896 * Get the number of [_ScopedTypeParameter]s defined in this | 895 * Get the number of [_ScopedTypeParameter]s defined in this |
| 897 * [_TypeParameterScope]. | 896 * [_TypeParameterScope]. |
| 898 */ | 897 */ |
| 899 int get length => _definedNames.length; | 898 int get length => _definedNames.length; |
| 900 } | 899 } |
| OLD | NEW |