Re: [PATCH] Avoid false positives in label detection in cpp diff hunk header regex.

2013-03-23 Thread Andreas Schwab
Vadim Zeitlin vz-...@zeitlins.org writes: !^[ \t]*[A-Za-z_][A-Za-z_0-9]+[ \t]*:([^:]|$)\n That would fail to match single-character identifiers. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something

Re: [PATCH] Avoid false positives in label detection in cpp diff hunk header regex.

2013-03-23 Thread Vadim Zeitlin
Andreas Schwab schwab at linux-m68k.org writes: Vadim Zeitlin vz-git at zeitlins.org writes: !^[ \t]*[A-Za-z_][A-Za-z_0-9]+[ \t]*:([^:]|$)\n That would fail to match single-character identifiers. Oops, yes, you're right, of course, sorry. I have no idea why did I write that we needed

[PATCH] Avoid false positives in label detection in cpp diff hunk header regex.

2013-03-22 Thread Vadim Zeitlin
A C++ method start such as void foo::bar() wasn't recognized by cpp diff driver as it mistakenly included foo::bar as a label. However the colon in a label can't be followed by another colon, so recognize this case specially to correctly detect C++ methods using this style.

Re: [PATCH] Avoid false positives in label detection in cpp diff hunk header regex.

2013-03-22 Thread Junio C Hamano
Vadim Zeitlin vz-...@zeitlins.org writes: A C++ method start such as void foo::bar() wasn't recognized by cpp diff driver as it mistakenly included foo::bar as a label. However the colon in a label can't be followed by another colon, so recognize this case specially to

Re: [PATCH] Avoid false positives in label detection in cpp diff hunk header regex.

2013-03-22 Thread Vadim Zeitlin
Junio C Hamano gitster at pobox.com writes: Vadim Zeitlin vz-git at zeitlins.org writes: ... diff --git a/userdiff.c b/userdiff.c index ea43a03..9415586 100644 --- a/userdiff.c +++ b/userdiff.c @@ -125,7 +125,7 @@ PATTERNS(tex, ^(((sub)*section|chapter|part)\\*{0,1}\\{.*)$,

Re: [PATCH] Avoid false positives in label detection in cpp diff hunk header regex.

2013-03-22 Thread Junio C Hamano
Johannes Sixt j...@kdbg.org writes: Am 22.03.2013 16:02, schrieb Junio C Hamano: Vadim Zeitlin vz-...@zeitlins.org writes: A C++ method start such as void foo::bar() wasn't recognized by cpp diff driver as it mistakenly included foo::bar as a label. However the colon

Re: [PATCH] Avoid false positives in label detection in cpp diff hunk header regex.

2013-03-22 Thread Johannes Sixt
Am 22.03.2013 23:32, schrieb Junio C Hamano: Johannes Sixt j...@kdbg.org writes: Am 22.03.2013 16:02, schrieb Junio C Hamano: Vadim Zeitlin vz-...@zeitlins.org writes: A C++ method start such as void foo::bar() wasn't recognized by cpp diff driver as it mistakenly

Re: [PATCH] Avoid false positives in label detection in cpp diff hunk header regex.

2013-03-22 Thread Vadim Zeitlin
Johannes Sixt j6t at kdbg.org writes: I also wonder if label : should also be caught, or is it too weird format to be worth supporting? It's easy to support, by inserting another [ \t] before the first colon. So, why not? This is really nitpicking, but if we do it, then