Chromium Code Reviews| Index: pkg/analyzer/lib/src/services/writer.dart |
| diff --git a/pkg/analyzer/lib/src/services/writer.dart b/pkg/analyzer/lib/src/services/writer.dart |
| index d1437482530c66388d246ac3d3cf1f60f8ce7e20..1713224733ef28c405bb3b0ea2e5953500cb9949 100644 |
| --- a/pkg/analyzer/lib/src/services/writer.dart |
| +++ b/pkg/analyzer/lib/src/services/writer.dart |
| @@ -350,8 +350,18 @@ class SourceWriter { |
| } |
| } |
| - void write(x) { |
| - _addToken(new LineToken(x)); |
| + void write(String string) { |
| + List<String> lines = string.split(lineSeparator); |
|
pquitslund
2014/06/06 17:18:53
I'd prefer no type annotations (besides the declar
scheglov
2014/06/06 17:25:37
Done.
|
| + int length = lines.length; |
| + for (int i = 0; i < length; i++) { |
| + String line = lines[i]; |
| + _addToken(new LineToken(line)); |
| + if (i != length - 1) { |
| + newline(); |
| + // no indentation for multi-line strings |
| + currentLine.clear(); |
| + } |
| + } |
| } |
| void writeln(String s) { |