Skip to content

Commit 47a4fff

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 47a4fff

File tree

6 files changed

+75
-59
lines changed

6 files changed

+75
-59
lines changed

Package/Scope Selector (XML).sublime-syntax

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ contexts:
2323
operators:
2424
- meta_prepend: true
2525
- match: (&)amp(;)
26-
scope: constant.character.entity.xml keyword.operator.with.scope-selector
26+
scope: constant.character.entity.xml keyword.operator.combinator.with.scope-selector
2727
captures:
2828
1: punctuation.definition.constant.xml
2929
2: punctuation.definition.constant.xml

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/Sublime Text Snippet/Sublime Text Snippet.sublime-syntax

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ contexts:
6262
- include: scope:source.scope-selector
6363
with_prototype:
6464
- match: '&'
65-
scope: keyword.operator.with.scope-selector
65+
scope: keyword.operator.combinator.with.scope-selector
6666
- match: '(<)(tabTrigger)(>)'
6767
scope: meta.tag.xml
6868
captures:

Package/Sublime Text Snippet/syntax_test_snippet.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,14 +293,14 @@ ${TM_CURRENT_LINE/^\\s*((?:\\/\1/}
293293
# ^^^^ string.unquoted.scope-segment
294294
# ^ punctuation.separator.scope-segments
295295
# ^^^^ string.unquoted.scope-segment
296-
# ^^^^^ keyword.operator.with.scope-selector
296+
# ^^^^^ keyword.operator.combinator.with.scope-selector
297297
# ^^^^ string.unquoted.scope-segment
298298
<scope><![CDATA[text.html &amp; test]]></scope>
299299
# ^^^^^^^^^ invalid.illegal
300300
# ^^^^ string.unquoted.scope-segment
301301
# ^ punctuation.separator.scope-segments
302302
# ^^^^ string.unquoted.scope-segment
303-
# ^^^^^ keyword.operator.with
303+
# ^^^^^ keyword.operator.combinator.with
304304
# ^^^^ string.unquoted.scope-segment
305305
# ^^^ invalid.illegal
306306
<scope>text.html &amp; test
@@ -312,18 +312,18 @@ ${TM_CURRENT_LINE/^\\s*((?:\\/\1/}
312312
# ^^^^^^ string.unquoted.scope-segment.scope-selector
313313
# ^ punctuation.separator.scope-segments.scope-selector
314314
# ^ string.unquoted.scope-segment.scope-selector
315-
# ^ keyword.operator.or.scope-selector
315+
# ^ keyword.operator.combinator.or.scope-selector
316316
# ^^^^^^ string.unquoted.scope-segment.scope-selector
317317
# ^ punctuation.separator.scope-segments.scope-selector
318318
# ^^^ string.unquoted.scope-segment.scope-selector
319319
# ^ punctuation.section.group.end.scope-selector
320-
# ^^^^^ keyword.operator.with.scope-selector
320+
# ^^^^^ keyword.operator.combinator.with.scope-selector
321321
# ^^^^^^ string.unquoted.scope-segment.scope-selector
322-
# ^ keyword.operator.or.scope-selector
322+
# ^ keyword.operator.combinator.or.scope-selector
323323
# ^ punctuation.section.group.begin.scope-selector
324-
# ^^^^^ keyword.operator.with.scope-selector
324+
# ^^^^^ keyword.operator.combinator.with.scope-selector
325325
# ^ punctuation.section.group.end.scope-selector
326-
# ^ keyword.operator.or.scope-selector
326+
# ^ keyword.operator.combinator.or.scope-selector
327327
# ^^^^^^ string.unquoted.scope-segment.scope-selector
328328

329329
<tabTrigger> </tabTrigger>

Package/TextMate Preferences/syntax_test_tmPreferences.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@
5454
<!-- ^ punctuation.definition.tag.begin.xml -->
5555
<!-- ^^^^^^^^^^^^^^^^^^^^^^^ meta.string.selector.tmPreferences -->
5656
<!-- ^^^ punctuation.definition.tag.end.xml - meta.string - invalid -->
57-
<!-- ^ keyword.operator.with.scope-selector -->
57+
<!-- ^ keyword.operator.combinator.with.scope-selector -->
5858
<!-- ^ punctuation.section.group.begin.scope-selector -->
59-
<!-- ^ keyword.operator.with.scope-selector -->
59+
<!-- ^ keyword.operator.combinator.with.scope-selector -->
6060
<!-- ^ punctuation.section.group.end.scope-selector -->
6161
<key>scope</key>
6262
<string>abc & (def - ghi & jkl &amp; mno)</string>
6363
<!-- ^ invalid.illegal.bad-ampersand.xml -->
6464
<!-- ^ invalid.illegal.bad-ampersand.xml -->
65-
<!-- ^^^^^ constant.character.entity.xml keyword.operator.with.scope-selector -->
65+
<!-- ^^^^^ constant.character.entity.xml keyword.operator.combinator.with.scope-selector -->
6666

6767
<key>settings</key>
6868
<!-- ^^^^^^^^ meta.inside-dict-key.plist keyword.other.settings.tmPreferences-->
@@ -255,7 +255,7 @@
255255
<!-- ^^^^^ string.unquoted.scope-segment.scope-selector -->
256256
<!-- ^ punctuation.separator.scope-segments.scope-selector -->
257257
<!-- ^^^^^ string.unquoted.scope-segment.scope-selector -->
258-
<!-- ^^^^^ constant.character.entity.xml keyword.operator.with.scope-selector -->
258+
<!-- ^^^^^ constant.character.entity.xml keyword.operator.combinator.with.scope-selector -->
259259
<!-- ^ punctuation.section.group.begin.scope-selector -->
260260
<!-- ^ invalid.illegal.missing-group-end.scope-selector -->
261261
<!-- ^^^^^^^^^ meta.tag.xml - meta.inside-value -->
@@ -277,10 +277,10 @@
277277
<!-- ^ punctuation.section.group.begin.scope-selector -->
278278
<!-- ^ keyword.operator.or.scope-selector -->
279279
<!-- ^ punctuation.section.group.end.scope-selector -->
280-
<!-- ^^^^^ constant.character.entity.xml keyword.operator.with.scope-selector -->
280+
<!-- ^^^^^ constant.character.entity.xml keyword.operator.combinator.with.scope-selector -->
281281
<!-- ^^^^^^ string.unquoted.scope-segment.scope-selector -->
282282
<!-- ^ punctuation.section.group.end.scope-selector -->
283-
<!-- ^^^^^ constant.character.entity.xml keyword.operator.with.scope-selector -->
283+
<!-- ^^^^^ constant.character.entity.xml keyword.operator.combinator.with.scope-selector -->
284284
<!-- ^^^^^^^^^^^ string.unquoted.scope-segment.scope-selector -->
285285
<!-- ^^^^^^^^^^^^^^^^ comment.block.xml -->
286286
</dict>

0 commit comments

Comments
 (0)