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 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1430 @override | 1430 @override |
1431 void visitPartDirective(PartDirective node) { | 1431 void visitPartDirective(PartDirective node) { |
1432 parts.add(new UnlinkedPartBuilder( | 1432 parts.add(new UnlinkedPartBuilder( |
1433 uriOffset: node.uri.offset, | 1433 uriOffset: node.uri.offset, |
1434 uriEnd: node.uri.end, | 1434 uriEnd: node.uri.end, |
1435 annotations: serializeAnnotations(node.metadata))); | 1435 annotations: serializeAnnotations(node.metadata))); |
1436 } | 1436 } |
1437 | 1437 |
1438 @override | 1438 @override |
1439 void visitPartOfDirective(PartOfDirective node) { | 1439 void visitPartOfDirective(PartOfDirective node) { |
1440 isCoreLibrary = node.libraryName?.name == 'dart.core'; | 1440 isCoreLibrary = node.libraryName?.name == 'dart.core' || |
| 1441 node.uri?.stringValue == 'core.dart'; |
1441 isPartOf = true; | 1442 isPartOf = true; |
1442 } | 1443 } |
1443 | 1444 |
1444 @override | 1445 @override |
1445 UnlinkedParamBuilder visitSimpleFormalParameter(SimpleFormalParameter node) { | 1446 UnlinkedParamBuilder visitSimpleFormalParameter(SimpleFormalParameter node) { |
1446 UnlinkedParamBuilder b = serializeParameter(node); | 1447 UnlinkedParamBuilder b = serializeParameter(node); |
1447 b.type = serializeTypeName(node.type); | 1448 b.type = serializeTypeName(node.type); |
1448 return b; | 1449 return b; |
1449 } | 1450 } |
1450 | 1451 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1486 /** | 1487 /** |
1487 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. | 1488 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. |
1488 */ | 1489 */ |
1489 class _TypeParameterScope extends _Scope { | 1490 class _TypeParameterScope extends _Scope { |
1490 /** | 1491 /** |
1491 * Get the number of [_ScopedTypeParameter]s defined in this | 1492 * Get the number of [_ScopedTypeParameter]s defined in this |
1492 * [_TypeParameterScope]. | 1493 * [_TypeParameterScope]. |
1493 */ | 1494 */ |
1494 int get length => _definedNames.length; | 1495 int get length => _definedNames.length; |
1495 } | 1496 } |
OLD | NEW |