OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 dart2js.util; | 5 library dart2js.util; |
6 | 6 |
7 import 'package:front_end/src/fasta/scanner/characters.dart'; | 7 import 'package:front_end/src/fasta/scanner/characters.dart'; |
8 import 'package:front_end/src/fasta/util/link.dart'; | 8 import 'package:front_end/src/fasta/util/link.dart'; |
9 | 9 |
10 export 'emptyset.dart'; | 10 export 'emptyset.dart'; |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 0x3fffffff; | 184 0x3fffffff; |
185 } | 185 } |
186 | 186 |
187 String modifiersToString( | 187 String modifiersToString( |
188 {bool isStatic: false, | 188 {bool isStatic: false, |
189 bool isAbstract: false, | 189 bool isAbstract: false, |
190 bool isFinal: false, | 190 bool isFinal: false, |
191 bool isVar: false, | 191 bool isVar: false, |
192 bool isConst: false, | 192 bool isConst: false, |
193 bool isFactory: false, | 193 bool isFactory: false, |
194 bool isExternal: false}) { | 194 bool isExternal: false, |
| 195 bool isCovariant: false}) { |
195 LinkBuilder<String> builder = new LinkBuilder<String>(); | 196 LinkBuilder<String> builder = new LinkBuilder<String>(); |
196 if (isStatic) builder.addLast('static'); | 197 if (isStatic) builder.addLast('static'); |
197 if (isAbstract) builder.addLast('abstract'); | 198 if (isAbstract) builder.addLast('abstract'); |
198 if (isFinal) builder.addLast('final'); | 199 if (isFinal) builder.addLast('final'); |
199 if (isVar) builder.addLast('var'); | 200 if (isVar) builder.addLast('var'); |
200 if (isConst) builder.addLast('const'); | 201 if (isConst) builder.addLast('const'); |
201 if (isFactory) builder.addLast('factory'); | 202 if (isFactory) builder.addLast('factory'); |
202 if (isExternal) builder.addLast('external'); | 203 if (isExternal) builder.addLast('external'); |
| 204 if (isCovariant) builder.addLast('covariant'); |
203 StringBuffer buffer = new StringBuffer(); | 205 StringBuffer buffer = new StringBuffer(); |
204 builder.toLink().printOn(buffer, ', '); | 206 builder.toLink().printOn(buffer, ', '); |
205 return buffer.toString(); | 207 return buffer.toString(); |
206 } | 208 } |
207 | 209 |
208 class Pair<A, B> { | 210 class Pair<A, B> { |
209 final A a; | 211 final A a; |
210 final B b; | 212 final B b; |
211 | 213 |
212 Pair(this.a, this.b); | 214 Pair(this.a, this.b); |
(...skipping 28 matching lines...) Expand all Loading... |
241 if (usedNames.contains(suggestedName)) { | 243 if (usedNames.contains(suggestedName)) { |
242 int counter = 0; | 244 int counter = 0; |
243 while (usedNames.contains(result)) { | 245 while (usedNames.contains(result)) { |
244 counter++; | 246 counter++; |
245 result = "$suggestedName$counter"; | 247 result = "$suggestedName$counter"; |
246 } | 248 } |
247 } | 249 } |
248 usedNames.add(result); | 250 usedNames.add(result); |
249 return result; | 251 return result; |
250 } | 252 } |
OLD | NEW |