Sublime Text: area selector operators

Of the 243 color schemes currently registered with TmThemeEditor , I noticed that almost none of them use selector operators.

Operators are very useful for such situations:

(text.html | text.xml) & (meta.tag entity)

I think the reason they are so rarely used by color scheme designers is because they are poorly documented. They are not mentioned at all in white papers for ST2 or ST3 or in white papers for color schemes . Informal documents for specifying syntax specify area selectors, but not operators.

Where can I find documentation of area selector statements supported by Sublime Text?

+4
source share
1 answer

Operators in order of priority (highest first):

( ) Grouping

& Intersection

- Asymmetric difference (relative complement)

| Union

, Comma

The color scheme file format ( .tmTheme) is inherited from TextMate .

Here are some relevant links and citations from the TextMate documentation regarding scope selector operators:

  • Guide: Area Selectors
    • Exclusion of elements
      "we can subtract region selectors to obtain a (asymmetric) difference using the minus operator.

    • " , - , . , , , : string, comment. "

  • " , , : (a | b) & c - d, d c, a b. "
  • - 17:
    " . , , # source.ruby string, string source ( ). : (source.ruby string) - (string source). , ( - ).

( TextMate) TextMate. , : 1, 2, 3, 4, 5, 6. :

(, string). " ", . source.ruby string, (| ,), (&) (-).

. , ,, | , , , ( CSS), &, , | | ,, , ,

a - b | c & d, e - f | g & h ⇔ (a - b | c & d), (e - f | g & h)

TextMate , Sublime Text, *, ^, >, $, L:, R:, B:. : 1, 2, 3, 4.

+4

Source: https://habr.com/ru/post/1614694/