| 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 Function get _compareNodes => | 5 Function get _compareNodes => |
| 6 compareBy((n) => n.getBeginToken().charOffset); | 6 compareBy((n) => n.getBeginToken().charOffset); |
| 7 | 7 |
| 8 typedef String _Renamer(Renamable renamable); | 8 typedef String _Renamer(Renamable renamable); |
| 9 abstract class Renamable { | 9 abstract class Renamable { |
| 10 const int RENAMABLE_TYPE_ELEMENT = 1; | 10 const int RENAMABLE_TYPE_ELEMENT = 1; |
| 11 const int RENAMABLE_TYPE_MEMBER = 2; | 11 const int RENAMABLE_TYPE_MEMBER = 2; |
| 12 const int RENAMABLE_TYPE_LOCAL = 3; | 12 const int RENAMABLE_TYPE_LOCAL = 3; |
| 13 | 13 |
| 14 final Set<Node> nodes; | 14 final Set<Node> nodes; |
| 15 final _Renamer renamer; | 15 final _Renamer renamer; |
| 16 | 16 |
| 17 Renamable(this.nodes, this.renamer); | 17 Renamable(this.nodes, this.renamer); |
| 18 int compareTo(Renamable other) { | 18 int compareTo(Renamable other) { |
| 19 int nodesDiff = other.nodes.length.compareTo(this.nodes.length); | 19 int nodesDiff = other.nodes.length.compareTo(this.nodes.length); |
| 20 if (nodesDiff != 0) return nodesDiff; | 20 if (nodesDiff != 0) return nodesDiff; |
| 21 int typeDiff = this.getTypeId().compareTo(other.getTypeId()); | 21 int typeDiff = this.getTypeId().compareTo(other.getTypeId()); |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 index ~/= firstCharAlphabet.length; | 288 index ~/= firstCharAlphabet.length; |
| 289 int length = otherCharsAlphabet.length; | 289 int length = otherCharsAlphabet.length; |
| 290 while (index >= length) { | 290 while (index >= length) { |
| 291 resultBuilder.add(otherCharsAlphabet[index % length]); | 291 resultBuilder.add(otherCharsAlphabet[index % length]); |
| 292 index ~/= length; | 292 index ~/= length; |
| 293 } | 293 } |
| 294 resultBuilder.add(otherCharsAlphabet[index]); | 294 resultBuilder.add(otherCharsAlphabet[index]); |
| 295 return resultBuilder.toString(); | 295 return resultBuilder.toString(); |
| 296 } | 296 } |
| 297 } | 297 } |
| OLD | NEW |