| 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 class Printer implements NodeVisitor { | 5 class Printer implements NodeVisitor { |
| 6 final bool shouldCompressOutput; | 6 final bool shouldCompressOutput; |
| 7 leg.Compiler compiler; | 7 leg.Compiler compiler; |
| 8 leg.CodeBuffer outBuffer; | 8 leg.CodeBuffer outBuffer; |
| 9 int indentLevel = 0; | 9 int indentLevel = 0; |
| 10 bool inForInit = false; | 10 bool inForInit = false; |
| (...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 var codes = <int>[]; | 971 var codes = <int>[]; |
| 972 for (var i = 0; i < alphaChars; i++) { | 972 for (var i = 0; i < alphaChars; i++) { |
| 973 nameSpaceSize ~/= LETTERS; | 973 nameSpaceSize ~/= LETTERS; |
| 974 codes.add(nthLetter((n ~/ nameSpaceSize) % LETTERS)); | 974 codes.add(nthLetter((n ~/ nameSpaceSize) % LETTERS)); |
| 975 } | 975 } |
| 976 codes.add(charCodes.$0 + digit); | 976 codes.add(charCodes.$0 + digit); |
| 977 newName = new String.fromCharCodes(codes); | 977 newName = new String.fromCharCodes(codes); |
| 978 } | 978 } |
| 979 assert(const RegExp(r'[a-zA-Z][a-zA-Z0-9]*').hasMatch(newName)); | 979 assert(const RegExp(r'[a-zA-Z][a-zA-Z0-9]*').hasMatch(newName)); |
| 980 nameNumber++; | 980 nameNumber++; |
| 981 maps.last()[oldName] = newName; | 981 maps.last[oldName] = newName; |
| 982 return newName; | 982 return newName; |
| 983 } | 983 } |
| 984 } | 984 } |
| OLD | NEW |