Skip to content

Commit 0cbd004

Browse files
committed
Add child combinator operator
This commit adds... 1. a common `.combinator` 3rd-level scope, following the schema of CSS. 2. the `>` child combinator operator supported as of ST4201.
1 parent 80f64c2 commit 0cbd004

File tree

2 files changed

+60
-44
lines changed

2 files changed

+60
-44
lines changed

Package/Scope Selector.sublime-syntax

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,17 @@ contexts:
4545
- match: \s+\(
4646
scope: invalid.illegal.operator-required-between-scope-and-group.scope-selector
4747
- match: \s+(?=\w)
48-
scope: keyword.operator.right.scope-selector
48+
scope: keyword.operator.combinator.right.scope-selector
4949
pop: true
5050
- match: ''
5151
pop: true
5252

5353
operators:
54+
- match: '>'
55+
scope: keyword.operator.combinator.child.scope-selector
5456
- match: '-'
55-
scope: keyword.operator.without.scope-selector
57+
scope: keyword.operator.combinator.without.scope-selector
5658
- match: '&'
57-
scope: keyword.operator.with.scope-selector
59+
scope: keyword.operator.combinator.with.scope-selector
5860
- match: '[,|]'
59-
scope: keyword.operator.or.scope-selector
61+
scope: keyword.operator.combinator.or.scope-selector

Package/syntax_test_scope_selector.txt

Lines changed: 54 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ string.quoted.double
2020

2121

2222
- quoted.double
23-
#^ keyword.operator.without.scope-selector
23+
#^ keyword.operator.combinator.without.scope-selector
2424
# ^ - keyword - string
2525
# ^^^^^^ string.unquoted.scope-segment.scope-selector
2626
# ^ punctuation.separator.scope-segments.scope-selector
@@ -29,64 +29,64 @@ string.quoted.double
2929
string - comment
3030
#^^^^^^ string.unquoted.scope-segment.scope-selector
3131
# ^ - string - keyword
32-
# ^ keyword.operator.without.scope-selector
32+
# ^ keyword.operator.combinator.without.scope-selector
3333
# ^ - string - keyword
3434
# ^^^^^^^ string.unquoted.scope-segment.scope-selector
3535

3636
string, comment
3737
#^^^^^^ string.unquoted.scope-segment.scope-selector
38-
# ^ keyword.operator.or.scope-selector
38+
# ^ keyword.operator.combinator.or.scope-selector
3939
# ^ - string - keyword
4040
# ^^^^^^^ string.unquoted.scope-segment.scope-selector
4141

4242
string | comment
4343
#^^^^^^ string.unquoted.scope-segment.scope-selector
4444
# ^ - string - keyword
45-
# ^ keyword.operator.or.scope-selector
45+
# ^ keyword.operator.combinator.or.scope-selector
4646
# ^ - string - keyword
4747
# ^^^^^^^ string.unquoted.scope-segment.scope-selector
4848

4949
string & - comment
5050
#^^^^^^ string.unquoted.scope-segment.scope-selector
5151
# ^ - string - keyword
52-
# ^ keyword.operator.with.scope-selector
52+
# ^ keyword.operator.combinator.with.scope-selector
5353
# ^ - string - keyword
54-
# ^ keyword.operator.without.scope-selector
54+
# ^ keyword.operator.combinator.without.scope-selector
5555
# ^ - string - keyword
5656
# ^^^^^^^ string.unquoted.scope-segment.scope-selector
5757

5858
source string
5959
#^^^^^^ string.unquoted.scope-segment.scope-selector
60-
# ^ keyword.operator.right.scope-selector
60+
# ^ keyword.operator.combinator.right.scope-selector
6161
# ^^^^^^ string.unquoted.scope-segment.scope-selector
6262

6363
source & (string - comment) &
6464
#^^^^^^ string.unquoted.scope-segment.scope-selector
6565
# ^ - string - keyword
66-
# ^ keyword.operator.with.scope-selector
66+
# ^ keyword.operator.combinator.with.scope-selector
6767
# ^ - string - keyword
6868
# ^ punctuation.section.group.begin.scope-selector
6969
# ^^^^^^ string.unquoted.scope-segment.scope-selector
7070
# ^ - string - keyword
71-
# ^ keyword.operator.without.scope-selector
71+
# ^ keyword.operator.combinator.without.scope-selector
7272
# ^ - string - keyword
7373
# ^^^^^^^ string.unquoted.scope-segment.scope-selector
7474
# ^ punctuation.section.group.end.scope-selector
7575
# ^ - string - keyword
76-
# ^ keyword.operator.with.scope-selector
76+
# ^ keyword.operator.combinator.with.scope-selector
7777

7878
string & source
7979
#^^^^^^ string.unquoted.scope-segment.scope-selector
8080
# ^ - string - keyword
81-
# ^ keyword.operator.with.scope-selector
81+
# ^ keyword.operator.combinator.with.scope-selector
8282
# ^ - string - keyword
8383
# ^^^^^^ string.unquoted.scope-segment.scope-selector
8484

8585
source.python string.quoted.double.block.python punctuation.definition.string.begin.python
8686
#^^^^^^ string.unquoted.scope-segment.scope-selector
8787
# ^ punctuation.separator.scope-segments.scope-selector
8888
# ^^^^^^ string.unquoted.scope-segment.scope-selector
89-
# ^ keyword.operator.right.scope-selector
89+
# ^ keyword.operator.combinator.right.scope-selector
9090
# ^^^^^^ string.unquoted.scope-segment.scope-selector
9191
# ^ punctuation.separator.scope-segments.scope-selector
9292
# ^^^^^^ string.unquoted.scope-segment.scope-selector
@@ -96,7 +96,7 @@ string.quoted.double
9696
# ^^^^^ string.unquoted.scope-segment.scope-selector
9797
# ^ punctuation.separator.scope-segments.scope-selector
9898
# ^^^^^^ string.unquoted.scope-segment.scope-selector
99-
# ^ keyword.operator.right.scope-selector
99+
# ^ keyword.operator.combinator.right.scope-selector
100100
# ^^^^^^^^^^^ string.unquoted.scope-segment.scope-selector
101101
# ^ punctuation.separator.scope-segments.scope-selector
102102
# ^^^^^^^^^^ string.unquoted.scope-segment.scope-selector
@@ -110,11 +110,11 @@ string.quoted.double
110110
source & string & punctuation.definition.string.begin.python
111111
#^^^^^^ string.unquoted.scope-segment.scope-selector
112112
# ^ - string - keyword
113-
# ^ keyword.operator.with.scope-selector
113+
# ^ keyword.operator.combinator.with.scope-selector
114114
# ^ - string - keyword
115115
# ^^^^^^ string.unquoted.scope-segment.scope-selector
116116
# ^ - string - keyword
117-
# ^ keyword.operator.with.scope-selector
117+
# ^ keyword.operator.combinator.with.scope-selector
118118
# ^ - string - keyword
119119
# ^^^^^^^^^^^ string.unquoted.scope-segment.scope-selector
120120
# ^ punctuation.separator.scope-segments.scope-selector
@@ -128,10 +128,10 @@ string.quoted.double
128128

129129
string punctuation & source
130130
#^^^^^^ string.unquoted.scope-segment.scope-selector
131-
# ^ keyword.operator.right.scope-selector
131+
# ^ keyword.operator.combinator.right.scope-selector
132132
# ^^^^^^^^^^^ string.unquoted.scope-segment.scope-selector
133133
# ^ - string - keyword
134-
# ^ keyword.operator.with.scope-selector
134+
# ^ keyword.operator.combinator.with.scope-selector
135135
# ^ - string - keyword
136136
# ^^^^^^ string.unquoted.scope-segment.scope-selector
137137

@@ -141,47 +141,47 @@ string.quoted.double
141141
(punctuation string) test.example - foo bar
142142
#^ punctuation.section.group.begin.scope-selector
143143
# ^^^^^^^^^^^ string.unquoted.scope-segment.scope-selector
144-
# ^ keyword.operator.right.scope-selector
144+
# ^ keyword.operator.combinator.right.scope-selector
145145
# ^^^^^^ string.unquoted.scope-segment.scope-selector
146146
# ^ punctuation.section.group.end.scope-selector
147147
# ^^^^^^^^^^^^^ invalid.illegal.operator-required-after-group.scope-selector
148148
# ^ - string - keyword - illegal
149-
# ^ keyword.operator.without.scope-selector
149+
# ^ keyword.operator.combinator.without.scope-selector
150150
# ^ - string - keyword - illegal
151151
# ^^^ string.unquoted.scope-segment.scope-selector
152-
# ^ keyword.operator.right.scope-selector
152+
# ^ keyword.operator.combinator.right.scope-selector
153153
# ^^^ string.unquoted.scope-segment.scope-selector
154154

155155
(source&string)
156156
#^ punctuation.section.group.begin.scope-selector
157157
# ^^^^^^ string.unquoted.scope-segment.scope-selector
158-
# ^ keyword.operator.with.scope-selector
158+
# ^ keyword.operator.combinator.with.scope-selector
159159
# ^^^^^^ string.unquoted.scope-segment.scope-selector
160160
# ^ punctuation.section.group.end.scope-selector
161161

162162
(punctuation|string)&source.python -comment
163163
#^ punctuation.section.group.begin.scope-selector
164164
# ^^^^^^^^^^^ string.unquoted.scope-segment.scope-selector
165-
# ^ keyword.operator.or.scope-selector
165+
# ^ keyword.operator.combinator.or.scope-selector
166166
# ^^^^^^ string.unquoted.scope-segment.scope-selector
167167
# ^ punctuation.section.group.end.scope-selector
168-
# ^ keyword.operator.with.scope-selector
168+
# ^ keyword.operator.combinator.with.scope-selector
169169
# ^^^^^^ string.unquoted.scope-segment.scope-selector
170170
# ^ punctuation.separator.scope-segments.scope-selector
171171
# ^^^^^^ string.unquoted.scope-segment.scope-selector
172172
# ^ - string - keyword
173-
# ^ keyword.operator.without.scope-selector
173+
# ^ keyword.operator.combinator.without.scope-selector
174174
# ^^^^^^^ string.unquoted.scope-segment.scope-selector
175175

176176
comment,string|source
177177
#^^^^^^^ string.unquoted.scope-segment.scope-selector
178-
# ^ keyword.operator.or.scope-selector
178+
# ^ keyword.operator.combinator.or.scope-selector
179179
# ^^^^^^ string.unquoted.scope-segment.scope-selector
180-
# ^ keyword.operator.or.scope-selector
180+
# ^ keyword.operator.combinator.or.scope-selector
181181
# ^^^^^^ string.unquoted.scope-segment.scope-selector
182182

183183
-comment
184-
#<- keyword.operator.without.scope-selector
184+
#<- keyword.operator.combinator.without.scope-selector
185185
#^^^^^^^ string.unquoted.scope-segment.scope-selector
186186

187187
( text )|source
@@ -190,13 +190,13 @@ string.quoted.double
190190
# ^^^^ string.unquoted.scope-segment.scope-selector
191191
# ^ - string - keyword
192192
# ^ punctuation.section.group.end.scope-selector
193-
# ^ keyword.operator.or.scope-selector
193+
# ^ keyword.operator.combinator.or.scope-selector
194194
# ^^^^^^ string.unquoted.scope-segment.scope-selector
195195

196196
(trailing space)
197197
#<- punctuation.section.group.begin.scope-selector
198198
#^^^^^^^^ string.unquoted.scope-segment.scope-selector
199-
# ^ keyword.operator.right.scope-selector
199+
# ^ keyword.operator.combinator.right.scope-selector
200200
# ^^^^^ string.unquoted.scope-segment.scope-selector
201201
# ^ punctuation.section.group.end.scope-selector
202202
# ^^ - string - keyword - illegal
@@ -211,17 +211,17 @@ text.html - (source & - source text.html)
211211
# ^ punctuation.separator.scope-segments.scope-selector
212212
# ^^^^ string.unquoted.scope-segment.scope-selector
213213
# ^ - string - keyword
214-
# ^ keyword.operator.without.scope-selector
214+
# ^ keyword.operator.combinator.without.scope-selector
215215
# ^ - string - keyword
216216
# ^ punctuation.section.group.begin.scope-selector
217217
# ^^^^^^ string.unquoted.scope-segment.scope-selector
218218
# ^ - string - keyword
219-
# ^ keyword.operator.with.scope-selector
219+
# ^ keyword.operator.combinator.with.scope-selector
220220
# ^ - string - keyword
221-
# ^ keyword.operator.without.scope-selector
221+
# ^ keyword.operator.combinator.without.scope-selector
222222
# ^ - string - keyword
223223
# ^^^^^^ string.unquoted.scope-segment.scope-selector
224-
# ^ keyword.operator.right.scope-selector
224+
# ^ keyword.operator.combinator.right.scope-selector
225225
# ^^^^ string.unquoted.scope-segment.scope-selector
226226
# ^ punctuation.separator.scope-segments.scope-selector
227227
# ^^^^ string.unquoted.scope-segment.scope-selector
@@ -232,12 +232,12 @@ source.php - source.php text.html
232232
# ^ punctuation.separator.scope-segments.scope-selector
233233
# ^^^ string.unquoted.scope-segment.scope-selector
234234
# ^ - string - keyword
235-
# ^ keyword.operator.without.scope-selector
235+
# ^ keyword.operator.combinator.without.scope-selector
236236
# ^ - string - keyword
237237
# ^^^^^^ string.unquoted.scope-segment.scope-selector
238238
# ^ punctuation.separator.scope-segments.scope-selector
239239
# ^^^ string.unquoted.scope-segment.scope-selector
240-
# ^ keyword.operator.right.scope-selector
240+
# ^ keyword.operator.combinator.right.scope-selector
241241
# ^^^^ string.unquoted.scope-segment.scope-selector
242242
# ^ punctuation.separator.scope-segments.scope-selector
243243
# ^^^^ string.unquoted.scope-segment.scope-selector
@@ -246,26 +246,26 @@ embedding.php text.html - (source.php &amp; - source.php text.html)
246246
#^^^^^^^^ string.unquoted.scope-segment.scope-selector
247247
# ^ punctuation.separator.scope-segments.scope-selector
248248
# ^^^ string.unquoted.scope-segment.scope-selector
249-
# ^ keyword.operator.right.scope-selector
249+
# ^ keyword.operator.combinator.right.scope-selector
250250
# ^^^^ string.unquoted.scope-segment.scope-selector
251251
# ^ punctuation.separator.scope-segments.scope-selector
252252
# ^^^^ string.unquoted.scope-segment.scope-selector
253253
# ^ - string - keyword
254-
# ^ keyword.operator.without.scope-selector
254+
# ^ keyword.operator.combinator.without.scope-selector
255255
# ^ - string - keyword
256256
# ^ punctuation.section.group.begin.scope-selector
257257
# ^^^^^^ string.unquoted.scope-segment.scope-selector
258258
# ^ punctuation.separator.scope-segments.scope-selector
259259
# ^^^ string.unquoted.scope-segment.scope-selector
260260
# ^ - string - keyword
261-
# ^ keyword.operator.with.scope-selector
261+
# ^ keyword.operator.combinator.with.scope-selector
262262
# ^ - string - keyword
263-
# ^ keyword.operator.without.scope-selector
263+
# ^ keyword.operator.combinator.without.scope-selector
264264
# ^ - string - keyword
265265
# ^^^^^^ string.unquoted.scope-segment.scope-selector
266266
# ^ punctuation.separator.scope-segments.scope-selector
267267
# ^^^ string.unquoted.scope-segment.scope-selector
268-
# ^ keyword.operator.right.scope-selector
268+
# ^ keyword.operator.combinator.right.scope-selector
269269
# ^^^^ string.unquoted.scope-segment.scope-selector
270270
# ^ punctuation.separator.scope-segments.scope-selector
271271
# ^^^^ string.unquoted.scope-segment.scope-selector
@@ -275,3 +275,17 @@ source.c++
275275
# ^^^^ string.unquoted.scope-segment.scope-selector
276276
# ^ punctuation.separator.scope-segments.scope-selector
277277
# ^^^ string.unquoted.scope-segment.scope-selector
278+
279+
source.c > parent & (parent > child)
280+
#^^^^^ string.unquoted.scope-segment.scope-selector
281+
# ^ punctuation.separator.scope-segments.scope-selector
282+
# ^ string.unquoted.scope-segment.scope-selector
283+
# ^ keyword.operator.combinator.child.scope-selector
284+
# ^^^^^^ string.unquoted.scope-segment.scope-selector
285+
# ^ keyword.operator.combinator.with.scope-selector
286+
# ^^^^^^^^^^^^^^^^ meta.group.scope-selector
287+
# ^ punctuation.section.group.begin.scope-selector
288+
# ^^^^^^ string.unquoted.scope-segment.scope-selector
289+
# ^ keyword.operator.combinator.child.scope-selector
290+
# ^^^^^ string.unquoted.scope-segment.scope-selector
291+
# ^ punctuation.section.group.end.scope-selector

0 commit comments

Comments
 (0)