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>
Avery Pennarun committed
Aug 1, 2008 at 17:00 UTC
b50005b79f6c77f9846c3f34ba319675fe489b72
1 file changed
+6
diff.c
+6
@@ -1380,6 +1380,12 @@ static struct builtin_funcname_pattern {
1380
"^[ ]*\\(\\([ ]*"
1381
"[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}"
1382
"[ ]*([^;]*\\)$" },
1383
+ { "pascal", "^\\(\\(procedure\\|function\\|constructor\\|"
1384
+ "destructor\\|interface\\|implementation\\|"
1385
+ "initialization\\|finalization\\)[ \t]*.*\\)$"
1386
+ "\\|"
1387
+ "^\\(.*=[ \t]*\\(class\\|record\\).*\\)$"
1388
+ },
1389
{ "tex", "^\\(\\\\\\(sub\\)*section{.*\\)$" },
1390
{ "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" },
1391
};