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>
This commit is contained in:

committed by
Junio C Hamano

parent
ddd164d026
commit
6d1c9c527e
20
userdiff.c
20
userdiff.c
@ -44,7 +44,9 @@ PATTERNS("bash",
|
|||||||
/* -- */
|
/* -- */
|
||||||
/* Characters not in the default $IFS value */
|
/* Characters not in the default $IFS value */
|
||||||
"[^ \t]+"),
|
"[^ \t]+"),
|
||||||
PATTERNS("bibtex", "(@[a-zA-Z]{1,}[ \t]*\\{{0,1}[ \t]*[^ \t\"@',\\#}{~%]*).*$",
|
PATTERNS("bibtex",
|
||||||
|
"(@[a-zA-Z]{1,}[ \t]*\\{{0,1}[ \t]*[^ \t\"@',\\#}{~%]*).*$",
|
||||||
|
/* -- */
|
||||||
"[={}\"]|[^={}\" \t]+"),
|
"[={}\"]|[^={}\" \t]+"),
|
||||||
PATTERNS("cpp",
|
PATTERNS("cpp",
|
||||||
/* Jump targets or access declarations */
|
/* Jump targets or access declarations */
|
||||||
@ -121,7 +123,9 @@ IPATTERN("fortran",
|
|||||||
* they would have been matched above as a variable anyway. */
|
* they would have been matched above as a variable anyway. */
|
||||||
"|[-+]?[0-9.]+([AaIiDdEeFfLlTtXx][Ss]?[-+]?[0-9.]*)?(_[a-zA-Z0-9][a-zA-Z0-9_]*)?"
|
"|[-+]?[0-9.]+([AaIiDdEeFfLlTtXx][Ss]?[-+]?[0-9.]*)?(_[a-zA-Z0-9][a-zA-Z0-9_]*)?"
|
||||||
"|//|\\*\\*|::|[/<>=]="),
|
"|//|\\*\\*|::|[/<>=]="),
|
||||||
IPATTERN("fountain", "^((\\.[^.]|(int|ext|est|int\\.?/ext|i/e)[. ]).*)$",
|
IPATTERN("fountain",
|
||||||
|
"^((\\.[^.]|(int|ext|est|int\\.?/ext|i/e)[. ]).*)$",
|
||||||
|
/* -- */
|
||||||
"[^ \t-]+"),
|
"[^ \t-]+"),
|
||||||
PATTERNS("golang",
|
PATTERNS("golang",
|
||||||
/* Functions */
|
/* Functions */
|
||||||
@ -132,7 +136,9 @@ PATTERNS("golang",
|
|||||||
"[a-zA-Z_][a-zA-Z0-9_]*"
|
"[a-zA-Z_][a-zA-Z0-9_]*"
|
||||||
"|[-+0-9.eE]+i?|0[xX]?[0-9a-fA-F]+i?"
|
"|[-+0-9.eE]+i?|0[xX]?[0-9a-fA-F]+i?"
|
||||||
"|[-+*/<>%&^|=!:]=|--|\\+\\+|<<=?|>>=?|&\\^=?|&&|\\|\\||<-|\\.{3}"),
|
"|[-+*/<>%&^|=!:]=|--|\\+\\+|<<=?|>>=?|&\\^=?|&&|\\|\\||<-|\\.{3}"),
|
||||||
PATTERNS("html", "^[ \t]*(<[Hh][1-6]([ \t].*)?>.*)$",
|
PATTERNS("html",
|
||||||
|
"^[ \t]*(<[Hh][1-6]([ \t].*)?>.*)$",
|
||||||
|
/* -- */
|
||||||
"[^<>= \t]+"),
|
"[^<>= \t]+"),
|
||||||
PATTERNS("java",
|
PATTERNS("java",
|
||||||
"!^[ \t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\n"
|
"!^[ \t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\n"
|
||||||
@ -144,6 +150,7 @@ PATTERNS("java",
|
|||||||
"|--|\\+\\+|<<=?|>>>?=?|&&|\\|\\|"),
|
"|--|\\+\\+|<<=?|>>>?=?|&&|\\|\\|"),
|
||||||
PATTERNS("markdown",
|
PATTERNS("markdown",
|
||||||
"^ {0,3}#{1,6}[ \t].*",
|
"^ {0,3}#{1,6}[ \t].*",
|
||||||
|
/* -- */
|
||||||
"[^<>= \t]+"),
|
"[^<>= \t]+"),
|
||||||
PATTERNS("matlab",
|
PATTERNS("matlab",
|
||||||
/*
|
/*
|
||||||
@ -152,6 +159,7 @@ PATTERNS("matlab",
|
|||||||
* that is understood by both.
|
* that is understood by both.
|
||||||
*/
|
*/
|
||||||
"^[[:space:]]*((classdef|function)[[:space:]].*)$|^(%%%?|##)[[:space:]].*$",
|
"^[[:space:]]*((classdef|function)[[:space:]].*)$|^(%%%?|##)[[:space:]].*$",
|
||||||
|
/* -- */
|
||||||
"[a-zA-Z_][a-zA-Z0-9_]*|[-+0-9.e]+|[=~<>]=|\\.[*/\\^']|\\|\\||&&"),
|
"[a-zA-Z_][a-zA-Z0-9_]*|[-+0-9.e]+|[=~<>]=|\\.[*/\\^']|\\|\\||&&"),
|
||||||
PATTERNS("objc",
|
PATTERNS("objc",
|
||||||
/* Negate C statements that can look like functions */
|
/* Negate C statements that can look like functions */
|
||||||
@ -212,13 +220,15 @@ PATTERNS("php",
|
|||||||
"[a-zA-Z_][a-zA-Z0-9_]*"
|
"[a-zA-Z_][a-zA-Z0-9_]*"
|
||||||
"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+"
|
"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+"
|
||||||
"|[-+*/<>%&^|=!.]=|--|\\+\\+|<<=?|>>=?|===|&&|\\|\\||::|->"),
|
"|[-+*/<>%&^|=!.]=|--|\\+\\+|<<=?|>>=?|===|&&|\\|\\||::|->"),
|
||||||
PATTERNS("python", "^[ \t]*((class|(async[ \t]+)?def)[ \t].*)$",
|
PATTERNS("python",
|
||||||
|
"^[ \t]*((class|(async[ \t]+)?def)[ \t].*)$",
|
||||||
/* -- */
|
/* -- */
|
||||||
"[a-zA-Z_][a-zA-Z0-9_]*"
|
"[a-zA-Z_][a-zA-Z0-9_]*"
|
||||||
"|[-+0-9.e]+[jJlL]?|0[xX]?[0-9a-fA-F]+[lL]?"
|
"|[-+0-9.e]+[jJlL]?|0[xX]?[0-9a-fA-F]+[lL]?"
|
||||||
"|[-+*/<>%&^|=!]=|//=?|<<=?|>>=?|\\*\\*=?"),
|
"|[-+*/<>%&^|=!]=|//=?|<<=?|>>=?|\\*\\*=?"),
|
||||||
/* -- */
|
/* -- */
|
||||||
PATTERNS("ruby", "^[ \t]*((class|module|def)[ \t].*)$",
|
PATTERNS("ruby",
|
||||||
|
"^[ \t]*((class|module|def)[ \t].*)$",
|
||||||
/* -- */
|
/* -- */
|
||||||
"(@|@@|\\$)?[a-zA-Z_][a-zA-Z0-9_]*"
|
"(@|@@|\\$)?[a-zA-Z_][a-zA-Z0-9_]*"
|
||||||
"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+|\\?(\\\\C-)?(\\\\M-)?."
|
"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+|\\?(\\\\C-)?(\\\\M-)?."
|
||||||
|
Reference in New Issue
Block a user