Thread (16 messages) flat view 16 messages, 2 authors, 2016-06-15

Re: [PATCH 1/2] update C# userdiff patterns

From: Marius Ungureanu <hidden>
Date: 2016-06-15 23:00:51
Subsystem: the rest · Maintainer: Linus Torvalds

Remove all keywords since they don't cause conflicts.

Add method modifiers: abstract, async, explicit, extern, implicit,
partial, operator.

Add properties modifiers: abstract, readonly.

Add type modifiers: abstract.

Parse C# operator functions.

Fix constructor parsing.

Signed-off-by: Marius Ungureanu <redacted>
---
 userdiff.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/userdiff.c b/userdiff.c
index fad52d6..e7ba5e3 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -133,14 +133,12 @@ PATTERNS("cpp",
 	 "|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lLuU]*"
 	 "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->\\*?|\\.\\*"),
 PATTERNS("csharp",
-	 /* Keywords */
-	 "!^[ \t]*(do|while|for|if|else|instanceof|new|return|switch|case|throw|catch|using)\n"
 	 /* Methods and constructors */
-	 "^[ \t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe)[ \t]+)*[][<>@.~_[:alnum:]]+[ \t]+[<>@._[:alnum:]]+[ \t]*\\(.*\\))[ \t]*$\n"
+	 "^[ \t]*(((abstract|async|explicit|extern|implicit|internal|new|operator|override|partial|private|protected|public|sealed|static|unsafe|virtual)[ \t]+)*[][<>@._[:alnum:]]*[ \t]*[-<>@.~=+!*%&|^_[:alnum:]]+[ \t]*\\(.*\\))[ \t]*$\n"
 	 /* Properties */
-	 "^[ \t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe)[ \t]+)*[][<>@.~_[:alnum:]]+[ \t]+[@._[:alnum:]]+)[ \t]*$\n"
+	 "^[ \t]*(((abstract|internal|new|override|private|protected|public|readonly|sealed|static|unsafe|virtual)[ \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]*(((abstract|internal|new|override|partial|private|protected|public|sealed|static|unsafe)[ \t]+)*(class|enum|interface|struct)[ \t]+.*)$\n"
 	 /* Namespace */
 	 "^[ \t]*(namespace[ \t]+.*)$",
 	 /* -- */
-- 
1.8.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help