Chromium Code Reviews| Index: lib/src/codegen/dart_codegen.dart |
| diff --git a/lib/src/codegen/dart_codegen.dart b/lib/src/codegen/dart_codegen.dart |
| index 8b689952a5c632198ea3df1a84e4899cf5778385..0ad79bd2377cde064c42c943ab3960d4c8d6f0b5 100644 |
| --- a/lib/src/codegen/dart_codegen.dart |
| +++ b/lib/src/codegen/dart_codegen.dart |
| @@ -67,6 +67,25 @@ class FileWriter extends java_core.PrintStringWriter { |
| bool _format; |
| String _path; |
| FileWriter(this._format, this._path); |
| + int indent = 0; |
| + |
| + void print(x) { |
| + if (_format) { |
| + super.print(x); |
| + return; |
| + } |
| + |
| + if (x == '{') { |
|
Siggi Cherem (dart-lang)
2015/02/26 21:03:49
turns out that the ToStringVIsitor class calls pri
Leaf
2015/02/26 21:42:14
Won't this break things? For example, printing a
Jennifer Messerly
2015/02/26 23:49:50
yeah, +1 on changing the visitor ... IMO it should
|
| + indent++; |
| + x = '{\n${" " * indent}'; |
| + } else if (x == ';') { |
| + x = ';\n${" " * indent}'; |
| + } else if (x == '}') { |
| + indent--; |
| + x = '}\n${" " * indent}'; |
| + } |
| + super.print(x); |
| + } |
| void finalize() { |
| String s = toString(); |