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

2013-03-23 Thread Vadim Zeitlin
Andreas Schwab linux-m68k.org> writes: > Vadim Zeitlin 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 to change

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

2013-03-23 Thread Andreas Schwab
Vadim Zeitlin 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 completely diffe

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

2013-03-22 Thread Vadim Zeitlin
Johannes Sixt 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 i

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 writes: > >> Am 22.03.2013 16:02, schrieb Junio C Hamano: >>> Vadim Zeitlin writes: >>> A C++ method start such as void foo::bar() wasn't recognized by cpp diff driver as it mistakenly incl

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

2013-03-22 Thread Junio C Hamano
Johannes Sixt writes: > Am 22.03.2013 16:02, schrieb Junio C Hamano: >> Vadim Zeitlin 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

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

2013-03-22 Thread Johannes Sixt
Am 22.03.2013 16:02, schrieb Junio C Hamano: > Vadim Zeitlin 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 anothe

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

2013-03-22 Thread Vadim Zeitlin
Junio C Hamano pobox.com> writes: > > Vadim Zeitlin 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
Vadim Zeitlin 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 correctly det

[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. Sig