[TxMt] C Syntax
Allan Odgaard
throw-away-1 at macromates.com
Tue Nov 15 01:04:27 UTC 2005
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.
More information about the textmate
mailing list