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

C#: Allow for empty comments #943

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lexers/embedded/c#.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
<rule pattern="\\\n">
<token type="Text"/>
</rule>
<rule pattern="///[^\n\r]+">
<rule pattern="///[^\n\r]*">
<token type="CommentSpecial"/>
</rule>
<rule pattern="//[^\n\r]+">
<rule pattern="//[^\n\r]*">
<token type="CommentSingle"/>
</rule>
<rule pattern="/[*].*?[*]/">
Expand Down
3 changes: 2 additions & 1 deletion lexers/testdata/csharp/csharp_comment_single.actual
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
// TODO: Maybe later
// TODO: Implement more features
// TODO: Implement more features
//
4 changes: 3 additions & 1 deletion lexers/testdata/csharp/csharp_comment_single.expected
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[
{"type":"CommentSingle","value":"// TODO: Maybe later"},
{"type":"Text","value":"\n"},
{"type":"CommentSingle","value":"// TODO: Implement more features"}
{"type":"CommentSingle","value":"// TODO: Implement more features"},
{"type":"Text","value":"\n"},
{"type":"CommentSingle","value":"//"}
]
1 change: 1 addition & 0 deletions lexers/testdata/csharp/csharp_comment_summary.actual
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <summary>
/// Class <c>Point</c> models a point in a two-dimensional plane.
///
/// </summary>
2 changes: 2 additions & 0 deletions lexers/testdata/csharp/csharp_comment_summary.expected
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
{"type":"Text","value":"\n"},
{"type":"CommentSpecial","value":"/// Class \u003cc\u003ePoint\u003c/c\u003e models a point in a two-dimensional plane."},
{"type":"Text","value":"\n"},
{"type":"CommentSpecial","value":"///"},
{"type":"Text","value":"\n"},
{"type":"CommentSpecial","value":"/// \u003c/summary\u003e"}
]