| 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( | 588 return new UnlinkedDocumentationCommentBuilder(text: text); |
| 589 text: text, | |
| 590 offset: documentationComment.offset, | |
| 591 length: documentationComment.length); | |
| 592 } | 589 } |
| 593 | 590 |
| 594 /** | 591 /** |
| 595 * Serialize a [FunctionDeclaration] or [MethodDeclaration] into an | 592 * Serialize a [FunctionDeclaration] or [MethodDeclaration] into an |
| 596 * [UnlinkedExecutable]. | 593 * [UnlinkedExecutable]. |
| 597 * | 594 * |
| 598 * If [serializeBodyExpr] is `true`, then the function definition is stored | 595 * If [serializeBodyExpr] is `true`, then the function definition is stored |
| 599 * in [UnlinkedExecutableBuilder.bodyExpr]. | 596 * in [UnlinkedExecutableBuilder.bodyExpr]. |
| 600 */ | 597 */ |
| 601 UnlinkedExecutableBuilder serializeExecutable( | 598 UnlinkedExecutableBuilder serializeExecutable( |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1378 /** | 1375 /** |
| 1379 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. | 1376 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. |
| 1380 */ | 1377 */ |
| 1381 class _TypeParameterScope extends _Scope { | 1378 class _TypeParameterScope extends _Scope { |
| 1382 /** | 1379 /** |
| 1383 * Get the number of [_ScopedTypeParameter]s defined in this | 1380 * Get the number of [_ScopedTypeParameter]s defined in this |
| 1384 * [_TypeParameterScope]. | 1381 * [_TypeParameterScope]. |
| 1385 */ | 1382 */ |
| 1386 int get length => _definedNames.length; | 1383 int get length => _definedNames.length; |
| 1387 } | 1384 } |
| OLD | NEW |