{"thread":{"id":"25526","subject":"[PATCH] userdiff.c: Improve builtin csharp regex patterns.","startedAt":"2010-10-22T16:31:43Z","lastAt":"2010-10-22T16:31:43Z","messageCount":1,"participants":["Tor Arvid Lund"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"154169","messageId":"1287765103-3778-1-git-send-email-torarvid@gmail.com","threadId":"25526","inReplyTo":null,"subject":"[PATCH] userdiff.c: Improve builtin csharp regex patterns.","fromName":"Tor Arvid Lund","fromEmail":"torarvid@gmail.com","sentAt":"2010-10-22T16:31:43Z","receivedAt":"2010-10-22T16:31:43Z","isPatch":true,"sender":{"key":"torarvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/439758?v=4"},"body":"This fixes the case where you have a c# method on the form:\n\npublic Dictionary<int, string> GetSomeMap()\n\nThe previous regex did not support generic syntax with more than one\ntype parameter. This patch basically copies the regex used for methods, and\nadds the requirement that it has a MethodName<.*> pattern where the .* can\ncontain Comma, Space and Tab.\n\nSigned-off-by: Tor Arvid Lund <torarvid@gmail.com>\n---\nMaybe someone can optimize this, or merge it with the \"Methods and\nconstructors\" pattern in a nice way. It seemed to solve my itch, at least...\n\n userdiff.c |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/userdiff.c b/userdiff.c\nindex f9e05b5..06d8077 100644\n--- a/userdiff.c\n+++ b/userdiff.c\n@@ -103,6 +103,8 @@ PATTERNS(\"csharp\",\n \t \"!^[ \\t]*(do|while|for|if|else|instanceof|new|return|switch|case|throw|catch|using)\\n\"\n \t /* Methods and constructors */\n \t \"^[ \\t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe)[ \\t]+)*[][<>@.~_[:alnum:]]+[ \\t]+[<>@._[:alnum:]]+[ \\t]*\\\\(.*\\\\))[ \\t]*$\\n\"\n+\t /* Generic methods */\n+\t \"^[ \\t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe)[ \\t]+)*[][@._[:alnum:]]+<[<>@., \\t[:alnum:]]+>[ \\t]+[@._[:alnum:]]+(<[<>@., \\t[:alnum:]]+>)?[ \\t]*\\\\(.*\\\\))[ \\t]*$\\n\"\n \t /* Properties */\n \t \"^[ \\t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe)[ \\t]+)*[][<>@.~_[:alnum:]]+[ \\t]+[@._[:alnum:]]+)[ \\t]*$\\n\"\n \t /* Type definitions */\n-- \n1.7.3.GIT\n"}]}