Skip to content

Duplicated functionnality for parsing comments #9701

Closed
@madjar

Description

@madjar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions