Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: lib/src/codegen/dart_codegen.dart

Issue 963593002: Disable formatting and add new-lines to make tests faster. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/codegen_test.dart » ('j') | test/dart_codegen/expect/_internal/iterable.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | test/codegen_test.dart » ('j') | test/dart_codegen/expect/_internal/iterable.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698