| 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/visitor.dart'; | 8 import 'package:analyzer/dart/ast/visitor.dart'; |
| 9 import 'package:analyzer/src/generated/scanner.dart'; | 9 import 'package:analyzer/src/generated/scanner.dart'; |
| 10 import 'package:analyzer/src/generated/utilities_dart.dart'; | 10 import 'package:analyzer/src/generated/utilities_dart.dart'; |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 } | 537 } |
| 538 b.visibleOffset = enclosingBlock?.offset; | 538 b.visibleOffset = enclosingBlock?.offset; |
| 539 b.visibleLength = enclosingBlock?.length; | 539 b.visibleLength = enclosingBlock?.length; |
| 540 serializeFunctionBody(b, body); | 540 serializeFunctionBody(b, body); |
| 541 scopes.removeLast(); | 541 scopes.removeLast(); |
| 542 assert(scopes.length == oldScopesLength); | 542 assert(scopes.length == oldScopesLength); |
| 543 return b; | 543 return b; |
| 544 } | 544 } |
| 545 | 545 |
| 546 void serializeFunctionBody(UnlinkedExecutableBuilder b, FunctionBody body) { | 546 void serializeFunctionBody(UnlinkedExecutableBuilder b, FunctionBody body) { |
| 547 for (UnlinkedParamBuilder parameter in b.parameters) { |
| 548 parameter.visibleOffset = body.offset; |
| 549 parameter.visibleLength = body.length; |
| 550 } |
| 547 List<UnlinkedExecutableBuilder> oldExecutables = executables; | 551 List<UnlinkedExecutableBuilder> oldExecutables = executables; |
| 548 List<UnlinkedVariableBuilder> oldVariables = variables; | 552 List<UnlinkedVariableBuilder> oldVariables = variables; |
| 549 executables = <UnlinkedExecutableBuilder>[]; | 553 executables = <UnlinkedExecutableBuilder>[]; |
| 550 variables = <UnlinkedVariableBuilder>[]; | 554 variables = <UnlinkedVariableBuilder>[]; |
| 551 body.accept(this); | 555 body.accept(this); |
| 552 b.localFunctions = executables; | 556 b.localFunctions = executables; |
| 553 b.localVariables = variables; | 557 b.localVariables = variables; |
| 554 executables = oldExecutables; | 558 executables = oldExecutables; |
| 555 variables = oldVariables; | 559 variables = oldVariables; |
| 556 } | 560 } |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1055 /** | 1059 /** |
| 1056 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. | 1060 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. |
| 1057 */ | 1061 */ |
| 1058 class _TypeParameterScope extends _Scope { | 1062 class _TypeParameterScope extends _Scope { |
| 1059 /** | 1063 /** |
| 1060 * Get the number of [_ScopedTypeParameter]s defined in this | 1064 * Get the number of [_ScopedTypeParameter]s defined in this |
| 1061 * [_TypeParameterScope]. | 1065 * [_TypeParameterScope]. |
| 1062 */ | 1066 */ |
| 1063 int get length => _definedNames.length; | 1067 int get length => _definedNames.length; |
| 1064 } | 1068 } |
| OLD | NEW |