[TxMt] C Syntax

Oscar Bonilla ob at bitmover.com
Tue Nov 15 03:11:06 UTC 2005


Cool. Thanks.

On Nov 14, 2005, at 5:04 PM, Allan Odgaard wrote:

> On 10/11/2005, at 23.29, Oscar Bonilla wrote:
>
>> [...] What would be the appropriate regexp for making it work in  
>> both cases?
>
> Rob Rix worked it out (and I refined it slightly :) ):
>
> {	name = 'declaration.function.c';
> 	begin = '(?:^|(?<=[\w*&>])(?<!else|new|&&)\s+)([A-Za-z_][A-Za- 
> z0-9_:]+)\s*\((?=[^)]*\)(\s+const)?\s*(\{|\n))';
> 	end = '\)';
> 	beginCaptures = { 1 = { name = 'entity.name.function.c'; }; };
> 	patterns = ( { include = "$base"; } );
> },
>
> It works pretty well — and it'll be part of the syntax with next  
> build.
>
>
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate

--
pgp fingerprint: BC64 2E7A CAEF 39E1 9544  80CA F7D5 784D FB46 16C1




More information about the textmate mailing list