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

Consider line feed, carriage return, or both as an end of single line comment. #27836

Closed
ahsonkhan opened this issue Nov 7, 2018 · 4 comments
Labels
area-System.Text.Json help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@ahsonkhan
Copy link
Member

Currently, we assume that a single line comment ends with a line feed. We need to change this so that a carriage return also means an end of comment (or both \r\n). This way we match the semantics of Json.NET as well.

@ahsonkhan
Copy link
Member Author

cc @GrabYourPitchforks

@stevenaw
Copy link
Contributor

Is this ready for development? If so, I'd like to pick this up.

@stevenaw
Copy link
Contributor

Thanks for the feedback on my PR @ahsonkhan
I hadn't realized JSON.Net would continue to process text as a single-line comment between a \r and \n. I'll be able to take another go at this within the next few days.

I have a question though. If \r does not end a single-line comment when it is followed (at some point) by a \n, would that make checking for \r to end a single-line comment redundant? Or are you saying we should treat \r as a comment terminator only if it is not followed (at some point) by a \n?

@stevenaw
Copy link
Contributor

Wait, sorry, I had misread your case here: dotnet/corefx#33393 (comment)

Now I think I get it.

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 3.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Text.Json help wanted [up-for-grabs] Good issue for external contributors
Projects
None yet
Development

No branches or pull requests

3 participants