summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorAvery Pennarun <apenwarr@gmail.com>2008-08-01 21:00:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-08-02 22:39:35 (GMT)
commitb50005b79f6c77f9846c3f34ba319675fe489b72 (patch)
treed88724db75a089f217a4e85ea6ccbb5e1439a01a /diff.c
parentad8c1d92600da963692d57c213979e638c357f1a (diff)
downloadgit-b50005b79f6c77f9846c3f34ba319675fe489b72.zip
git-b50005b79f6c77f9846c3f34ba319675fe489b72.tar.gz
git-b50005b79f6c77f9846c3f34ba319675fe489b72.tar.bz2
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>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index c253015..75a8b16 100644
--- a/diff.c
+++ b/diff.c
@@ -1380,6 +1380,12 @@ static struct builtin_funcname_pattern {
"^[ ]*\\(\\([ ]*"
"[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{.*\\)$" },
{ "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" },
};