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

Side by Side Diff: dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 10905211: Clean up operator names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added test Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of resolution; 5 part of resolution;
6 6
7 abstract class TreeElements { 7 abstract class TreeElements {
8 Element operator[](Node node); 8 Element operator[](Node node);
9 Selector getSelector(Send send); 9 Selector getSelector(Send send);
10 DartType getType(Node node); 10 DartType getType(Node node);
(...skipping 1597 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 // First determine if this is part of an assignment. 1608 // First determine if this is part of an assignment.
1609 bool isSet = node.asSendSet() != null; 1609 bool isSet = node.asSendSet() != null;
1610 1610
1611 if (node.isIndex) { 1611 if (node.isIndex) {
1612 return isSet ? new Selector.indexSet() : new Selector.index(); 1612 return isSet ? new Selector.indexSet() : new Selector.index();
1613 } 1613 }
1614 1614
1615 if (node.isOperator) { 1615 if (node.isOperator) {
1616 SourceString source = node.selector.asOperator().source; 1616 SourceString source = node.selector.asOperator().source;
1617 String string = source.stringValue; 1617 String string = source.stringValue;
1618 if (identical(string, '!') || identical(string, '&&') || string == '||' || 1618 if (string === '!' || string === '&&' || string == '||' ||
ngeoffray 2012/11/13 11:56:19 Use identical instead.
ahe 2012/11/15 07:00:33 Done.
1619 identical(string, 'is') || identical(string, 'as') || 1619 string === 'is' || string === 'as' ||
1620 identical(string, '===') || identical(string, '!==') || 1620 string === '===' || string === '!==' ||
1621 identical(string, '>>>')) { 1621 string === '?' ||
1622 string === '>>>') {
1622 return null; 1623 return null;
1623 } 1624 }
1625 if (!isUserDefinableOperator(source.stringValue)) {
1626 source = Elements.mapToUserOperator(source);
1627 }
1624 return node.arguments.isEmpty 1628 return node.arguments.isEmpty
1625 ? new Selector.unaryOperator(source) 1629 ? new Selector.unaryOperator(source)
1626 : new Selector.binaryOperator(source); 1630 : new Selector.binaryOperator(source);
1627 } 1631 }
1628 1632
1629 Identifier identifier = node.selector.asIdentifier(); 1633 Identifier identifier = node.selector.asIdentifier();
1630 if (node.isPropertyAccess) { 1634 if (node.isPropertyAccess) {
1631 assert(!isSet); 1635 assert(!isSet);
1632 return new Selector.getter(identifier.source, library); 1636 return new Selector.getter(identifier.source, library);
1633 } else if (isSet) { 1637 } else if (isSet) {
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after
3070 return e; 3074 return e;
3071 } 3075 }
3072 3076
3073 /// Assumed to be called by [resolveRedirectingFactory]. 3077 /// Assumed to be called by [resolveRedirectingFactory].
3074 Element visitReturn(Return node) { 3078 Element visitReturn(Return node) {
3075 Node expression = node.expression; 3079 Node expression = node.expression;
3076 return finishConstructorReference(visit(expression), 3080 return finishConstructorReference(visit(expression),
3077 expression, expression); 3081 expression, expression);
3078 } 3082 }
3079 } 3083 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698