Hi, I am trying to highlight a custom language in TextMate. However, the following definition does not highlight PHP insertions (I do select it for my *.serpent files):
{ scopeName = 'source.serpent';
fileTypes = ( 'serpent' );
patterns = (
{ begin = '<\?';
end = '\?>';
patterns = ( { include = 'source.php'; } );
},
);
}
If I select PHP language, then the PHP parts are highlighted.
What can be the reason? Should it work?
I was also considering ruby insertions with <% %> delimiters, but it doesn't work with the simplest setup.
Update
Apparently, it is an issue of PHP only. The following language definition highlights Ruby and Serpent languages in my text, but not PHP insertions! What the hell is wrong here?
{ scopeName = 'source.phpruby.serpent';
fileTypes = ( 'serpent', 'serpent.php', 'serpent.erb' );
patterns = (
{ begin = '<\?(php|=)?';
end = '\?>';
patterns = ( { include = 'source.php'; } );
},
{ begin = '<%';
end = '%>';
patterns = ( { include = 'source.ruby'; } );
},
{ include = 'source.serpent'; },
);
}
I have made it working by replacing source.php with #language in my patterns and by copying the repository from PHP language.