OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 summary_resynthesizer; | 5 library summary_resynthesizer; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
(...skipping 2349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2360 parameterElement.parameters = subParameters; | 2360 parameterElement.parameters = subParameters; |
2361 parameterTypeElement.shareParameters(subParameters); | 2361 parameterTypeElement.shareParameters(subParameters); |
2362 } | 2362 } |
2363 parameterTypeElement.returnType = | 2363 parameterTypeElement.returnType = |
2364 buildType(serializedParameter.type, _currentTypeParameterizedElement); | 2364 buildType(serializedParameter.type, _currentTypeParameterizedElement); |
2365 parameterElement.type = new FunctionTypeImpl.elementWithNameAndArgs( | 2365 parameterElement.type = new FunctionTypeImpl.elementWithNameAndArgs( |
2366 parameterTypeElement, null, getCurrentTypeArguments(), false); | 2366 parameterTypeElement, null, getCurrentTypeArguments(), false); |
2367 parameterTypeElement.type = parameterElement.type; | 2367 parameterTypeElement.type = parameterElement.type; |
2368 } | 2368 } |
2369 buildVariableInitializer(parameterElement, serializedParameter.initializer); | 2369 buildVariableInitializer(parameterElement, serializedParameter.initializer); |
2370 switch (serializedParameter.kind) { | |
2371 case UnlinkedParamKind.named: | |
2372 parameterElement.parameterKind = ParameterKind.NAMED; | |
2373 break; | |
2374 case UnlinkedParamKind.positional: | |
2375 parameterElement.parameterKind = ParameterKind.POSITIONAL; | |
2376 break; | |
2377 case UnlinkedParamKind.required: | |
2378 parameterElement.parameterKind = ParameterKind.REQUIRED; | |
2379 break; | |
2380 } | |
2381 return parameterElement; | 2370 return parameterElement; |
2382 } | 2371 } |
2383 | 2372 |
2384 /** | 2373 /** |
2385 * Handle the parts that are common to top level variables and fields. | 2374 * Handle the parts that are common to top level variables and fields. |
2386 */ | 2375 */ |
2387 void buildPropertyIntroducingElementCommonParts( | 2376 void buildPropertyIntroducingElementCommonParts( |
2388 PropertyInducingElementImpl element, | 2377 PropertyInducingElementImpl element, |
2389 UnlinkedVariable serializedVariable) { | 2378 UnlinkedVariable serializedVariable) { |
2390 buildVariableCommonParts(element, serializedVariable); | 2379 buildVariableCommonParts(element, serializedVariable); |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2926 static String _getElementIdentifier(String name, ReferenceKind kind) { | 2915 static String _getElementIdentifier(String name, ReferenceKind kind) { |
2927 if (kind == ReferenceKind.topLevelPropertyAccessor || | 2916 if (kind == ReferenceKind.topLevelPropertyAccessor || |
2928 kind == ReferenceKind.propertyAccessor) { | 2917 kind == ReferenceKind.propertyAccessor) { |
2929 if (!name.endsWith('=')) { | 2918 if (!name.endsWith('=')) { |
2930 return name + '?'; | 2919 return name + '?'; |
2931 } | 2920 } |
2932 } | 2921 } |
2933 return name; | 2922 return name; |
2934 } | 2923 } |
2935 } | 2924 } |
OLD | NEW |