| 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 #library('elements'); | 5 #library('elements'); |
| 6 | 6 |
| 7 #import('dart:uri'); | 7 #import('dart:uri'); |
| 8 | 8 |
| 9 #import('../tree/tree.dart'); | 9 #import('../tree/tree.dart'); |
| 10 #import('../scanner/scannerlib.dart'); | 10 #import('../scanner/scannerlib.dart'); |
| (...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1307 String r = receiver.slowToString(); | 1307 String r = receiver.slowToString(); |
| 1308 String s = selector.slowToString(); | 1308 String s = selector.slowToString(); |
| 1309 return new SourceString('$r\$$s'); | 1309 return new SourceString('$r\$$s'); |
| 1310 } | 1310 } |
| 1311 | 1311 |
| 1312 static final SourceString OPERATOR_EQUALS = | 1312 static final SourceString OPERATOR_EQUALS = |
| 1313 const SourceString(@'operator$eq'); | 1313 const SourceString(@'operator$eq'); |
| 1314 | 1314 |
| 1315 static SourceString constructOperatorName(SourceString receiver, | 1315 static SourceString constructOperatorName(SourceString receiver, |
| 1316 SourceString selector, | 1316 SourceString selector, |
| 1317 [bool isPrefix = false]) { | 1317 [bool isUnary = false]) { |
| 1318 String str = selector.stringValue; | 1318 String str = selector.stringValue; |
| 1319 if (str === '==' || str === '!=') return OPERATOR_EQUALS; | 1319 if (str === '==' || str === '!=') return OPERATOR_EQUALS; |
| 1320 | 1320 |
| 1321 if (str === '~') str = 'not'; | 1321 if (str === '~') str = 'not'; |
| 1322 else if (str === 'negate' || (str === '-' && isPrefix)) str = 'negate'; | 1322 else if (str === 'negate' || (str === '-' && isUnary)) str = 'negate'; |
| 1323 else if (str === '[]') str = 'index'; | 1323 else if (str === '[]') str = 'index'; |
| 1324 else if (str === '[]=') str = 'indexSet'; | 1324 else if (str === '[]=') str = 'indexSet'; |
| 1325 else if (str === '*' || str === '*=') str = 'mul'; | 1325 else if (str === '*' || str === '*=') str = 'mul'; |
| 1326 else if (str === '/' || str === '/=') str = 'div'; | 1326 else if (str === '/' || str === '/=') str = 'div'; |
| 1327 else if (str === '%' || str === '%=') str = 'mod'; | 1327 else if (str === '%' || str === '%=') str = 'mod'; |
| 1328 else if (str === '~/' || str === '~/=') str = 'tdiv'; | 1328 else if (str === '~/' || str === '~/=') str = 'tdiv'; |
| 1329 else if (str === '+' || str === '+=') str = 'add'; | 1329 else if (str === '+' || str === '+=') str = 'add'; |
| 1330 else if (str === '-' || str === '-=') str = 'sub'; | 1330 else if (str === '-' || str === '-=') str = 'sub'; |
| 1331 else if (str === '<<' || str === '<<=') str = 'shl'; | 1331 else if (str === '<<' || str === '<<=') str = 'shl'; |
| 1332 else if (str === '>>' || str === '>>=') str = 'shr'; | 1332 else if (str === '>>' || str === '>>=') str = 'shr'; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1427 Node parseNode(compiler) => cachedNode; | 1427 Node parseNode(compiler) => cachedNode; |
| 1428 | 1428 |
| 1429 String toString() => "${enclosingElement.toString()}.${name.slowToString()}"; | 1429 String toString() => "${enclosingElement.toString()}.${name.slowToString()}"; |
| 1430 | 1430 |
| 1431 TypeVariableElement cloneTo(Element enclosing, DiagnosticListener listener) { | 1431 TypeVariableElement cloneTo(Element enclosing, DiagnosticListener listener) { |
| 1432 TypeVariableElement result = | 1432 TypeVariableElement result = |
| 1433 new TypeVariableElement(name, enclosing, node, type, bound); | 1433 new TypeVariableElement(name, enclosing, node, type, bound); |
| 1434 return result; | 1434 return result; |
| 1435 } | 1435 } |
| 1436 } | 1436 } |
| OLD | NEW |