diff mbox series

Add support for C# record types

Message ID pull.971.git.git.1614646689506.gitgitgadget@gmail.com (mailing list archive)
State New
Headers show
Series Add support for C# record types | expand

Commit Message

Julian Verdurmen March 2, 2021, 12:58 a.m. UTC
From: Julian Verdurmen <julian.verdurmen@outlook.com>

Records are added in C# 9

Code example :

    public record Person(string FirstName, string LastName);

For more information, see:
* https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-9

Signed-off-by: Julian Verdurmen <julian.verdurmen@outlook.com>
---
    userdiff.c: Added support for record types in C#
    
    Support for C# 9 records. See
    https://docs.microsoft.com/en-us/dotnet/csharp/tutorials/exploration/records
    
    I will try to use gitgitgadget [https://gitgitgadget.github.io/]

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-971%2F304NotModified%2Fcsharp-record-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-971/304NotModified/csharp-record-v1
Pull-Request: https://github.com/git/git/pull/971

 userdiff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 328c10930387d301560f7cbcd3351cc485a13381
diff mbox series

Patch

diff --git a/userdiff.c b/userdiff.c
index 3f81a2261c5e..2803683c3117 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -212,7 +212,7 @@  PATTERNS("csharp",
 	 /* Properties */
 	 "^[ \t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe)[ \t]+)*[][<>@.~_[:alnum:]]+[ \t]+[@._[:alnum:]]+)[ \t]*$\n"
 	 /* Type definitions */
-	 "^[ \t]*(((static|public|internal|private|protected|new|unsafe|sealed|abstract|partial)[ \t]+)*(class|enum|interface|struct)[ \t]+.*)$\n"
+	 "^[ \t]*(((static|public|internal|private|protected|new|unsafe|sealed|abstract|partial)[ \t]+)*(class|enum|interface|struct|record)[ \t]+.*)$\n"
 	 /* Namespace */
 	 "^[ \t]*(namespace[ \t]+.*)$",
 	 /* -- */