Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify RFC 2822 comment parser #737

Merged
merged 3 commits into from Jul 26, 2022
Merged

Simplify RFC 2822 comment parser #737

merged 3 commits into from Jul 26, 2022

Conversation

djc
Copy link
Contributor

@djc djc commented Jul 25, 2022

Tweak the implementation from #733 to simplify the parser.

cc @Finomnis

@djc djc requested a review from esheppa July 25, 2022 11:48
@esheppa
Copy link
Collaborator

esheppa commented Jul 25, 2022

Looks good - looks like this disallows training whitespace which is consistent with the behavior pre acd4ecf. Only thought I had was changing the test strings to raw strings as the multiple levels of escaping is a bit tricky - I added a PR (#738) to this branch to do that, however please feel free to ignore if you think it's not necessary

Copy link
Contributor

@Finomnis Finomnis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reworked parser is quite elegant. I am ok with the removed trailing whitespace support, as it matches the RFC. I disagree with reducing whitespace down to the space character, which is not RFC conform. trim_left() seems to match the behaviour of the RFC closer.

src/format/parse.rs Show resolved Hide resolved
src/format/scan.rs Outdated Show resolved Hide resolved
@Finomnis
Copy link
Contributor

Created PR with fixes for my comments: #739

@djc djc merged commit 5eacc0a into main Jul 26, 2022
@djc djc deleted the simplify-comment-parser branch July 26, 2022 07:59
@djc
Copy link
Contributor Author

djc commented Jul 26, 2022

Thanks, great collaboration here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants