| 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_ast; | 5 part of js_ast; |
| 6 | 6 |
| 7 | 7 |
| 8 class JavaScriptPrintingOptions { | 8 class JavaScriptPrintingOptions { |
| 9 final bool shouldCompressOutput; | 9 final bool shouldCompressOutput; |
| 10 final bool minifyLocalVariables; | 10 final bool minifyLocalVariables; |
| (...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 visitInterpolatedParameter(InterpolatedParameter node) => | 962 visitInterpolatedParameter(InterpolatedParameter node) => |
| 963 visitInterpolatedNode(node); | 963 visitInterpolatedNode(node); |
| 964 | 964 |
| 965 visitInterpolatedSelector(InterpolatedSelector node) => | 965 visitInterpolatedSelector(InterpolatedSelector node) => |
| 966 visitInterpolatedNode(node); | 966 visitInterpolatedNode(node); |
| 967 | 967 |
| 968 visitInterpolatedStatement(InterpolatedStatement node) { | 968 visitInterpolatedStatement(InterpolatedStatement node) { |
| 969 outLn('#${node.nameOrPosition}'); | 969 outLn('#${node.nameOrPosition}'); |
| 970 } | 970 } |
| 971 | 971 |
| 972 visitInterpolatedDeclaration(InterpolatedDeclaration node) { |
| 973 visitInterpolatedNode(node); |
| 974 } |
| 975 |
| 972 void visitComment(Comment node) { | 976 void visitComment(Comment node) { |
| 973 if (shouldCompressOutput) return; | 977 if (shouldCompressOutput) return; |
| 974 String comment = node.comment.trim(); | 978 String comment = node.comment.trim(); |
| 975 if (comment.isEmpty) return; | 979 if (comment.isEmpty) return; |
| 976 for (var line in comment.split('\n')) { | 980 for (var line in comment.split('\n')) { |
| 977 if (comment.startsWith('//')) { | 981 if (comment.startsWith('//')) { |
| 978 outIndentLn(line.trim()); | 982 outIndentLn(line.trim()); |
| 979 } else { | 983 } else { |
| 980 outIndentLn('// ${line.trim()}'); | 984 outIndentLn('// ${line.trim()}'); |
| 981 } | 985 } |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 codes.add(nthLetter((n ~/ nameSpaceSize) % LETTERS)); | 1242 codes.add(nthLetter((n ~/ nameSpaceSize) % LETTERS)); |
| 1239 } | 1243 } |
| 1240 codes.add(charCodes.$0 + digit); | 1244 codes.add(charCodes.$0 + digit); |
| 1241 newName = new String.fromCharCodes(codes); | 1245 newName = new String.fromCharCodes(codes); |
| 1242 } | 1246 } |
| 1243 assert(new RegExp(r'[a-zA-Z][a-zA-Z0-9]*').hasMatch(newName)); | 1247 assert(new RegExp(r'[a-zA-Z][a-zA-Z0-9]*').hasMatch(newName)); |
| 1244 maps.last[oldName] = newName; | 1248 maps.last[oldName] = newName; |
| 1245 return newName; | 1249 return newName; |
| 1246 } | 1250 } |
| 1247 } | 1251 } |
| OLD | NEW |