Skip to content
This repository was archived by the owner on Apr 27, 2026. It is now read-only.

fix parsing of multiple comment lines#3175

Merged
jonsequitur merged 1 commit into
dotnet:mainfrom
jonsequitur:combinatorial-testing-5
Sep 14, 2023
Merged

fix parsing of multiple comment lines#3175
jonsequitur merged 1 commit into
dotnet:mainfrom
jonsequitur:combinatorial-testing-5

Conversation

@jonsequitur

Copy link
Copy Markdown
Contributor

This PR adds combinatorial testing to produce test cases with multiple consecutive line comments in all of the valid positions, and fixes the previous issue with parsing them.

@jonsequitur
jonsequitur force-pushed the combinatorial-testing-5 branch from f9ffa19 to 316e566 Compare September 14, 2023 01:23
private IEnumerable<HttpCommentNode> ParseComments()
{
if (IsComment())
while (IsComment())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We may have another bug if there is a blank line (or a line with only whitespaces) in between two comments.

foreach (var comment in ParseComments())
{
requestNode.Add(commentAfterHeaders);
requestNode.Add(comment);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Consider: It may be useful to introduce an HttpSyntaxNode.AddRange method for comments.

@jonsequitur
jonsequitur merged commit 528d756 into dotnet:main Sep 14, 2023
@colombod colombod added the bug Something isn't working label Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants