[TxMt] syntax tool
Allan Odgaard
allan at macromates.com
Sun Jan 16 07:58:56 UTC 2005
On Jan 16, 2005, at 7:41, Eric Hsu wrote:
> And if one sets colors in a global stylesheet, how should one handle
> one language embedded in another? E.g. PHP/HTML or Perl/HTML?
With only one global style sheet both languages would use the same
colors. But you can target the embedded language like this:
HTML PHP strings { fgColor: blue; }
That would be 'strings' elements descendent of a PHP element descendent
of a HTML element.
So there are really two hierarchies at play, and including 'perl' in
the language element name (as you did) should not be necessary, since
you can do: “Perl strings” instead of “strings.*.perl”.
Makes sense? Basically we have one dynamic hierarchy that is the
context/location of the element (e.g. is the string child or descendent
of PHP/C++/whatever) and a rather static type-hierarchy (is it
'strings.single-quoted' or 'strings.double-quoted').
More information about the textmate
mailing list