I am sorry for the confusion. In the last question (see below) I mean, that I create a new language definition for highlighting some text format with php/ruby insertions in TextMate. I don't care now how it looks in BundleEditor (that was another question).
On Tue, Jun 8, 2010 at 13:46, Tobias Jung newsgr@tobiasjung.net wrote:
nuke sila.razuma@gmail.com wrote (Mon, 7 Jun 2010 22:57:01 +0200):
Repeating my question: Thanks to your answers, I can now highlight PHP insertions in my custom language by copying the repository and delimiters pattern from PHP
language
definition. However, I would like to avoid this unnecessary duplication.
Is
it possible to simply refer the PHP definitions without copying them to
my
language?
Well, install the "Edit in TextMate" input manager...
Kind regards, Tobias Jung
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
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'; }, ); }
On Tue, Jun 8, 2010 at 14:10, nuke sila.razuma@gmail.com wrote:
I am sorry for the confusion. In the last question (see below) I mean, that I create a new language definition for highlighting some text format with php/ruby insertions in TextMate. I don't care now how it looks in BundleEditor (that was another question).
On Tue, Jun 8, 2010 at 13:46, Tobias Jung newsgr@tobiasjung.net wrote:
nuke sila.razuma@gmail.com wrote (Mon, 7 Jun 2010 22:57:01 +0200):
Repeating my question: Thanks to your answers, I can now highlight PHP insertions in my custom language by copying the repository and delimiters pattern from PHP
language
definition. However, I would like to avoid this unnecessary duplication.
Is
it possible to simply refer the PHP definitions without copying them to
my
language?
Well, install the "Edit in TextMate" input manager...
Kind regards, Tobias Jung
On 29 Jun 2010, at 14:23, nuke wrote:
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'; } ); },
We made the PHP grammar itself match the <?php … ?> construct, so with your grammar, those bits have been consumed by the including grammar, and the included PHP grammar will therefor be a no-op.
The reason we made it this way was so that the PHP grammar can sort of work when used as the root grammar, since lots of users insist on using it that way, despite our efforts¹ to educate ;)
¹ http://wiki.macromates.com/Troubleshooting/PHPSyntaxHighlight
Thank you, Allan! I appreciate your help, but I think you should not waste your invaluable time on such trivial questions, which can be answered by others. Even if they don't! :) The greatest among greatest, please, concentrate on TM2 :)
The working (at least highlighting!) definition is then:
{ scopeName = 'source.phpruby.serpent'; fileTypes = ( 'serpent', 'serpent.php', 'serpent.erb' ); patterns = ( { match = '<?(php|=)?.*?>'; captures = { 0 = { include = 'source.php'; }; }; }, { begin = '<%'; end = '%>'; patterns = ( { include = 'source.ruby'; } ); }, { include = 'source.serpent'; }, ); }
Thanks again!
On Fri, Jul 9, 2010 at 08:02, Allan Odgaard mailinglist@textmate.orgwrote:
On 29 Jun 2010, at 14:23, nuke wrote:
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'; } ); },
We made the PHP grammar itself match the <?php … ?> construct, so with your grammar, those bits have been consumed by the including grammar, and the included PHP grammar will therefor be a no-op.
The reason we made it this way was so that the PHP grammar can sort of work when used as the root grammar, since lots of users insist on using it that way, despite our efforts¹ to educate ;)
¹ http://wiki.macromates.com/Troubleshooting/PHPSyntaxHighlight
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
No, I does not work. The successful test was just due to a mess of language copies.
On Fri, Jul 9, 2010 at 18:28, nuke sila.razuma@gmail.com wrote:
Thank you, Allan! I appreciate your help, but I think you should not waste your invaluable time on such trivial questions, which can be answered by others. Even if they don't! :) The greatest among greatest, please, concentrate on TM2 :)
The working (at least highlighting!) definition is then:
{ scopeName = 'source.phpruby.serpent'; fileTypes = ( 'serpent', 'serpent.php', 'serpent.erb' ); patterns = ( { match = '<?(php|=)?.*?>'; captures = { 0 = { include = 'source.php'; }; }; }, { begin = '<%'; end = '%>'; patterns = ( { include = 'source.ruby'; } ); }, { include = 'source.serpent'; }, ); }
Thanks again!
On Fri, Jul 9, 2010 at 08:02, Allan Odgaard mailinglist@textmate.orgwrote:
On 29 Jun 2010, at 14:23, nuke wrote:
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'; } ); },
We made the PHP grammar itself match the <?php … ?> construct, so with your grammar, those bits have been consumed by the including grammar, and the included PHP grammar will therefor be a no-op.
The reason we made it this way was so that the PHP grammar can sort of work when used as the root grammar, since lots of users insist on using it that way, despite our efforts¹ to educate ;)
¹ http://wiki.macromates.com/Troubleshooting/PHPSyntaxHighlight
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Now it works. Sorry for the confusion
{ scopeName = 'source.phpruby.serpent'; fileTypes = ( 'serpent', 'serpent.php', 'serpent.erb' ); patterns = ( { begin = '<?(php|=|)'; end = '?>'; include = 'source.php'; }, { begin = '<%'; end = '%>'; patterns = ( { include = 'source.ruby'; } ); }, { include = 'source.serpent'; }, ); }
On Fri, Jul 9, 2010 at 20:05, nuke sila.razuma@gmail.com wrote:
No, I does not work. The successful test was just due to a mess of language copies.
On Fri, Jul 9, 2010 at 18:28, nuke sila.razuma@gmail.com wrote:
Thank you, Allan! I appreciate your help, but I think you should not waste your invaluable time on such trivial questions, which can be answered by others. Even if they don't! :) The greatest among greatest, please, concentrate on TM2 :)
The working (at least highlighting!) definition is then:
{ scopeName = 'source.phpruby.serpent'; fileTypes = ( 'serpent', 'serpent.php', 'serpent.erb' ); patterns = ( { match = '<?(php|=)?.*?>'; captures = { 0 = { include = 'source.php'; }; }; }, { begin = '<%'; end = '%>'; patterns = ( { include = 'source.ruby'; } ); }, { include = 'source.serpent'; }, ); }
Thanks again!
On Fri, Jul 9, 2010 at 08:02, Allan Odgaard mailinglist@textmate.orgwrote:
On 29 Jun 2010, at 14:23, nuke wrote:
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'; } ); },
We made the PHP grammar itself match the <?php … ?> construct, so with your grammar, those bits have been consumed by the including grammar, and the included PHP grammar will therefor be a no-op.
The reason we made it this way was so that the PHP grammar can sort of work when used as the root grammar, since lots of users insist on using it that way, despite our efforts¹ to educate ;)
¹ http://wiki.macromates.com/Troubleshooting/PHPSyntaxHighlight
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate