| 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/dart/element/type.dart' show DartType; | 10 import 'package:analyzer/dart/element/type.dart' show DartType; |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 /** | 590 /** |
| 591 * Serialize a [Comment] node into an [UnlinkedDocumentationComment] object. | 591 * Serialize a [Comment] node into an [UnlinkedDocumentationComment] object. |
| 592 */ | 592 */ |
| 593 UnlinkedDocumentationCommentBuilder serializeDocumentation( | 593 UnlinkedDocumentationCommentBuilder serializeDocumentation( |
| 594 Comment documentationComment) { | 594 Comment documentationComment) { |
| 595 if (documentationComment == null) { | 595 if (documentationComment == null) { |
| 596 return null; | 596 return null; |
| 597 } | 597 } |
| 598 String text = documentationComment.tokens | 598 String text = documentationComment.tokens |
| 599 .map((Token t) => t.toString()) | 599 .map((Token t) => t.toString()) |
| 600 .join() | 600 .join('\n') |
| 601 .replaceAll('\r\n', '\n'); | 601 .replaceAll('\r\n', '\n'); |
| 602 return new UnlinkedDocumentationCommentBuilder(text: text); | 602 return new UnlinkedDocumentationCommentBuilder(text: text); |
| 603 } | 603 } |
| 604 | 604 |
| 605 /** | 605 /** |
| 606 * Serialize a [FunctionDeclaration] or [MethodDeclaration] into an | 606 * Serialize a [FunctionDeclaration] or [MethodDeclaration] into an |
| 607 * [UnlinkedExecutable]. | 607 * [UnlinkedExecutable]. |
| 608 * | 608 * |
| 609 * If [serializeBodyExpr] is `true`, then the function definition is stored | 609 * If [serializeBodyExpr] is `true`, then the function definition is stored |
| 610 * in [UnlinkedExecutableBuilder.bodyExpr]. | 610 * in [UnlinkedExecutableBuilder.bodyExpr]. |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1417 /** | 1417 /** |
| 1418 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. | 1418 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. |
| 1419 */ | 1419 */ |
| 1420 class _TypeParameterScope extends _Scope { | 1420 class _TypeParameterScope extends _Scope { |
| 1421 /** | 1421 /** |
| 1422 * Get the number of [_ScopedTypeParameter]s defined in this | 1422 * Get the number of [_ScopedTypeParameter]s defined in this |
| 1423 * [_TypeParameterScope]. | 1423 * [_TypeParameterScope]. |
| 1424 */ | 1424 */ |
| 1425 int get length => _definedNames.length; | 1425 int get length => _definedNames.length; |
| 1426 } | 1426 } |
| OLD | NEW |