[TxMt] Re: Colorize the name of the loops in Fortran
guerom00
romain.guerout at stud.unibas.ch
Sat Sep 16 12:59:38 UTC 2006
Allan Odgaard <throw-away-1 at ...> writes:
>
> On 15/9/2006, at 18:02, guerom00 wrote:
>
> > [...] I tried to
> > give a scope to those loop names but
> > with my poor knowledge of RegExp,
> > I cannot achieve something satisfactory...
>
> So you want the language grammar to scope labels?
>
> A regexp like: ^[A-Za-z_]+: should match them, assuming here labels
> can only hold those characters.
>
>
Thank you very much, Allan. So here is
what I did :
{ match = '(^[\t ]*)([A-Za-z_]+)(\s*:\b)';
captures = { 2 = { name = 'name.loop'; }; };
},
{ match = '(^[\t ]*(?i:enddo|endif|end\sdo|end\sif)\s*\b)([A-Za-z_]+)(\b.*$)';
captures = { 2 = { name = 'name.loop'; }; };
},
Here is a screenshot of what happens :
http://img96.imageshack.us/img96/5107/image1wn1.jpg
You see that's pretty much OK except for the
“enddo”, “endif” words which lose their color as they are
not anymore in the 'keyword.other.Executable.fortran'
scope...
Can anything be done about that ?
More information about the textmate
mailing list