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

Unified Diff: lib/indenting_writer.dart

Issue 1196293003: Initial support for generating client and server stubs for Dart. (Closed) Base URL: https://github.com/dart-lang/dart-protoc-plugin.git@master
Patch Set: adddressing nits Created 5 years, 6 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
Index: lib/indenting_writer.dart
diff --git a/lib/indenting_writer.dart b/lib/indenting_writer.dart
index 1b7dfca0b3acd9c3d8a351e7fd37b6336df0ab58..e22a93577b6526242810d67d0a18eedd99d81097 100644
--- a/lib/indenting_writer.dart
+++ b/lib/indenting_writer.dart
@@ -12,13 +12,17 @@ class IndentingWriter implements Writer {
IndentingWriter(this._indentSequence, this._writer);
- void addBlock(String start, String end, void body()) {
+ void addBlock(String start, String end, void body(), {endWithNewline: true}) {
println(start);
var oldIndent = _currentIndent;
_currentIndent = '$_currentIndent$_indentSequence';
body();
_currentIndent = oldIndent;
- println(end);
+ if (endWithNewline) {
+ println(end);
+ } else {
+ print(end);
+ }
}
void print(String stringToPrint) {
« no previous file with comments | « lib/file_generator.dart ('k') | lib/protoc.dart » ('j') | test/service_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698