[TxMt] formal definition of scope selector syntax?

Matt Neuburg matt at tidbits.com
Wed Jun 25 19:07:57 UTC 2008

In the Help for TextMate, the following are given as examples of legal
selectors (with explanations of what they mean / match):

text.html.ruby, text.html source.ruby
source.php string
text.html source.php
source.ruby string
source.ruby string - string source
string, comment

So, operators here are space, comma-space, and space-minus-space. It appears
that space has highest priority, then space-minus-space, then comma. (Or so
I would presume.) So far, then, it all seems quite coherent; I grok
prefix-matching, descendancy, exclusion, and OR (the comma is apparently an
OR operator, even though the help rather confusingly seems to describe it as
an AND).

Then, in a blog entry
(http://blog.macromates.com/2005/introduction-to-scopes/), additional info
is given:

(a | b) & c - d

I find that last one incoherent; I don't get where the pieces are or how the
operators here fit, priority-wise, with the previously given operators. For
example, which of the selectors given in the first list would be a legal
substitute for "b" here? And conversely, for which expressions in the first
list of legal selectors, if any, could this expression be substituted?

So, my question is: Can I somewhere get a formal coherent definition of the
rules of selector syntax?


matt neuburg, phd = matt at tidbits.com, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
One of the 2007 MacTech Top 25: <http://tinyurl.com/2rh4pf>
AppleScript: the Definitive Guide - Second Edition!

More information about the textmate mailing list