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 library code_printer; | 5 library code_printer; |
6 | 6 |
7 import 'dart:utf' show stringToCodepoints; | |
8 import 'package:source_maps/source_maps.dart'; | 7 import 'package:source_maps/source_maps.dart'; |
9 | 8 |
10 /** | 9 /** |
11 * Helper class to format generated code and keep track of source map | 10 * Helper class to format generated code and keep track of source map |
12 * information. | 11 * information. |
13 */ | 12 */ |
14 class CodePrinter { | 13 class CodePrinter { |
15 | 14 |
16 /** | 15 /** |
17 * Items recoded by this printer, which can be [String] literals, | 16 * Items recoded by this printer, which can be [String] literals, |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 printer.add(' '); | 235 printer.add(' '); |
237 if (d.sourceSpan != null) printer.mark(d.sourceSpan); | 236 if (d.sourceSpan != null) printer.mark(d.sourceSpan); |
238 printer.add(d.name); | 237 printer.add(d.name); |
239 if (d.initializer != null) { | 238 if (d.initializer != null) { |
240 printer..add(' = ')..add(d.initializer); | 239 printer..add(' = ')..add(d.initializer); |
241 } | 240 } |
242 } | 241 } |
243 printer.add(';\n'); | 242 printer.add(';\n'); |
244 } | 243 } |
245 } | 244 } |
OLD | NEW |