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

Side by Side Diff: pkg/analyzer/lib/src/generated/element_resolver.dart

Issue 1052243002: Implement the new '??=' operator in analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/error_verifier.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 engine.resolver.element_resolver; 5 library engine.resolver.element_resolver;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'ast.dart'; 9 import 'ast.dart';
10 import 'element.dart'; 10 import 'element.dart';
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 if (function is ConstructorElement) { 139 if (function is ConstructorElement) {
140 return function.isConst; 140 return function.isConst;
141 } 141 }
142 return false; 142 return false;
143 } 143 }
144 144
145 @override 145 @override
146 Object visitAssignmentExpression(AssignmentExpression node) { 146 Object visitAssignmentExpression(AssignmentExpression node) {
147 sc.Token operator = node.operator; 147 sc.Token operator = node.operator;
148 sc.TokenType operatorType = operator.type; 148 sc.TokenType operatorType = operator.type;
149 if (operatorType != sc.TokenType.EQ) { 149 if (operatorType != sc.TokenType.EQ &&
150 operatorType != sc.TokenType.QUESTION_QUESTION_EQ) {
150 operatorType = _operatorFromCompoundAssignment(operatorType); 151 operatorType = _operatorFromCompoundAssignment(operatorType);
151 Expression leftHandSide = node.leftHandSide; 152 Expression leftHandSide = node.leftHandSide;
152 if (leftHandSide != null) { 153 if (leftHandSide != null) {
153 String methodName = operatorType.lexeme; 154 String methodName = operatorType.lexeme;
154 DartType staticType = _getStaticType(leftHandSide); 155 DartType staticType = _getStaticType(leftHandSide);
155 MethodElement staticMethod = 156 MethodElement staticMethod =
156 _lookUpMethod(leftHandSide, staticType, methodName); 157 _lookUpMethod(leftHandSide, staticType, methodName);
157 node.staticElement = staticMethod; 158 node.staticElement = staticMethod;
158 DartType propagatedType = _getPropagatedType(leftHandSide); 159 DartType propagatedType = _getPropagatedType(leftHandSide);
159 MethodElement propagatedMethod = 160 MethodElement propagatedMethod =
(...skipping 2747 matching lines...) Expand 10 before | Expand all | Expand 10 after
2907 2908
2908 @override 2909 @override
2909 Element get staticElement => null; 2910 Element get staticElement => null;
2910 2911
2911 @override 2912 @override
2912 accept(AstVisitor visitor) => null; 2913 accept(AstVisitor visitor) => null;
2913 2914
2914 @override 2915 @override
2915 void visitChildren(AstVisitor visitor) {} 2916 void visitChildren(AstVisitor visitor) {}
2916 } 2917 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/error_verifier.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698