Browse Source

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>
maint
Avery Pennarun 17 years ago committed by Junio C Hamano
parent
commit
b50005b79f
  1. 6
      diff.c

6
diff.c

@ -1380,6 +1380,12 @@ static struct builtin_funcname_pattern { @@ -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.*\\)$" },
};

Loading…
Cancel
Save