Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/frontend_accessors.dart

Issue 2974933002: Remove deprecated_internalProblem. (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 /// A library to help transform compounds and null-aware accessors into 5 /// A library to help transform compounds and null-aware accessors into
6 /// let expressions. 6 /// let expressions.
7 7
8 import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart' 8 import 'package:kernel/ast.dart' hide MethodInvocation, InvalidExpression;
9
10 import '../../scanner/token.dart' show Token;
11
12 import '../names.dart' show equalsName, indexGetName, indexSetName;
13
14 import '../problems.dart' show unhandled;
15
16 import 'fasta_accessors.dart' show BuilderHelper;
17
18 import 'kernel_shadow_ast.dart'
9 show 19 show
10 KernelArguments, 20 KernelArguments,
11 KernelComplexAssignment, 21 KernelComplexAssignment,
12 KernelConditionalExpression, 22 KernelConditionalExpression,
13 KernelIllegalAssignment, 23 KernelIllegalAssignment,
14 KernelMethodInvocation, 24 KernelMethodInvocation,
15 KernelNullAwarePropertyGet, 25 KernelNullAwarePropertyGet,
16 KernelPropertyAssign, 26 KernelPropertyAssign,
17 KernelPropertyGet, 27 KernelPropertyGet,
18 KernelSuperMethodInvocation, 28 KernelSuperMethodInvocation,
19 KernelSuperPropertyGet, 29 KernelSuperPropertyGet,
20 KernelThisExpression, 30 KernelThisExpression,
21 KernelVariableDeclaration, 31 KernelVariableDeclaration,
22 KernelVariableGet; 32 KernelVariableGet;
23 33
24 import 'package:front_end/src/fasta/kernel/utils.dart' show offsetForToken; 34 import 'utils.dart' show offsetForToken;
25
26 import 'package:front_end/src/scanner/token.dart' show Token;
27
28 import 'package:front_end/src/fasta/kernel/fasta_accessors.dart'
29 show BuilderHelper;
30
31 import 'package:kernel/ast.dart' hide MethodInvocation, InvalidExpression;
32
33 import '../names.dart' show equalsName, indexGetName, indexSetName;
34
35 import '../deprecated_problems.dart' show deprecated_internalProblem;
36 35
37 /// An [Accessor] represents a subexpression for which we can't yet build a 36 /// An [Accessor] represents a subexpression for which we can't yet build a
38 /// kernel [Expression] because we don't yet know the context in which it is 37 /// kernel [Expression] because we don't yet know the context in which it is
39 /// used. 38 /// used.
40 /// 39 ///
41 /// Once the context is known, an [Accessor] can be converted into an 40 /// Once the context is known, an [Accessor] can be converted into an
42 /// [Expression] by calling a "build" method. 41 /// [Expression] by calling a "build" method.
43 /// 42 ///
44 /// For example, when building a kernel representation for `a[x] = b`, after 43 /// For example, when building a kernel representation for `a[x] = b`, after
45 /// parsing `a[x]` but before parsing `= b`, we don't yet know whether to 44 /// parsing `a[x]` but before parsing `= b`, we don't yet know whether to
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 return complexAssignment; 170 return complexAssignment;
172 } else { 171 } else {
173 return body; 172 return body;
174 } 173 }
175 } 174 }
176 175
177 /// Returns an [Expression] representing a compile-time error. 176 /// Returns an [Expression] representing a compile-time error.
178 /// 177 ///
179 /// At runtime, an exception will be thrown. 178 /// At runtime, an exception will be thrown.
180 makeInvalidRead() { 179 makeInvalidRead() {
181 return deprecated_internalProblem( 180 return unhandled("compile-time error", "$runtimeType",
182 "Unhandled compile-time error.", null, offsetForToken(token)); 181 offsetForToken(token), helper.uri);
183 } 182 }
184 183
185 /// Returns an [Expression] representing a compile-time error wrapping 184 /// Returns an [Expression] representing a compile-time error wrapping
186 /// [value]. 185 /// [value].
187 /// 186 ///
188 /// At runtime, [value] will be evaluated before throwing an exception. 187 /// At runtime, [value] will be evaluated before throwing an exception.
189 makeInvalidWrite(Expression value) { 188 makeInvalidWrite(Expression value) {
190 return deprecated_internalProblem( 189 return unhandled("compile-time error", "$runtimeType",
191 "Unhandled compile-time error.", null, offsetForToken(token)); 190 offsetForToken(token), helper.uri);
192 } 191 }
193 192
194 /// Creates a data structure for tracking the desugaring of a complex 193 /// Creates a data structure for tracking the desugaring of a complex
195 /// assignment expression whose right hand side is [rhs]. 194 /// assignment expression whose right hand side is [rhs].
196 KernelComplexAssignment startComplexAssignment(Expression rhs) => 195 KernelComplexAssignment startComplexAssignment(Expression rhs) =>
197 new KernelIllegalAssignment(rhs); 196 new KernelIllegalAssignment(rhs);
198 } 197 }
199 198
200 abstract class VariableAccessor extends Accessor { 199 abstract class VariableAccessor extends Accessor {
201 VariableDeclaration variable; 200 VariableDeclaration variable;
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 725
727 Expression buildIsNull(Expression value, int offset) { 726 Expression buildIsNull(Expression value, int offset) {
728 return makeBinary(value, equalsName, null, new NullLiteral(), offset: offset); 727 return makeBinary(value, equalsName, null, new NullLiteral(), offset: offset);
729 } 728 }
730 729
731 VariableDeclaration makeOrReuseVariable(Expression value) { 730 VariableDeclaration makeOrReuseVariable(Expression value) {
732 // TODO: Devise a way to remember if a variable declaration was reused 731 // TODO: Devise a way to remember if a variable declaration was reused
733 // or is fresh (hence needs a let binding). 732 // or is fresh (hence needs a let binding).
734 return new VariableDeclaration.forValue(value); 733 return new VariableDeclaration.forValue(value);
735 } 734 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698