| 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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 */ | 578 */ |
| 579 UnlinkedDocumentationCommentBuilder serializeDocumentation( | 579 UnlinkedDocumentationCommentBuilder serializeDocumentation( |
| 580 Comment documentationComment) { | 580 Comment documentationComment) { |
| 581 if (documentationComment == null) { | 581 if (documentationComment == null) { |
| 582 return null; | 582 return null; |
| 583 } | 583 } |
| 584 String text = documentationComment.tokens | 584 String text = documentationComment.tokens |
| 585 .map((Token t) => t.toString()) | 585 .map((Token t) => t.toString()) |
| 586 .join() | 586 .join() |
| 587 .replaceAll('\r\n', '\n'); | 587 .replaceAll('\r\n', '\n'); |
| 588 return new UnlinkedDocumentationCommentBuilder(text: text); | 588 return new UnlinkedDocumentationCommentBuilder( |
| 589 text: text, |
| 590 offset: documentationComment.offset, |
| 591 length: documentationComment.length); |
| 589 } | 592 } |
| 590 | 593 |
| 591 /** | 594 /** |
| 592 * Serialize a [FunctionDeclaration] or [MethodDeclaration] into an | 595 * Serialize a [FunctionDeclaration] or [MethodDeclaration] into an |
| 593 * [UnlinkedExecutable]. | 596 * [UnlinkedExecutable]. |
| 594 * | 597 * |
| 595 * If [serializeBodyExpr] is `true`, then the function definition is stored | 598 * If [serializeBodyExpr] is `true`, then the function definition is stored |
| 596 * in [UnlinkedExecutableBuilder.bodyExpr]. | 599 * in [UnlinkedExecutableBuilder.bodyExpr]. |
| 597 */ | 600 */ |
| 598 UnlinkedExecutableBuilder serializeExecutable( | 601 UnlinkedExecutableBuilder serializeExecutable( |
| (...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1374 /** | 1377 /** |
| 1375 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. | 1378 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. |
| 1376 */ | 1379 */ |
| 1377 class _TypeParameterScope extends _Scope { | 1380 class _TypeParameterScope extends _Scope { |
| 1378 /** | 1381 /** |
| 1379 * Get the number of [_ScopedTypeParameter]s defined in this | 1382 * Get the number of [_ScopedTypeParameter]s defined in this |
| 1380 * [_TypeParameterScope]. | 1383 * [_TypeParameterScope]. |
| 1381 */ | 1384 */ |
| 1382 int get length => _definedNames.length; | 1385 int get length => _definedNames.length; |
| 1383 } | 1386 } |
| OLD | NEW |