I am trying to highlight a custom language in TextMate. However, the following definition does not highlight PHP insertions:
{ scopeName = 'source.serpent';
fileTypes = ( 'serpent' );
patterns = (
{ begin = '<\?';
end = '\?>';
patterns = ( { include = 'source.php'; } );
},
);
}
What can be the reason?
Update
Well, I was too naive to expect that the above definition will refer to the PHP language definition.Apparently, in order to highlight PHP insertions, one have to copy a significant part of the PHP language rules to the new language. And if I would like to use Ruby insertions as well, then it gets really messy.
So, I would like to ask if it is possible to REFER to (NOT to copy!) PHP or Ruby definitions from my new language (serpent) definition. It would make it clear and reduce duplication.
Update2
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'; },
);
}