threads / patch / 26255

patchuserdiff: match Pascal class methods

Subject: [PATCH] userdiff: match Pascal class methods

## tl;dr

3 messages between Jan 11, 2011 and Jan 11, 2011. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Alexey Shumkin· Jan 11, 2011, 08:53 UTC · lore
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(-)
Show changes to userdiff.c +1 −1
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· Jan 11, 2011, 19:13 UTC · re: Alexey Shumkin · lore

Re: [PATCH] userdiff: match Pascal class methods

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?

Алексей Шумкин· Jan 11, 2011, 19:50 UTC · re: Junio C Hamano · lore

Re[2]: [PATCH] userdiff: match Pascal class methods

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

← back to recent threads