[TxMt] How to make variables take precedence over an included language? [Was: naming embedded (included) scopes ?]

Dirk van Oosterbosch, IR labs labs at ixopusada.com
Sun Apr 9 23:02:02 UTC 2006


On 9-apr-2006, at 16:34, Allan Odgaard wrote:

> On 9/4/2006, at 15:22, Dirk van Oosterbosch, IR labs wrote:
>
>> [...] Is it possible to give an embedded (or included) language an  
>> extra scope layer name, so I can use that in a theme?
>
> Not really.
> [...] In your case, there does not seem to be such clear markers,  
> but instead, everything not matched by the cheetah grammar is  
> “embedded.”

Right.
Maybe then what I am looking for is a scope selector which selects  
all the most specific (rightmost) scope names. I mean where 'source'  
selects all source.html, source.py source.whatever.comes.after etc, I  
would like to select all whatever.scopenames.that.ends.specific (e.g.  
'variables.other.specific', 'keyword.control.specific' etc) by just  
something like '.specific'. That would allow me to select all the  
individually parsed cheetah stuff for instance, leaving the rest  
“embedded.”
But I guess there isn't a '.specific-name-ending' -like selector, so  
I give up on this endeavor.

However, now I encountered an other problem:
I have my bundle recognize cheetah placeholders (or 'variables'),  
which look like this: $placeholder or $placeholder.argument. But when  
I also have { include = 'text.html.basic'; } in my patterns the  
placeholders which are inside html tags (e.g. as arguments or  
values), are no longer recognized and become just  
'string.quotes.double.html'. The text outside html tags stays  
unaffected, and thus placeholder.

As an example:
<title>$currentPage.title</title>
is perfectly parsed. The scope of '<title>' and '</title>'  is  
"source.cheetah meta.tag.inline.any.html  
entity.name.tag.inline.any.html"
and the scope of '$currentPage.title' is "source.cheetah  
variable.other.cheetah"
However in:
<meta name="author" content="$currentPage.author" />
the scope of '$currentPage.author' is "source.cheetah  
meta.tag.inline.any.html string.quotes.double.html", while I would  
like it to be "source.cheetah variable.other.cheetah" too.
Only if I disable the include pattern it is recognized correctly.
How can I make this variables.other.cheetah pattern take precedence  
over the { include = 'text.html.basic'; } pattern?

best,
dirk



Sorry if this actually IS a new thread and I just made the universe  
collapse. oops.
-----------------------------
Dirk van Oosterbosch
de Wittenstraat 225
1052 AT Amsterdam
the Netherlands

http://labs.ixopusada.com
-----------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20060410/0667cb16/attachment.html>


More information about the textmate mailing list