[TxMt] Re: Language within a language

Édouard Gilbert edouard.gilbert at gmail.com
Sun May 17 09:57:29 UTC 2009


Le 16 mai 09 à 20:58, Martin Hess a écrit :

> What is the best approach for supporting a language within a language.
>
> For example, in some languages you can embed inline assembly or C  
> code.
>
> You could extend the bundle for the primary language to support the
> syntax and completions of the embed language, but that seems a bit
> redundant.
>
> Is there a way to use existing language bundle code within another
> bundle? Are there any examples of this?

Yes. The “include” rule allow to include other language, among others.  
Here’s the example from the manual.

{	begin = '<\?(php|=)?';
	end = '\?>';
	patterns = (
		{ include = "source.php"; }
	);
}
See http://manual.macromates.com/en/language_grammars#language_rules  
for more detailed information. Or see TM help.

Édouard GILBERT
edouard.gilbert at gmail.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ?douard Gilbert.vcf
Type: text/directory
Size: 510 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20090517/2a88134b/attachment.vcf>
-------------- next part --------------




More information about the textmate mailing list