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 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 * values are the indices of those local functions relative to their siblings. | 703 * values are the indices of those local functions relative to their siblings. |
704 */ | 704 */ |
705 Map<int, int> serializeFunctionBody( | 705 Map<int, int> serializeFunctionBody( |
706 UnlinkedExecutableBuilder b, | 706 UnlinkedExecutableBuilder b, |
707 List<ConstructorInitializer> initializers, | 707 List<ConstructorInitializer> initializers, |
708 AstNode body, | 708 AstNode body, |
709 bool serializeBodyExpr, | 709 bool serializeBodyExpr, |
710 bool serializeBody) { | 710 bool serializeBody) { |
711 if (body is BlockFunctionBody || body is ExpressionFunctionBody) { | 711 if (body is BlockFunctionBody || body is ExpressionFunctionBody) { |
712 for (UnlinkedParamBuilder parameter in b.parameters) { | 712 for (UnlinkedParamBuilder parameter in b.parameters) { |
713 parameter.visibleOffset = body.offset; | 713 if (!parameter.isInitializingFormal) { |
714 parameter.visibleLength = body.length; | 714 parameter.visibleOffset = body.offset; |
| 715 parameter.visibleLength = body.length; |
| 716 } |
715 } | 717 } |
716 } | 718 } |
717 List<UnlinkedExecutableBuilder> oldExecutables = executables; | 719 List<UnlinkedExecutableBuilder> oldExecutables = executables; |
718 List<UnlinkedLabelBuilder> oldLabels = labels; | 720 List<UnlinkedLabelBuilder> oldLabels = labels; |
719 List<UnlinkedVariableBuilder> oldVariables = variables; | 721 List<UnlinkedVariableBuilder> oldVariables = variables; |
720 Map<int, int> oldLocalClosureIndexMap = _localClosureIndexMap; | 722 Map<int, int> oldLocalClosureIndexMap = _localClosureIndexMap; |
721 bool oldSerializeClosureBodyExprs = _serializeClosureBodyExprs; | 723 bool oldSerializeClosureBodyExprs = _serializeClosureBodyExprs; |
722 executables = <UnlinkedExecutableBuilder>[]; | 724 executables = <UnlinkedExecutableBuilder>[]; |
723 labels = <UnlinkedLabelBuilder>[]; | 725 labels = <UnlinkedLabelBuilder>[]; |
724 variables = <UnlinkedVariableBuilder>[]; | 726 variables = <UnlinkedVariableBuilder>[]; |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1415 /** | 1417 /** |
1416 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. | 1418 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. |
1417 */ | 1419 */ |
1418 class _TypeParameterScope extends _Scope { | 1420 class _TypeParameterScope extends _Scope { |
1419 /** | 1421 /** |
1420 * Get the number of [_ScopedTypeParameter]s defined in this | 1422 * Get the number of [_ScopedTypeParameter]s defined in this |
1421 * [_TypeParameterScope]. | 1423 * [_TypeParameterScope]. |
1422 */ | 1424 */ |
1423 int get length => _definedNames.length; | 1425 int get length => _definedNames.length; |
1424 } | 1426 } |
OLD | NEW |