Re: [PATCH] Teach git diff about Objective-C syntax

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 17, 2008 at 12:06 PM, Johannes Schindelin
<Johannes.Schindelin@xxxxxx> wrote:
> Hi,
>
> On Wed, 17 Sep 2008, Jonathan del Strother wrote:
>
>> -                     "^[     ]*\\(\\([       ]*"
>> +                     "^[ \t]*\\(\\([ \t]*"
>
> Why?
>
>>                       "[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}"
>> -                     "[      ]*([^;]*\\)$" },
>> +                     "[ \t]*([^;]*\\)$" },
>> +
>> +     { "objc", "![ \t]*\\(do\\|for\\|if\\|else\\|return\\|switch\\|while\\)\n" /* Negate C statements that can look like functions */
>> +                     "^[ \t]*\\([-+][ \t]*([ \t]*[A-Za-z_][A-Za-z_0-9]*.*).*\\)$" /* Objective-C methods */
>
> I see you still have these awfully long lines.

I was hoping I'd get away with it since the overlong parts are just comments...

You'd prefer something like
	{ "objc",
			/* Negate C statements that can look like functions */
			"![ \t]*\\(do\\|for\\|if\\|else\\|return\\|switch\\|while\\)\n"
			/* Objective-C methods */
			"^[ \t]*\\([-+][ \t]*([ \t]*[A-Za-z_][A-Za-z_0-9]*.*).*\\)$"
			"\\|"
			/* C functions */
			"^[ \t]*\\(\\([ \t]*[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}[ \t]*([^;]*\\)$"
			"\\|"
			/* Objective-C class/protocol definitions */
			"^@\\(implementation\\|interface\\|protocol\\).*"},

?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux