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

Side by Side Diff: lib/compiler/implementation/elements/elements.dart

Issue 10825337: Add name and library to selectors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge from master. Created 8 years, 4 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
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 #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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698