| 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 fasta.body_builder; | 5 library fasta.body_builder; |
| 6 | 6 |
| 7 import 'package:kernel/ast.dart' | 7 import 'package:kernel/ast.dart' |
| 8 hide InvalidExpression, InvalidInitializer, InvalidStatement; | 8 hide InvalidExpression, InvalidInitializer, InvalidStatement; |
| 9 | 9 |
| 10 import 'package:kernel/class_hierarchy.dart' show ClassHierarchy; | 10 import 'package:kernel/class_hierarchy.dart' show ClassHierarchy; |
| (...skipping 3119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3130 Statement deprecated_buildCompileTimeErrorStatement(error, | 3130 Statement deprecated_buildCompileTimeErrorStatement(error, |
| 3131 [int charOffset = -1]) { | 3131 [int charOffset = -1]) { |
| 3132 return new KernelExpressionStatement( | 3132 return new KernelExpressionStatement( |
| 3133 deprecated_buildCompileTimeError(error, charOffset)); | 3133 deprecated_buildCompileTimeError(error, charOffset)); |
| 3134 } | 3134 } |
| 3135 | 3135 |
| 3136 @override | 3136 @override |
| 3137 Initializer buildInvalidInitializer(Expression expression, | 3137 Initializer buildInvalidInitializer(Expression expression, |
| 3138 [int charOffset = -1]) { | 3138 [int charOffset = -1]) { |
| 3139 needsImplicitSuperInitializer = false; | 3139 needsImplicitSuperInitializer = false; |
| 3140 return new LocalInitializer(new VariableDeclaration.forValue(expression)) | 3140 return new KernelInvalidInitializer( |
| 3141 new VariableDeclaration.forValue(expression)) |
| 3141 ..fileOffset = charOffset; | 3142 ..fileOffset = charOffset; |
| 3142 } | 3143 } |
| 3143 | 3144 |
| 3144 Initializer buildDuplicatedInitializer( | 3145 Initializer buildDuplicatedInitializer( |
| 3145 String name, int offset, int previousInitializerOffset) { | 3146 String name, int offset, int previousInitializerOffset) { |
| 3146 Initializer initializer = buildInvalidInitializer( | 3147 Initializer initializer = buildInvalidInitializer( |
| 3147 deprecated_buildCompileTimeError( | 3148 deprecated_buildCompileTimeError( |
| 3148 "'$name' has already been initialized.", offset), | 3149 "'$name' has already been initialized.", offset), |
| 3149 offset); | 3150 offset); |
| 3150 deprecated_addCompileTimeError( | 3151 deprecated_addCompileTimeError( |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3801 return AsyncMarker.Async; | 3802 return AsyncMarker.Async; |
| 3802 } else { | 3803 } else { |
| 3803 assert(identical(starToken.stringValue, "*")); | 3804 assert(identical(starToken.stringValue, "*")); |
| 3804 return AsyncMarker.AsyncStar; | 3805 return AsyncMarker.AsyncStar; |
| 3805 } | 3806 } |
| 3806 } else { | 3807 } else { |
| 3807 return unhandled(asyncToken.lexeme, "asyncMarkerFromTokens", | 3808 return unhandled(asyncToken.lexeme, "asyncMarkerFromTokens", |
| 3808 asyncToken.charOffset, null); | 3809 asyncToken.charOffset, null); |
| 3809 } | 3810 } |
| 3810 } | 3811 } |
| OLD | NEW |