Convert ShadowSyntheticExpression to SyntheticExpressionJudgment

Change-Id: I0b860415dbdf3f8fb2e3f21891259f0a6bb322f9
Reviewed-on: https://dart-review.googlesource.com/62124
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Paul Berry
2018-06-25 20:16:54 +00:00
committed by commit-bot@chromium.org
parent 2876623654
commit b29bde6232
5 changed files with 19 additions and 19 deletions
@@ -1192,7 +1192,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
isSetter: isSetter,
isStatic: isStatic,
isTopLevel: !isStatic && !isSuper);
return new ShadowSyntheticExpression(new Throw(error));
return new SyntheticExpressionJudgment(new Throw(error));
}
}
@@ -2898,7 +2898,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
} else if (b.isConstructor) {
initialTarget = b.target;
if (type.isAbstract) {
return new ShadowSyntheticExpression(evaluateArgumentsBefore(
return new SyntheticExpressionJudgment(evaluateArgumentsBefore(
arguments,
buildAbstractClassInstantiationError(
fasta.templateAbstractClassInstantiation
@@ -2920,7 +2920,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
"Cyclic definition of factory '${name}'.", nameToken.charOffset);
}
if (target is Constructor && target.enclosingClass.isAbstract) {
return new ShadowSyntheticExpression(evaluateArgumentsBefore(
return new SyntheticExpressionJudgment(evaluateArgumentsBefore(
arguments,
buildAbstractClassInstantiationError(
fasta.templateAbstractRedirectedClassInstantiation
@@ -3112,7 +3112,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
// This must have been a compile-time error.
assert(isErroneousNode(oldInitializer));
push(new ShadowSyntheticExpression(new Let(
push(new SyntheticExpressionJudgment(new Let(
new VariableDeclaration.forValue(oldInitializer)
..fileOffset = forest.readOffset(expression),
expression)
@@ -3231,7 +3231,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
}
VariableDeclaration variable;
bool declaresVariable = false;
ShadowSyntheticExpression syntheticAssignment;
SyntheticExpressionJudgment syntheticAssignment;
if (lvalue is VariableDeclaration) {
declaresVariable = true;
variable = lvalue;
@@ -3830,7 +3830,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
{List<LocatedMessage> context}) {
library.addCompileTimeError(message, charOffset, length, uri,
wasHandled: true, context: context);
return new ShadowSyntheticExpression(library.loader
return new SyntheticExpressionJudgment(library.loader
.throwCompileConstantError(library.loader
.buildCompileTimeError(message, charOffset, length, uri)));
}
@@ -3847,7 +3847,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
{List<LocatedMessage> context}) {
// TODO(askesc): Produce explicit error expression wrapping the original.
// See [issue 29717](https://github.com/dart-lang/sdk/issues/29717)
return new ShadowSyntheticExpression(new Let(
return new SyntheticExpressionJudgment(new Let(
new VariableDeclaration.forValue(buildCompileTimeError(
message.messageObject, message.charOffset, message.length,
context: context))
@@ -99,7 +99,7 @@ import 'kernel_shadow_ast.dart'
StringConcatenationJudgment,
StringLiteralJudgment,
SymbolLiteralJudgment,
ShadowSyntheticExpression,
SyntheticExpressionJudgment,
TryCatchJudgment,
TryFinallyJudgment,
WhileJudgment,
@@ -599,8 +599,8 @@ class Fangorn extends Forest {
VariableDeclaration variable = node;
node = variable.initializer;
}
if (node is ShadowSyntheticExpression) {
ShadowSyntheticExpression synth = node;
if (node is SyntheticExpressionJudgment) {
SyntheticExpressionJudgment synth = node;
node = synth.desugared;
}
if (node is Let) {
@@ -105,7 +105,7 @@ export 'kernel_shadow_ast.dart'
SuperPropertyGetJudgment,
SwitchCaseJudgment,
SwitchStatementJudgment,
ShadowSyntheticExpression,
SyntheticExpressionJudgment,
VariableAssignmentJudgment,
VariableDeclarationJudgment,
VariableGetJudgment,
@@ -85,7 +85,7 @@ import 'kernel_ast_api.dart'
SuperMethodInvocationJudgment,
SuperPropertyGetJudgment,
VariableAssignmentJudgment,
ShadowSyntheticExpression,
SyntheticExpressionJudgment,
VariableDeclarationJudgment,
VariableGetJudgment,
StaticSet,
@@ -1222,7 +1222,7 @@ class KernelTypeUseGenerator extends KernelReadOnlyAccessGenerator
KernelInvalidTypeBuilder declaration = this.declaration;
helper.addProblemErrorIfConst(
declaration.message.messageObject, offset, token.length);
super.expression = new ShadowSyntheticExpression(
super.expression = new SyntheticExpressionJudgment(
new Throw(forest.literalString(declaration.message.message, token))
..fileOffset = offset);
} else {
@@ -504,7 +504,7 @@ class ShadowClass extends Class {
///
/// TODO(paulberry): once we know exactly what constitutes a "complex
/// assignment", document it here.
abstract class ComplexAssignmentJudgment extends ShadowSyntheticExpression {
abstract class ComplexAssignmentJudgment extends SyntheticExpressionJudgment {
/// In a compound assignment, the expression that reads the old value, or
/// `null` if this is not a compound assignment.
Expression read;
@@ -1167,7 +1167,7 @@ class ForInJudgment extends ForInStatement implements StatementJudgment {
final bool _declaresVariable;
final ShadowSyntheticExpression _syntheticAssignment;
final SyntheticExpressionJudgment _syntheticAssignment;
ForInJudgment(
this.awaitKeyword,
@@ -1269,7 +1269,7 @@ class ForInJudgment extends ForInStatement implements StatementJudgment {
variable.initializer = implicitDowncast..parent = variable;
body = combineStatements(variable, body)..parent = this;
}
} else if (syntheticAssignment is ShadowSyntheticExpression) {
} else if (syntheticAssignment is SyntheticExpressionJudgment) {
if (syntheticAssignment is ComplexAssignmentJudgment) {
inferrer.ensureAssignable(
greatestClosure(inferrer.coreTypes, syntheticWriteType),
@@ -1341,7 +1341,7 @@ class ForInJudgment extends ForInStatement implements StatementJudgment {
null,
syntheticWrite.target);
} else if (syntheticWrite == null ||
syntheticWrite is ShadowSyntheticExpression) {
syntheticWrite is SyntheticExpressionJudgment) {
inferrer.listener.forInStatement(
this,
fileOffset,
@@ -2873,10 +2873,10 @@ class SymbolLiteralJudgment extends SymbolLiteral
///
/// These expressions are removed by type inference and replaced with their
/// desugared equivalents.
class ShadowSyntheticExpression extends Let implements ExpressionJudgment {
class SyntheticExpressionJudgment extends Let implements ExpressionJudgment {
DartType inferredType;
ShadowSyntheticExpression(Expression desugared)
SyntheticExpressionJudgment(Expression desugared)
: super(new VariableDeclaration('_', initializer: new NullLiteral()),
desugared);