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 part of js; | |
6 | |
7 class Printer implements NodeVisitor { | 5 class Printer implements NodeVisitor { |
8 final bool shouldCompressOutput; | 6 final bool shouldCompressOutput; |
9 leg.Compiler compiler; | 7 leg.Compiler compiler; |
10 leg.CodeBuffer outBuffer; | 8 leg.CodeBuffer outBuffer; |
11 int indentLevel = 0; | 9 int indentLevel = 0; |
12 bool inForInit = false; | 10 bool inForInit = false; |
13 bool atStatementBegin = false; | 11 bool atStatementBegin = false; |
14 final DanglingElseVisitor danglingElseVisitor; | 12 final DanglingElseVisitor danglingElseVisitor; |
15 final Namer namer; | 13 final Namer namer; |
16 | 14 |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 } | 975 } |
978 codes.add(charCodes.$0 + digit); | 976 codes.add(charCodes.$0 + digit); |
979 newName = new String.fromCharCodes(codes); | 977 newName = new String.fromCharCodes(codes); |
980 } | 978 } |
981 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)); |
982 nameNumber++; | 980 nameNumber++; |
983 maps.last()[oldName] = newName; | 981 maps.last()[oldName] = newName; |
984 return newName; | 982 return newName; |
985 } | 983 } |
986 } | 984 } |
OLD | NEW |