[TxMt] syntax highlighting in perl bundle

Barry Walsh baz at draegtun.com
Thu Jun 5 19:22:50 UTC 2008


Here a hack I've just tried and it seems to work (though don't be 
surprised if colouring falls over elsewhere!)


1. Bring up Bundle Editor -> Edit Languages -> Perl

2. Copy the bareword grammar (pasted below) so that it gets higher 
precedence than regex.replace thats causing the problem (see my other 
email)

        {   name = 'constant.other.bareword.perl';
            match = '(?<={)\s*\w+\s*(?=})';
        },


Here whats the top of my Perl syntax grammar now looks like....

{    scopeName = 'source.perl';
    comment = '
    TODO:    Include RegExp syntax
';
    firstLineMatch = '^#!.*\bperl\b';
    fileTypes = ( 'pl', 'pm', 'pod', 't', 'PL' );
    foldingStartMarker = '(/\*|(\{|\[|\()\s*$)';
    foldingStopMarker = '(\*/|^\s*(\}|\]|\)))';
    patterns = (
        {    include = '#line_comment'; },
        {    name = 'constant.other.bareword.perl';
            match = '(?<={)\s*\w+\s*(?=})';
        },
        {    name = 'comment.block.documentation.perl';
            begin = '^=';
            end = '^=cut';
            captures = { 0 = { name = 
'punctuation.definition.comment.perl'; }; };
        },


BTW... that TODO: was already in there ;-)

PS.  For more info on syntax grammar click on the ? button on the this 
bundles editor page.



bin at cox.net wrote:
> i'm new to textmate so i know nothing.  if i had the slightest idea of 
> how to fix the highlighting, i would.
>
> tom
>
>
> ______________________________________________________________________
> 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
>




More information about the textmate mailing list