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@gmail.com