forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lists: Detect block comment by starting from the end.
The issue with the current code is that comments are collapsed, so comments like the one from the test end up in a string like: ``` "// this is a single line comment\n/* block = */" ``` I chose to fix it by detecting whether we're in a block comment starting from the end instead, and tested a single-line comment ended in `*/` just for sanity, ensuring line breaks are not removed in that case, which would break the formatting. The right fix eventually is probably to lex the comments properly, but this does the work for now, I guess :) Fixes rust-lang#3025
- Loading branch information
Showing
3 changed files
with
39 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters