# [PATCH] userdiff: match Pascal class methods

3 messages from 2011-01-11 to 2011-01-11. Participants: Alexey Shumkin, Junio C Hamano, Алексей Шумкин.
Thread: https://gitlist.dev/t/26255

## Alexey Shumkin, 2011-01-11 08:53

Subject: [PATCH] userdiff: match Pascal class methods
Message-ID: <1294736039-5912-1-git-send-email-zapped@mail.ru>
URL: https://gitlist.dev/e/1294736039-5912-1-git-send-email-zapped%40mail.ru

```
Class declarations were already covered by the second pattern, but class methods have the 'class' keyword in front too. Account for it.

Signed-off-by: Alexey Shumkin <zapped@mail.ru>
Acked-by: Thomas Rast <trast@student.ethz.ch>
---
 userdiff.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/userdiff.c b/userdiff.c
index f9e05b5..259a382 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -52,7 +52,7 @@ PATTERNS("objc",
 	 "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->"
 	 "|[^[:space:]]|[\x80-\xff]+"),
 PATTERNS("pascal",
-	 "^((procedure|function|constructor|destructor|interface|"
+	 "^(((class[ \t]+)?(procedure|function)|constructor|destructor|interface|"
 		"implementation|initialization|finalization)[ \t]*.*)$"
 	 "\n"
 	 "^(.*=[ \t]*(class|record).*)$",
-- 
1.7.3.4.3.g3f811

```

## Junio C Hamano, 2011-01-11 19:13

Subject: Re: [PATCH] userdiff: match Pascal class methods
Message-ID: <7vipxv45ky.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vipxv45ky.fsf%40alter.siamese.dyndns.org
In-Reply-To: <1294736039-5912-1-git-send-email-zapped@mail.ru>

```
Alexey Shumkin <zapped@mail.ru> writes:

> Class declarations were already covered by the second pattern, but class methods have the 'class' keyword in front too. Account for it.

Too long a line (which I could re-wrap locally but I'd rather not be in
the business of doing that for everybody).

>  PATTERNS("pascal",
> -	 "^((procedure|function|constructor|destructor|interface|"
> +	 "^(((class[ \t]+)?(procedure|function)|constructor|destructor|interface|"
>  		"implementation|initialization|finalization)[ \t]*.*)$"

Earlier we took "^procedure frotz", "^function frotz", etc. and now we
also take "^class procedure frotz", "^class function frotz", but not
"^class constructor frotz"---am I reading the patterns correctly?

```

## Алексей Шумкин, 2011-01-11 19:50

Subject: Re[2]: [PATCH] userdiff: match Pascal class methods
Message-ID: <1093185322.20110111225059@mail.ru>
URL: https://gitlist.dev/e/1093185322.20110111225059%40mail.ru
In-Reply-To: <7vipxv45ky.fsf@alter.siamese.dyndns.org>

```
JCH> Alexey Shumkin <zapped@mail.ru> writes:

>> Class declarations were already covered by the second pattern, but class methods have the 'class' keyword in front too. Account for it.

JCH> Too long a line (which I could re-wrap locally but I'd rather not be in
JCH> the business of doing that for everybody).
Ooh, I'm sorry

>>  PATTERNS("pascal",
>> -      "^((procedure|function|constructor|destructor|interface|"
>> +      "^(((class[ \t]+)?(procedure|function)|constructor|destructor|interface|"
>>               "implementation|initialization|finalization)[ \t]*.*)$"
JCH> Earlier we took "^procedure frotz", "^function frotz", etc. and now we
JCH> also take "^class procedure frotz", "^class function frotz", but not
JCH> "^class constructor frotz"---am I reading the patterns correctly?
Yes, you're reading correctly. 'class' keyword might precede only
'procedure' or 'function' keyword but not the other ones

```
