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

Unified Diff: pkg/analyzer/lib/src/summary/resynthesize.dart

Issue 2508343002: Rename UnlinkedConst -> UnlinkedExpr (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | pkg/analyzer/lib/src/summary/summarize_ast.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/resynthesize.dart
diff --git a/pkg/analyzer/lib/src/summary/resynthesize.dart b/pkg/analyzer/lib/src/summary/resynthesize.dart
index 6ac3030b40d2a10865a579d04bcdf0e42f5118a3..30f0aec60f5e31776ac94a14f111b5b850eebdd5 100644
--- a/pkg/analyzer/lib/src/summary/resynthesize.dart
+++ b/pkg/analyzer/lib/src/summary/resynthesize.dart
@@ -301,12 +301,12 @@ abstract class SummaryResynthesizer extends ElementResynthesizer {
}
/**
- * Builder of [Expression]s from [UnlinkedConst]s.
+ * Builder of [Expression]s from [UnlinkedExpr]s.
*/
class _ConstExprBuilder {
final _UnitResynthesizer resynthesizer;
final ElementImpl context;
- final UnlinkedConst uc;
+ final UnlinkedExpr uc;
int intPtr = 0;
int doublePtr = 0;
@@ -333,24 +333,24 @@ class _ConstExprBuilder {
if (!uc.isValidConst) {
return AstFactory.identifier3(r'$$invalidConstExpr$$');
}
- for (UnlinkedConstOperation operation in uc.operations) {
+ for (UnlinkedExprOperation operation in uc.operations) {
switch (operation) {
- case UnlinkedConstOperation.pushNull:
+ case UnlinkedExprOperation.pushNull:
_push(AstFactory.nullLiteral());
break;
// bool
- case UnlinkedConstOperation.pushFalse:
+ case UnlinkedExprOperation.pushFalse:
_push(AstFactory.booleanLiteral(false));
break;
- case UnlinkedConstOperation.pushTrue:
+ case UnlinkedExprOperation.pushTrue:
_push(AstFactory.booleanLiteral(true));
break;
// literals
- case UnlinkedConstOperation.pushInt:
+ case UnlinkedExprOperation.pushInt:
int value = uc.ints[intPtr++];
_push(AstFactory.integer(value));
break;
- case UnlinkedConstOperation.pushLongInt:
+ case UnlinkedExprOperation.pushLongInt:
int value = 0;
int count = uc.ints[intPtr++];
for (int i = 0; i < count; i++) {
@@ -359,20 +359,20 @@ class _ConstExprBuilder {
}
_push(AstFactory.integer(value));
break;
- case UnlinkedConstOperation.pushDouble:
+ case UnlinkedExprOperation.pushDouble:
double value = uc.doubles[doublePtr++];
_push(AstFactory.doubleLiteral(value));
break;
- case UnlinkedConstOperation.makeSymbol:
+ case UnlinkedExprOperation.makeSymbol:
String component = uc.strings[stringPtr++];
_push(AstFactory.symbolLiteral([component]));
break;
// String
- case UnlinkedConstOperation.pushString:
+ case UnlinkedExprOperation.pushString:
String value = uc.strings[stringPtr++];
_push(AstFactory.string2(value));
break;
- case UnlinkedConstOperation.concatenate:
+ case UnlinkedExprOperation.concatenate:
int count = uc.ints[intPtr++];
List<InterpolationElement> elements = <InterpolationElement>[];
for (int i = 0; i < count; i++) {
@@ -383,75 +383,75 @@ class _ConstExprBuilder {
_push(AstFactory.string(elements));
break;
// binary
- case UnlinkedConstOperation.equal:
+ case UnlinkedExprOperation.equal:
_pushBinary(TokenType.EQ_EQ);
break;
- case UnlinkedConstOperation.notEqual:
+ case UnlinkedExprOperation.notEqual:
_pushBinary(TokenType.BANG_EQ);
break;
- case UnlinkedConstOperation.and:
+ case UnlinkedExprOperation.and:
_pushBinary(TokenType.AMPERSAND_AMPERSAND);
break;
- case UnlinkedConstOperation.or:
+ case UnlinkedExprOperation.or:
_pushBinary(TokenType.BAR_BAR);
break;
- case UnlinkedConstOperation.bitXor:
+ case UnlinkedExprOperation.bitXor:
_pushBinary(TokenType.CARET);
break;
- case UnlinkedConstOperation.bitAnd:
+ case UnlinkedExprOperation.bitAnd:
_pushBinary(TokenType.AMPERSAND);
break;
- case UnlinkedConstOperation.bitOr:
+ case UnlinkedExprOperation.bitOr:
_pushBinary(TokenType.BAR);
break;
- case UnlinkedConstOperation.bitShiftLeft:
+ case UnlinkedExprOperation.bitShiftLeft:
_pushBinary(TokenType.LT_LT);
break;
- case UnlinkedConstOperation.bitShiftRight:
+ case UnlinkedExprOperation.bitShiftRight:
_pushBinary(TokenType.GT_GT);
break;
- case UnlinkedConstOperation.add:
+ case UnlinkedExprOperation.add:
_pushBinary(TokenType.PLUS);
break;
- case UnlinkedConstOperation.subtract:
+ case UnlinkedExprOperation.subtract:
_pushBinary(TokenType.MINUS);
break;
- case UnlinkedConstOperation.multiply:
+ case UnlinkedExprOperation.multiply:
_pushBinary(TokenType.STAR);
break;
- case UnlinkedConstOperation.divide:
+ case UnlinkedExprOperation.divide:
_pushBinary(TokenType.SLASH);
break;
- case UnlinkedConstOperation.floorDivide:
+ case UnlinkedExprOperation.floorDivide:
_pushBinary(TokenType.TILDE_SLASH);
break;
- case UnlinkedConstOperation.modulo:
+ case UnlinkedExprOperation.modulo:
_pushBinary(TokenType.PERCENT);
break;
- case UnlinkedConstOperation.greater:
+ case UnlinkedExprOperation.greater:
_pushBinary(TokenType.GT);
break;
- case UnlinkedConstOperation.greaterEqual:
+ case UnlinkedExprOperation.greaterEqual:
_pushBinary(TokenType.GT_EQ);
break;
- case UnlinkedConstOperation.less:
+ case UnlinkedExprOperation.less:
_pushBinary(TokenType.LT);
break;
- case UnlinkedConstOperation.lessEqual:
+ case UnlinkedExprOperation.lessEqual:
_pushBinary(TokenType.LT_EQ);
break;
// prefix
- case UnlinkedConstOperation.complement:
+ case UnlinkedExprOperation.complement:
_pushPrefix(TokenType.TILDE);
break;
- case UnlinkedConstOperation.negate:
+ case UnlinkedExprOperation.negate:
_pushPrefix(TokenType.MINUS);
break;
- case UnlinkedConstOperation.not:
+ case UnlinkedExprOperation.not:
_pushPrefix(TokenType.BANG);
break;
// conditional
- case UnlinkedConstOperation.conditional:
+ case UnlinkedExprOperation.conditional:
Expression elseExpr = _pop();
Expression thenExpr = _pop();
Expression condition = _pop();
@@ -459,35 +459,35 @@ class _ConstExprBuilder {
AstFactory.conditionalExpression(condition, thenExpr, elseExpr));
break;
// invokeMethodRef
- case UnlinkedConstOperation.invokeMethodRef:
+ case UnlinkedExprOperation.invokeMethodRef:
_pushInvokeMethodRef();
break;
// containers
- case UnlinkedConstOperation.makeUntypedList:
+ case UnlinkedExprOperation.makeUntypedList:
_pushList(null);
break;
- case UnlinkedConstOperation.makeTypedList:
+ case UnlinkedExprOperation.makeTypedList:
TypeName itemType = _newTypeName();
_pushList(AstFactory.typeArgumentList(<TypeName>[itemType]));
break;
- case UnlinkedConstOperation.makeUntypedMap:
+ case UnlinkedExprOperation.makeUntypedMap:
_pushMap(null);
break;
- case UnlinkedConstOperation.makeTypedMap:
+ case UnlinkedExprOperation.makeTypedMap:
TypeName keyType = _newTypeName();
TypeName valueType = _newTypeName();
_pushMap(AstFactory.typeArgumentList(<TypeName>[keyType, valueType]));
break;
- case UnlinkedConstOperation.pushReference:
+ case UnlinkedExprOperation.pushReference:
_pushReference();
break;
- case UnlinkedConstOperation.extractProperty:
+ case UnlinkedExprOperation.extractProperty:
_pushExtractProperty();
break;
- case UnlinkedConstOperation.invokeConstructor:
+ case UnlinkedExprOperation.invokeConstructor:
_pushInstanceCreation();
break;
- case UnlinkedConstOperation.pushParameter:
+ case UnlinkedExprOperation.pushParameter:
String name = uc.strings[stringPtr++];
SimpleIdentifier identifier = AstFactory.identifier3(name);
identifier.staticElement = _enclosingConstructor.parameters
@@ -496,17 +496,17 @@ class _ConstExprBuilder {
'Unable to resolve constructor parameter: $name'));
_push(identifier);
break;
- case UnlinkedConstOperation.assignToRef:
- case UnlinkedConstOperation.assignToProperty:
- case UnlinkedConstOperation.assignToIndex:
- case UnlinkedConstOperation.extractIndex:
- case UnlinkedConstOperation.invokeMethod:
- case UnlinkedConstOperation.cascadeSectionBegin:
- case UnlinkedConstOperation.cascadeSectionEnd:
- case UnlinkedConstOperation.typeCast:
- case UnlinkedConstOperation.typeCheck:
- case UnlinkedConstOperation.throwException:
- case UnlinkedConstOperation.pushLocalFunctionReference:
+ case UnlinkedExprOperation.assignToRef:
+ case UnlinkedExprOperation.assignToProperty:
+ case UnlinkedExprOperation.assignToIndex:
+ case UnlinkedExprOperation.extractIndex:
+ case UnlinkedExprOperation.invokeMethod:
+ case UnlinkedExprOperation.cascadeSectionBegin:
+ case UnlinkedExprOperation.cascadeSectionEnd:
+ case UnlinkedExprOperation.typeCast:
+ case UnlinkedExprOperation.typeCheck:
+ case UnlinkedExprOperation.throwException:
+ case UnlinkedExprOperation.pushLocalFunctionReference:
throw new UnimplementedError(
'Unexpected $operation in a constant expression.');
}
@@ -1370,12 +1370,12 @@ class _ResynthesizerContext implements ResynthesizerContext {
_ResynthesizerContext(this._unitResynthesizer);
@override
- ElementAnnotationImpl buildAnnotation(ElementImpl context, UnlinkedConst uc) {
+ ElementAnnotationImpl buildAnnotation(ElementImpl context, UnlinkedExpr uc) {
return _unitResynthesizer.buildAnnotation(context, uc);
}
@override
- Expression buildExpression(ElementImpl context, UnlinkedConst uc) {
+ Expression buildExpression(ElementImpl context, UnlinkedExpr uc) {
return _unitResynthesizer._buildConstExpression(context, uc);
}
@@ -1507,9 +1507,9 @@ class _UnitResynthesizer {
TypeProvider get typeProvider => summaryResynthesizer.typeProvider;
/**
- * Build [ElementAnnotationImpl] for the given [UnlinkedConst].
+ * Build [ElementAnnotationImpl] for the given [UnlinkedExpr].
*/
- ElementAnnotationImpl buildAnnotation(ElementImpl context, UnlinkedConst uc) {
+ ElementAnnotationImpl buildAnnotation(ElementImpl context, UnlinkedExpr uc) {
ElementAnnotationImpl elementAnnotation = new ElementAnnotationImpl(unit);
Expression constExpr = _buildConstExpression(context, uc);
if (constExpr is Identifier) {
@@ -1804,7 +1804,7 @@ class _UnitResynthesizer {
return result;
}
- Expression _buildConstExpression(ElementImpl context, UnlinkedConst uc) {
+ Expression _buildConstExpression(ElementImpl context, UnlinkedExpr uc) {
return new _ConstExprBuilder(this, context, uc).build();
}
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | pkg/analyzer/lib/src/summary/summarize_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698