Skip to content

Commit

Permalink
C#: Allow for empty comments (#943)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gusted committed Mar 4, 2024
1 parent fe5dde8 commit 4e60c81
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lexers/embedded/c#.xml
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
@@ -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
@@ -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
@@ -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
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"}
]

0 comments on commit 4e60c81

Please sign in to comment.