| 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 library kernel.analyzer.ast_from_analyzer; | 4 library kernel.analyzer.ast_from_analyzer; |
| 5 | 5 |
| 6 import '../ast.dart' as ast; | 6 import '../ast.dart' as ast; |
| 7 import '../frontend/accessors.dart'; | 7 import '../frontend/accessors.dart'; |
| 8 import '../frontend/super_initializers.dart'; | 8 import '../frontend/super_initializers.dart'; |
| 9 import '../log.dart'; | 9 import '../log.dart'; |
| 10 import '../type_algebra.dart'; | 10 import '../type_algebra.dart'; |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 positional.add(declaration); | 567 positional.add(declaration); |
| 568 break; | 568 break; |
| 569 | 569 |
| 570 case ParameterKind.NAMED: | 570 case ParameterKind.NAMED: |
| 571 named.add(declaration); | 571 named.add(declaration); |
| 572 break; | 572 break; |
| 573 } | 573 } |
| 574 } | 574 } |
| 575 int offset = formalParameters?.offset ?? body.offset; | 575 int offset = formalParameters?.offset ?? body.offset; |
| 576 int endOffset = body.endToken.offset; | 576 int endOffset = body.endToken.offset; |
| 577 ast.AsyncMarker asyncMarker = getAsyncMarker( |
| 578 isAsync: body.isAsynchronous, isStar: body.isGenerator); |
| 577 return new ast.FunctionNode(buildOptionalFunctionBody(body), | 579 return new ast.FunctionNode(buildOptionalFunctionBody(body), |
| 578 typeParameters: typeParameters, | 580 typeParameters: typeParameters, |
| 579 positionalParameters: positional, | 581 positionalParameters: positional, |
| 580 namedParameters: named, | 582 namedParameters: named, |
| 581 requiredParameterCount: requiredParameterCount, | 583 requiredParameterCount: requiredParameterCount, |
| 582 returnType: buildOptionalTypeAnnotation(returnType) ?? | 584 returnType: buildOptionalTypeAnnotation(returnType) ?? |
| 583 inferredReturnType ?? | 585 inferredReturnType ?? |
| 584 const ast.DynamicType(), | 586 const ast.DynamicType(), |
| 585 asyncMarker: getAsyncMarker( | 587 asyncMarker: asyncMarker, |
| 586 isAsync: body.isAsynchronous, isStar: body.isGenerator)) | 588 dartAsyncMarker: asyncMarker) |
| 587 ..fileOffset = offset | 589 ..fileOffset = offset |
| 588 ..fileEndOffset = endOffset; | 590 ..fileEndOffset = endOffset; |
| 589 } | 591 } |
| 590 | 592 |
| 591 ast.Expression buildOptionalTopLevelExpression(Expression node) { | 593 ast.Expression buildOptionalTopLevelExpression(Expression node) { |
| 592 return node == null ? null : buildTopLevelExpression(node); | 594 return node == null ? null : buildTopLevelExpression(node); |
| 593 } | 595 } |
| 594 | 596 |
| 595 ast.Expression buildTopLevelExpression(Expression node) { | 597 ast.Expression buildTopLevelExpression(Expression node) { |
| 596 try { | 598 try { |
| (...skipping 2442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3039 if (list[i - 1].compareTo(item) == 0) { | 3041 if (list[i - 1].compareTo(item) == 0) { |
| 3040 ++deleted; | 3042 ++deleted; |
| 3041 } else if (deleted > 0) { | 3043 } else if (deleted > 0) { |
| 3042 list[i - deleted] = item; | 3044 list[i - deleted] = item; |
| 3043 } | 3045 } |
| 3044 } | 3046 } |
| 3045 if (deleted > 0) { | 3047 if (deleted > 0) { |
| 3046 list.length -= deleted; | 3048 list.length -= deleted; |
| 3047 } | 3049 } |
| 3048 } | 3050 } |
| OLD | NEW |