Description
Hey there
Reading the parsing code to try to fix #9468, I noticed there was some redundancies in the code.
The logic for parsing comments is fully implemented in libsyntax/parse/comments.rs
, but doesn't seem to be used out of the pretty printer (https://github.com/mozilla/rust/blob/master/src/libsyntax/parse/comments.rs#L344).
The same logic is also implemented in libsyntax/parse/lexer.rs
. The implementations don't seem to share code, and have some different features (comments.rs supports nested block comments while lexer.rs does not).
They probably should be merged.
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.