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

Unified Diff: pkg/analyzer/lib/src/generated/parser.dart

Issue 1918923003: Remove unnecessary casts and general code clean-up (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/generated/parser.dart
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
index ce18325b6a751cd8913928d9b17e02c6f3492e7d..425020c72efdee4314e959f2b796d0355e21e57a 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -4465,21 +4465,24 @@ class Parser {
while (_isLikelyArgumentList()) {
TypeArgumentList typeArguments = _parseOptionalTypeArguments();
ArgumentList argumentList = parseArgumentList();
- if (expression is SimpleIdentifier) {
- expression = new MethodInvocation(null, null,
- expression as SimpleIdentifier, typeArguments, argumentList);
- } else if (expression is PrefixedIdentifier) {
- PrefixedIdentifier identifier = expression as PrefixedIdentifier;
+ Expression currentExpression = expression;
+ if (currentExpression is SimpleIdentifier) {
+ expression = new MethodInvocation(
+ null, null, currentExpression, typeArguments, argumentList);
+ } else if (currentExpression is PrefixedIdentifier) {
+ expression = new MethodInvocation(
+ currentExpression.prefix,
+ currentExpression.period,
+ currentExpression.identifier,
+ typeArguments,
+ argumentList);
+ } else if (currentExpression is PropertyAccess) {
expression = new MethodInvocation(
- identifier.prefix,
- identifier.period,
- identifier.identifier,
+ currentExpression.target,
+ currentExpression.operator,
+ currentExpression.propertyName,
typeArguments,
argumentList);
- } else if (expression is PropertyAccess) {
- PropertyAccess access = expression as PropertyAccess;
- expression = new MethodInvocation(access.target, access.operator,
- access.propertyName, typeArguments, argumentList);
} else {
expression = new FunctionExpressionInvocation(
expression, typeArguments, argumentList);
@@ -4701,12 +4704,13 @@ class Parser {
progress = true;
while (_isLikelyArgumentList()) {
TypeArgumentList typeArguments = _parseOptionalTypeArguments();
- if (expression is PropertyAccess) {
- PropertyAccess propertyAccess = expression as PropertyAccess;
+ Expression currentExpression = expression;
+ ;
scheglov 2016/04/25 19:14:44 Remove this?
Brian Wilkerson 2016/04/25 19:24:20 Done
+ if (currentExpression is PropertyAccess) {
expression = new MethodInvocation(
- propertyAccess.target,
- propertyAccess.operator,
- propertyAccess.propertyName,
+ currentExpression.target,
+ currentExpression.operator,
+ currentExpression.propertyName,
typeArguments,
parseArgumentList());
} else {
@@ -7330,10 +7334,14 @@ class Parser {
if (_isLikelyArgumentList()) {
TypeArgumentList typeArguments = _parseOptionalTypeArguments();
ArgumentList argumentList = parseArgumentList();
- if (operand is PropertyAccess) {
- PropertyAccess access = operand as PropertyAccess;
- operand = new MethodInvocation(access.target, access.operator,
- access.propertyName, typeArguments, argumentList);
+ Expression currentOperand = operand;
+ if (currentOperand is PropertyAccess) {
+ operand = new MethodInvocation(
+ currentOperand.target,
+ currentOperand.operator,
+ currentOperand.propertyName,
+ typeArguments,
+ argumentList);
} else {
operand = new FunctionExpressionInvocation(
operand, typeArguments, argumentList);
« no previous file with comments | « pkg/analyzer/lib/src/generated/incremental_resolver.dart ('k') | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698