Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 get currentElement; | 8 Element get currentElement; |
| 9 Set<Node> get superUses; | 9 Set<Node> get superUses; |
| 10 | 10 |
| (...skipping 2113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2124 if (node.isIndex) { | 2124 if (node.isIndex) { |
| 2125 return isSet ? new Selector.indexSet() : new Selector.index(); | 2125 return isSet ? new Selector.indexSet() : new Selector.index(); |
| 2126 } | 2126 } |
| 2127 | 2127 |
| 2128 if (node.isOperator) { | 2128 if (node.isOperator) { |
| 2129 SourceString source = node.selector.asOperator().source; | 2129 SourceString source = node.selector.asOperator().source; |
| 2130 String string = source.stringValue; | 2130 String string = source.stringValue; |
| 2131 if (identical(string, '!') || | 2131 if (identical(string, '!') || |
| 2132 identical(string, '&&') || identical(string, '||') || | 2132 identical(string, '&&') || identical(string, '||') || |
| 2133 identical(string, 'is') || identical(string, 'as') || | 2133 identical(string, 'is') || identical(string, 'as') || |
| 2134 identical(string, '===') || identical(string, '!==') || | |
| 2135 identical(string, '?') || | 2134 identical(string, '?') || |
| 2136 identical(string, '>>>')) { | 2135 identical(string, '>>>')) { |
| 2137 return null; | 2136 return null; |
| 2138 } | 2137 } |
| 2138 SourceString op = source; | |
| 2139 if (!isUserDefinableOperator(source.stringValue)) { | 2139 if (!isUserDefinableOperator(source.stringValue)) { |
| 2140 source = Elements.mapToUserOperator(source); | 2140 op = Elements.mapToUserOperatorOrNull(source); |
| 2141 } | |
| 2142 if (op == null) { | |
| 2143 // Unsupported operator. | |
|
ahe
2013/08/06 14:48:40
How is that diagnosed?
Johnni Winther
2013/08/07 06:56:25
An error has been reported during parsing.
Added
| |
| 2144 return new Selector.call( | |
| 2145 source, library, node.argumentsNode.slowLength(), []); | |
| 2141 } | 2146 } |
| 2142 return node.arguments.isEmpty | 2147 return node.arguments.isEmpty |
| 2143 ? new Selector.unaryOperator(source) | 2148 ? new Selector.unaryOperator(op) |
| 2144 : new Selector.binaryOperator(source); | 2149 : new Selector.binaryOperator(op); |
| 2145 } | 2150 } |
| 2146 | 2151 |
| 2147 Identifier identifier = node.selector.asIdentifier(); | 2152 Identifier identifier = node.selector.asIdentifier(); |
| 2148 if (node.isPropertyAccess) { | 2153 if (node.isPropertyAccess) { |
| 2149 assert(!isSet); | 2154 assert(!isSet); |
| 2150 return new Selector.getter(identifier.source, library); | 2155 return new Selector.getter(identifier.source, library); |
| 2151 } else if (isSet) { | 2156 } else if (isSet) { |
| 2152 return new Selector.setter(identifier.source, library); | 2157 return new Selector.setter(identifier.source, library); |
| 2153 } | 2158 } |
| 2154 | 2159 |
| (...skipping 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4054 return e; | 4059 return e; |
| 4055 } | 4060 } |
| 4056 | 4061 |
| 4057 /// Assumed to be called by [resolveRedirectingFactory]. | 4062 /// Assumed to be called by [resolveRedirectingFactory]. |
| 4058 Element visitReturn(Return node) { | 4063 Element visitReturn(Return node) { |
| 4059 Node expression = node.expression; | 4064 Node expression = node.expression; |
| 4060 return finishConstructorReference(visit(expression), | 4065 return finishConstructorReference(visit(expression), |
| 4061 expression, expression); | 4066 expression, expression); |
| 4062 } | 4067 } |
| 4063 } | 4068 } |
| OLD | NEW |