<p dir="auto">This is a tracking issue for the deprecated <a href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.chars" rel="nofollow"><code class="notranslate">std::io::Read::chars</code></a> API.</p>
<p dir="auto">Hey there</p>
<p dir="auto">Reading the parsing code to try to fix <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="19995424" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/9468" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/9468/hovercard" href="https://github.com/rust-lang/rust/issues/9468">#9468</a>, I noticed there was some redundancies in the code.</p>
<p dir="auto">The logic for parsing comments is fully implemented in <code class="notranslate">libsyntax/parse/comments.rs</code>, but doesn't seem to be used out of the pretty printer (<a href="https://github.com/mozilla/rust/blob/master/src/libsyntax/parse/comments.rs#L344">https://github.com/mozilla/rust/blob/master/src/libsyntax/parse/comments.rs#L344</a>).</p>
<p dir="auto">The same logic is also implemented in <code class="notranslate">libsyntax/parse/lexer.rs</code>. The implementations don't seem to share code, and have some different features (comments.rs supports nested block comments while lexer.rs does not).</p>
<p dir="auto">They probably should be merged.</p>
<p dir="auto">I'm new to rust, and I'm a little afraid to touch this problem. The two implementations looks like they have different goals, and I fear I might not have the kind of insight required to that kind of refactoring.</p>