Teach "git diff -p" Pascal/Delphi funcname pattern
Finds classes, records, functions, procedures, and sections. Most lines need to start at the first column, or else there's no way to differentiate a procedure's definition from its declaration. Signed-off-by: Avery Pennarun <apenwarr@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
ad8c1d9260
commit
b50005b79f
6
diff.c
6
diff.c
@ -1380,6 +1380,12 @@ static struct builtin_funcname_pattern {
|
|||||||
"^[ ]*\\(\\([ ]*"
|
"^[ ]*\\(\\([ ]*"
|
||||||
"[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}"
|
"[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}"
|
||||||
"[ ]*([^;]*\\)$" },
|
"[ ]*([^;]*\\)$" },
|
||||||
|
{ "pascal", "^\\(\\(procedure\\|function\\|constructor\\|"
|
||||||
|
"destructor\\|interface\\|implementation\\|"
|
||||||
|
"initialization\\|finalization\\)[ \t]*.*\\)$"
|
||||||
|
"\\|"
|
||||||
|
"^\\(.*=[ \t]*\\(class\\|record\\).*\\)$"
|
||||||
|
},
|
||||||
{ "tex", "^\\(\\\\\\(sub\\)*section{.*\\)$" },
|
{ "tex", "^\\(\\\\\\(sub\\)*section{.*\\)$" },
|
||||||
{ "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" },
|
{ "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" },
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user