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

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

Issue 10574046: Remove static fields in the namer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove spurious "else". Created 8 years, 6 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('../tree/tree.dart'); 7 #import('../tree/tree.dart');
8 #import('../scanner/scannerlib.dart'); 8 #import('../scanner/scannerlib.dart');
9 #import('../leg.dart'); // TODO(karlklose): we only need type. 9 #import('../leg.dart'); // TODO(karlklose): we only need type.
10 #import('../util/util.dart'); 10 #import('../util/util.dart');
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 return isLocal(element); 946 return isLocal(element);
947 } 947 }
948 948
949 static SourceString constructConstructorName(SourceString receiver, 949 static SourceString constructConstructorName(SourceString receiver,
950 SourceString selector) { 950 SourceString selector) {
951 String r = receiver.slowToString(); 951 String r = receiver.slowToString();
952 String s = selector.slowToString(); 952 String s = selector.slowToString();
953 return new SourceString('$r\$$s'); 953 return new SourceString('$r\$$s');
954 } 954 }
955 955
956 static final SourceString OPERATOR_EQUALS =
957 const SourceString('operator\$eq');
ahe 2012/06/20 19:45:52 Total nit: raw string would be nicer for grep'ing.
floitsch 2012/06/20 20:29:30 good argument. done.
958
956 static SourceString constructOperatorName(SourceString receiver, 959 static SourceString constructOperatorName(SourceString receiver,
957 SourceString selector, 960 SourceString selector,
958 [bool isPrefix = false]) { 961 [bool isPrefix = false]) {
959 String str = selector.stringValue; 962 String str = selector.stringValue;
960 if (str === '==' || str === '!=') return Namer.OPERATOR_EQUALS; 963 if (str === '==' || str === '!=') return OPERATOR_EQUALS;
961 964
962 if (str === '~') str = 'not'; 965 if (str === '~') str = 'not';
963 else if (str === 'negate' || (str === '-' && isPrefix)) str = 'negate'; 966 else if (str === 'negate' || (str === '-' && isPrefix)) str = 'negate';
964 else if (str === '[]') str = 'index'; 967 else if (str === '[]') str = 'index';
965 else if (str === '[]=') str = 'indexSet'; 968 else if (str === '[]=') str = 'indexSet';
966 else if (str === '*' || str === '*=') str = 'mul'; 969 else if (str === '*' || str === '*=') str = 'mul';
967 else if (str === '/' || str === '/=') str = 'div'; 970 else if (str === '/' || str === '/=') str = 'div';
968 else if (str === '%' || str === '%=') str = 'mod'; 971 else if (str === '%' || str === '%=') str = 'mod';
969 else if (str === '~/' || str === '~/=') str = 'tdiv'; 972 else if (str === '~/' || str === '~/=') str = 'tdiv';
970 else if (str === '+' || str === '+=') str = 'add'; 973 else if (str === '+' || str === '+=') str = 'add';
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 final Node node; 1062 final Node node;
1060 Type bound; 1063 Type bound;
1061 Type type; 1064 Type type;
1062 TypeVariableElement(name, Element enclosing, this.node, this.type, 1065 TypeVariableElement(name, Element enclosing, this.node, this.type,
1063 [this.bound]) 1066 [this.bound])
1064 : super(name, ElementKind.TYPE_VARIABLE, enclosing); 1067 : super(name, ElementKind.TYPE_VARIABLE, enclosing);
1065 Type computeType(compiler) => type; 1068 Type computeType(compiler) => type;
1066 Node parseNode(compiler) => node; 1069 Node parseNode(compiler) => node;
1067 toString() => "${enclosingElement.toString()}.${name.slowToString()}"; 1070 toString() => "${enclosingElement.toString()}.${name.slowToString()}";
1068 } 1071 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/emitter.dart » ('j') | lib/compiler/implementation/namer.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698