Merge branch 'bc/maint-diff-hunk-header-fix' into bc/master-diff-hunk-header-fix

* bc/maint-diff-hunk-header-fix:
  diff: use extended regexp to find hunk headers

Conflicts:
	diff.c
This commit is contained in:
Junio C Hamano 2008-09-19 23:51:01 -07:00
commit cd0843198f

31
diff.c
View file

@ -1404,23 +1404,26 @@ static const struct funcname_pattern_entry *funcname_pattern(const char *ident)
} }
static const struct funcname_pattern_entry builtin_funcname_pattern[] = { static const struct funcname_pattern_entry builtin_funcname_pattern[] = {
{ "bibtex", "\\(@[a-zA-Z]\\{1,\\}[ \t]*{\\{0,1\\}[ \t]*[^ \t\"@',\\#}{~%]*\\).*$", 0 }, { "bibtex", "(@[a-zA-Z]{1,}[ \t]*\{{0,1}[ \t]*[^ \t\"@',\\#}{~%]*).*$",
REG_EXTENDED },
{ "html", "^\\s*\\(<[Hh][1-6]\\s.*>.*\\)$", 0 }, { "html", "^\\s*\\(<[Hh][1-6]\\s.*>.*\\)$", 0 },
{ "java", "!^[ ]*\\(catch\\|do\\|for\\|if\\|instanceof\\|" { "java",
"new\\|return\\|switch\\|throw\\|while\\)\n" "!^[ \t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\n"
"^[ ]*\\(\\([ ]*" "^[ \t]*(([ \t]*[A-Za-z_][A-Za-z_0-9]*){2,}[ \t]*\\([^;]*)$",
"[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}" REG_EXTENDED },
"[ ]*([^;]*\\)$", 0 }, { "pascal",
{ "pascal", "^\\(\\(procedure\\|function\\|constructor\\|" "^((procedure|function|constructor|destructor|interface|"
"destructor\\|interface\\|implementation\\|" "implementation|initialization|finalization)[ \t]*.*)$"
"initialization\\|finalization\\)[ \t]*.*\\)$" "|"
"\\|" "^(.*=[ \t]*(class|record).*)$",
"^\\(.*=[ \t]*\\(class\\|record\\).*\\)$", REG_EXTENDED },
0 },
{ "php", "^[\t ]*\\(\\(function\\|class\\).*\\)", 0 }, { "php", "^[\t ]*\\(\\(function\\|class\\).*\\)", 0 },
{ "python", "^\\s*\\(\\(class\\|def\\)\\s.*\\)$", 0 }, { "python", "^\\s*\\(\\(class\\|def\\)\\s.*\\)$", 0 },
{ "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$", 0 }, { "ruby", "^[ \t]*((class|module|def)[ \t].*)$",
{ "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\{0,1\\}{.*\\)$", 0 }, REG_EXTENDED },
{ "tex",
"^(\\\\((sub)*section|chapter|part)\\*{0,1}\{.*)$",
REG_EXTENDED },
}; };
static const struct funcname_pattern_entry *diff_funcname_pattern(struct diff_filespec *one) static const struct funcname_pattern_entry *diff_funcname_pattern(struct diff_filespec *one)