-
-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathScope Selector.sublime-syntax
More file actions
61 lines (54 loc) · 1.67 KB
/
Scope Selector.sublime-syntax
File metadata and controls
61 lines (54 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
scope: source.scope-selector
hidden: true
variables:
scope_segment: \w+(?:[\w-]*\+*) # \+* is for the non standard scope.c++ scopes
contexts:
main:
- include: base
- match: \)
scope: invalid.illegal.stray-bracket.scope-selector
base:
- match: (?:^\s*)?({{scope_segment}})
captures:
1: string.unquoted.scope-segment.scope-selector
push: inside-scope-segment
- match: \(
scope: punctuation.section.group.begin.scope-selector
push: inside-group
- include: operators
inside-group:
- meta_scope: meta.group.scope-selector
- match: \)
scope: punctuation.section.group.end.scope-selector
set: after-group
- include: base
after-group:
- match: (?:\s*{{scope_segment}}|\.)+
scope: invalid.illegal.operator-required-after-group.scope-selector
- match: \s*
pop: true
inside-scope-segment:
- match: (\.)(\.+)?
captures:
1: punctuation.separator.scope-segments.scope-selector
2: invalid.illegal.empty-scope-segment.scope-selector
pop: true
- match: \s+\(
scope: invalid.illegal.operator-required-between-scope-and-group.scope-selector
- match: \s+(?=\w)
scope: keyword.operator.combinator.right.scope-selector
pop: true
- match: ''
pop: true
operators:
- match: '>'
scope: keyword.operator.combinator.child.scope-selector
- match: '-'
scope: keyword.operator.combinator.without.scope-selector
- match: '&'
scope: keyword.operator.combinator.with.scope-selector
- match: '[,|]'
scope: keyword.operator.combinator.or.scope-selector