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

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: Address review comments 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 (identical(string, '!') ||
1619 identical(string, 'is') || identical(string, 'as') || 1619 identical(string, '&&') || identical(string, '||') ||
1620 identical(string, 'is') || identical(string, 'as') ||
1620 identical(string, '===') || identical(string, '!==') || 1621 identical(string, '===') || identical(string, '!==') ||
1622 identical(string, '?') ||
1621 identical(string, '>>>')) { 1623 identical(string, '>>>')) {
1622 return null; 1624 return null;
1623 } 1625 }
1626 if (!isUserDefinableOperator(source.stringValue)) {
1627 source = Elements.mapToUserOperator(source);
1628 }
1624 return node.arguments.isEmpty 1629 return node.arguments.isEmpty
1625 ? new Selector.unaryOperator(source) 1630 ? new Selector.unaryOperator(source)
1626 : new Selector.binaryOperator(source); 1631 : new Selector.binaryOperator(source);
1627 } 1632 }
1628 1633
1629 Identifier identifier = node.selector.asIdentifier(); 1634 Identifier identifier = node.selector.asIdentifier();
1630 if (node.isPropertyAccess) { 1635 if (node.isPropertyAccess) {
1631 assert(!isSet); 1636 assert(!isSet);
1632 return new Selector.getter(identifier.source, library); 1637 return new Selector.getter(identifier.source, library);
1633 } else if (isSet) { 1638 } else if (isSet) {
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after
3070 return e; 3075 return e;
3071 } 3076 }
3072 3077
3073 /// Assumed to be called by [resolveRedirectingFactory]. 3078 /// Assumed to be called by [resolveRedirectingFactory].
3074 Element visitReturn(Return node) { 3079 Element visitReturn(Return node) {
3075 Node expression = node.expression; 3080 Node expression = node.expression;
3076 return finishConstructorReference(visit(expression), 3081 return finishConstructorReference(visit(expression),
3077 expression, expression); 3082 expression, expression);
3078 } 3083 }
3079 } 3084 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698