| 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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 if (isGetter) { | 570 if (isGetter) { |
| 571 b.kind = UnlinkedExecutableKind.getter; | 571 b.kind = UnlinkedExecutableKind.getter; |
| 572 } else if (isSetter) { | 572 } else if (isSetter) { |
| 573 b.kind = UnlinkedExecutableKind.setter; | 573 b.kind = UnlinkedExecutableKind.setter; |
| 574 nameString = '$nameString='; | 574 nameString = '$nameString='; |
| 575 } else { | 575 } else { |
| 576 b.kind = UnlinkedExecutableKind.functionOrMethod; | 576 b.kind = UnlinkedExecutableKind.functionOrMethod; |
| 577 } | 577 } |
| 578 b.isExternal = isExternal; | 578 b.isExternal = isExternal; |
| 579 b.isAbstract = !isExternal && body is EmptyFunctionBody; | 579 b.isAbstract = !isExternal && body is EmptyFunctionBody; |
| 580 b.isAsynchronous = body.isAsynchronous; |
| 581 b.isGenerator = body.isGenerator; |
| 580 b.name = nameString; | 582 b.name = nameString; |
| 581 b.nameOffset = nameOffset; | 583 b.nameOffset = nameOffset; |
| 582 b.typeParameters = | 584 b.typeParameters = |
| 583 serializeTypeParameters(typeParameters, typeParameterScope); | 585 serializeTypeParameters(typeParameters, typeParameterScope); |
| 584 if (!isTopLevel) { | 586 if (!isTopLevel) { |
| 585 b.isStatic = isDeclaredStatic; | 587 b.isStatic = isDeclaredStatic; |
| 586 } | 588 } |
| 587 b.returnType = serializeTypeName(returnType); | 589 b.returnType = serializeTypeName(returnType); |
| 588 bool isSemanticallyStatic = isTopLevel || isDeclaredStatic; | 590 bool isSemanticallyStatic = isTopLevel || isDeclaredStatic; |
| 589 if (formalParameters != null) { | 591 if (formalParameters != null) { |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1278 /** | 1280 /** |
| 1279 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. | 1281 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. |
| 1280 */ | 1282 */ |
| 1281 class _TypeParameterScope extends _Scope { | 1283 class _TypeParameterScope extends _Scope { |
| 1282 /** | 1284 /** |
| 1283 * Get the number of [_ScopedTypeParameter]s defined in this | 1285 * Get the number of [_ScopedTypeParameter]s defined in this |
| 1284 * [_TypeParameterScope]. | 1286 * [_TypeParameterScope]. |
| 1285 */ | 1287 */ |
| 1286 int get length => _definedNames.length; | 1288 int get length => _definedNames.length; |
| 1287 } | 1289 } |
| OLD | NEW |