| 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 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1365 @override | 1365 @override |
| 1366 void visitPartDirective(PartDirective node) { | 1366 void visitPartDirective(PartDirective node) { |
| 1367 parts.add(new UnlinkedPartBuilder( | 1367 parts.add(new UnlinkedPartBuilder( |
| 1368 uriOffset: node.uri.offset, | 1368 uriOffset: node.uri.offset, |
| 1369 uriEnd: node.uri.end, | 1369 uriEnd: node.uri.end, |
| 1370 annotations: serializeAnnotations(node.metadata))); | 1370 annotations: serializeAnnotations(node.metadata))); |
| 1371 } | 1371 } |
| 1372 | 1372 |
| 1373 @override | 1373 @override |
| 1374 void visitPartOfDirective(PartOfDirective node) { | 1374 void visitPartOfDirective(PartOfDirective node) { |
| 1375 isCoreLibrary = node.libraryName.name == 'dart.core'; | 1375 isCoreLibrary = node.libraryName?.name == 'dart.core'; |
| 1376 isPartOf = true; | 1376 isPartOf = true; |
| 1377 } | 1377 } |
| 1378 | 1378 |
| 1379 @override | 1379 @override |
| 1380 UnlinkedParamBuilder visitSimpleFormalParameter(SimpleFormalParameter node) { | 1380 UnlinkedParamBuilder visitSimpleFormalParameter(SimpleFormalParameter node) { |
| 1381 UnlinkedParamBuilder b = serializeParameter(node); | 1381 UnlinkedParamBuilder b = serializeParameter(node); |
| 1382 b.type = serializeTypeName(node.type); | 1382 b.type = serializeTypeName(node.type); |
| 1383 return b; | 1383 return b; |
| 1384 } | 1384 } |
| 1385 | 1385 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1421 /** | 1421 /** |
| 1422 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. | 1422 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. |
| 1423 */ | 1423 */ |
| 1424 class _TypeParameterScope extends _Scope { | 1424 class _TypeParameterScope extends _Scope { |
| 1425 /** | 1425 /** |
| 1426 * Get the number of [_ScopedTypeParameter]s defined in this | 1426 * Get the number of [_ScopedTypeParameter]s defined in this |
| 1427 * [_TypeParameterScope]. | 1427 * [_TypeParameterScope]. |
| 1428 */ | 1428 */ |
| 1429 int get length => _definedNames.length; | 1429 int get length => _definedNames.length; |
| 1430 } | 1430 } |
| OLD | NEW |