userdiff style: declare patterns with consistent style
Change those patterns which were declared with a regex on the same line as the "PATTERNS()" line to put that regex on the next line, and add missing "/* -- */" separator comments between the pattern and word_regex. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Apr 8, 2021 at 17:04 UTC
6d1c9c527e5d2f4a00827ee2eac29709a1aff1ee
1 file changed
+15
-5
userdiff.c
+15
-5
@@ -44,7 +44,9 @@ PATTERNS("bash",
44
/* -- */
45
/* Characters not in the default $IFS value */
46
"[^ \t]+"),
47
-PATTERNS("bibtex", "(@[a-zA-Z]{1,}[ \t]*\\{{0,1}[ \t]*[^ \t\"@',\\#}{~%]*).*$",
47
+PATTERNS("bibtex",
48
+ "(@[a-zA-Z]{1,}[ \t]*\\{{0,1}[ \t]*[^ \t\"@',\\#}{~%]*).*$",
49
+ /* -- */
50
"[={}\"]|[^={}\" \t]+"),
51
PATTERNS("cpp",
52
/* Jump targets or access declarations */
@@ -121,7 +123,9 @@ IPATTERN("fortran",
123
* they would have been matched above as a variable anyway. */
124
"|[-+]?[0-9.]+([AaIiDdEeFfLlTtXx][Ss]?[-+]?[0-9.]*)?(_[a-zA-Z0-9][a-zA-Z0-9_]*)?"
125
"|//|\\*\\*|::|[/<>=]="),
124
-IPATTERN("fountain", "^((\\.[^.]|(int|ext|est|int\\.?/ext|i/e)[. ]).*)$",
126
+IPATTERN("fountain",
127
+ "^((\\.[^.]|(int|ext|est|int\\.?/ext|i/e)[. ]).*)$",
128
+ /* -- */
129
"[^ \t-]+"),
130
PATTERNS("golang",
131
/* Functions */
@@ -132,7 +136,9 @@ PATTERNS("golang",
136
"[a-zA-Z_][a-zA-Z0-9_]*"
137
"|[-+0-9.eE]+i?|0[xX]?[0-9a-fA-F]+i?"
138
"|[-+*/<>%&^|=!:]=|--|\\+\\+|<<=?|>>=?|&\\^=?|&&|\\|\\||<-|\\.{3}"),
135
-PATTERNS("html", "^[ \t]*(<[Hh][1-6]([ \t].*)?>.*)$",
139
+PATTERNS("html",
140
+ "^[ \t]*(<[Hh][1-6]([ \t].*)?>.*)$",
141
+ /* -- */
142
"[^<>= \t]+"),
143
PATTERNS("java",
144
"!^[ \t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\n"
@@ -144,6 +150,7 @@ PATTERNS("java",
150
"|--|\\+\\+|<<=?|>>>?=?|&&|\\|\\|"),
151
PATTERNS("markdown",
152
"^ {0,3}#{1,6}[ \t].*",
153
+ /* -- */
154
"[^<>= \t]+"),
155
PATTERNS("matlab",
156
/*
@@ -152,6 +159,7 @@ PATTERNS("matlab",
159
* that is understood by both.
160
*/
161
"^[[:space:]]*((classdef|function)[[:space:]].*)$|^(%%%?|##)[[:space:]].*$",
162
+ /* -- */
163
"[a-zA-Z_][a-zA-Z0-9_]*|[-+0-9.e]+|[=~<>]=|\\.[*/\\^']|\\|\\||&&"),
164
PATTERNS("objc",
165
/* Negate C statements that can look like functions */
@@ -212,13 +220,15 @@ PATTERNS("php",
220
"[a-zA-Z_][a-zA-Z0-9_]*"
221
"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+"
222
"|[-+*/<>%&^|=!.]=|--|\\+\\+|<<=?|>>=?|===|&&|\\|\\||::|->"),
215
-PATTERNS("python", "^[ \t]*((class|(async[ \t]+)?def)[ \t].*)$",
223
+PATTERNS("python",
224
+ "^[ \t]*((class|(async[ \t]+)?def)[ \t].*)$",
225
/* -- */
226
"[a-zA-Z_][a-zA-Z0-9_]*"
227
"|[-+0-9.e]+[jJlL]?|0[xX]?[0-9a-fA-F]+[lL]?"
228
"|[-+*/<>%&^|=!]=|//=?|<<=?|>>=?|\\*\\*=?"),
229
/* -- */
221
-PATTERNS("ruby", "^[ \t]*((class|module|def)[ \t].*)$",
230
+PATTERNS("ruby",
231
+ "^[ \t]*((class|module|def)[ \t].*)$",
232
/* -- */
233
"(@|@@|\\$)?[a-zA-Z_][a-zA-Z0-9_]*"
234
"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+|\\?(\\\\C-)?(\\\\M-)?."