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 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1377 /** | 1374 /** |
1378 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. | 1375 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. |
1379 */ | 1376 */ |
1380 class _TypeParameterScope extends _Scope { | 1377 class _TypeParameterScope extends _Scope { |
1381 /** | 1378 /** |
1382 * Get the number of [_ScopedTypeParameter]s defined in this | 1379 * Get the number of [_ScopedTypeParameter]s defined in this |
1383 * [_TypeParameterScope]. | 1380 * [_TypeParameterScope]. |
1384 */ | 1381 */ |
1385 int get length => _definedNames.length; | 1382 int get length => _definedNames.length; |
1386 } | 1383 } |
OLD | NEW |