[TxMt] Extending existing grammar (css -> rcss)
Allan Odgaard
throw-away-1 at macromates.com
Wed May 23 17:38:53 UTC 2007
On 22. May 2007, at 17:12, Shane Liesegang wrote:
> [...]
> Using that, I get proper syntax coloring for embedded Ruby if I use
> it at the
> root level, but I still don't get autocomplete. And inside a CSS
> selector, I
> can't get anything.
> [...]
> Is there a way to specify conditional scope within a grammar? It
> seems like once
> it hits the CSS selector, it doesn't recognize ERB anymore.
The grammar is basically a tree of rules, when you enter a subtree,
only the rules for that node are “active”.
This means grammars which matches larger structures of the document
are not possible to augment without actually changing the grammar, so
that’s your only option for now, i.e. clone the full CSS grammar and
just modifiy it, rather than include it. There will be a system for
injecting rules into existing grammars without forking them in the
future.
More information about the textmate
mailing list