<div dir="ltr">Right, I can fix that.  Give me a few minutes though.</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 19, 2017 at 11:28 AM Leonard Mosescu <<a href="mailto:mosescu@google.com">mosescu@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This looks beautiful indeed. The problem is that it doesn't quite work with the current MemoryBuffer and the line_iterator : for one thing there's no way to construct a MemoryBuffer from a StringRef, or to use the line_iterator directly with a StringRef. <div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 19, 2017 at 10:39 AM, Zachary Turner via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">zturner added a comment.<br>
<br>
Give me a few more hours, if there's a way to make this work with `line_iterator` I'd really prefer that since I think it improves readability.  Can you confirm that if you were able to write:<br>
<br>
  auto begin = line_iterator(str, /* skip_empty_lines =*/ false);<br>
  auto end = line_iterator();<br>
  while (begin != end && !WasInterrupted()) {<br>
    stream.Write(*begin);<br>
    if (++begin != end)<br>
      stream.Write("\n");<br>
  }<br>
<br>
That this would be equivalent?<br>
<br>
<br>
<a href="https://reviews.llvm.org/D37923" rel="noreferrer" target="_blank">https://reviews.llvm.org/D37923</a><br>
<br>
<br>
<br>
</blockquote></div><br></div>
</blockquote></div>