[TxMt] Re: Recursive parsing?
Andreas Pardeike
ap at fsys.se
Thu Apr 9 09:10:00 UTC 2009
Update,
Using
{ scopeName = 'text.html.php';
fileTypes = ( );
foldingStartMarker = '<(php|htm)>$';
foldingStopMarker = '^\s*</(php|htm)>';
patterns = (
{ contentName = 'source.php.embedded.html';
begin = '`|<php>\s*?\n?|</htm>\s*?\n?';
end = '`|\s*<htm>|^\s*</php>|</php>';
patterns = ( { include = 'source.php'; } );
},
{ include = 'text.html.basic'; },
);
}
I get syntax coloring for the html scope, but not for php.
/Andreas
On 9 apr 2009, at 08.48, Andreas Pardeike wrote:
> On 8 apr 2009, at 21.34, Allan Odgaard wrote:
>
>> On 8 Apr 2009, at 10:42, Andreas Pardeike wrote:
>>
>>> Can I customize Textmate so its html and php modules identify my
>>> regions?
>>
>> Yes, look at the ‘include’ rule key: http://manual.macromates.com/en/language_grammars#rule_keys
>
> Great. Much improved since I looked last. My grammar def looks like
> this:
>
> { scopeName = 'text.html.basic';
> fileTypes = ( );
> foldingStartMarker = '<(php|htm)>$';
> foldingStopMarker = '^\s*</(php|htm)>';
> patterns = (
> { contentName = 'source.php';
> begin = '`|<php>\s*?\n?|</htm>\s*?\n?';
> end = '`|\s*<htm>|^\s*</php>|</php>';
> patterns = ( { include = 'source.php'; } );
> },
> );
> }
>
> Question: I don't get syntax coloring for the two scopes though. Is
> this
> possible?
More information about the textmate
mailing list