-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSmPL (Coccinelle).sublime-syntax
More file actions
181 lines (181 loc) · 5.19 KB
/
SmPL (Coccinelle).sublime-syntax
File metadata and controls
181 lines (181 loc) · 5.19 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
%YAML 1.2
---
# http://www.sublimetext.com/docs/syntax.html
name: SmPL
file_extensions:
- cocci
scope: source.smpl
contexts:
main:
- include: comment
- include: include
- include: virtual
- include: control
- include: scripts
- include: metavariables
- include: variables
- include: lineAdded
- include: lineDeleted
- include: lineMatched
- include: when
comment:
- match: ///
captures:
0: punctuation.definition.comment.smpl
push:
- meta_scope: comment.line.triple-slash.smpl
- match: $
pop: true
- match: //
captures:
0: punctuation.definition.comment.smpl
push:
- meta_scope: comment.line.double-slash.smpl
- match: $
pop: true
comma:
- match: ','
scope: punctuation.separator.delimiter.comma
control:
- match: '<\+(?=\.{3})|(?<=\.{3})\+>'
scope: storage.modifier.required.dots.smpl
- match: '<(?=\.{3})|(?<=\.{3})>'
scope: storage.modifier.optional.dots.smpl
- match: '\.{3}'
scope: keyword.control.flow.dots.smpl
esc:
- match: (\\).
scope: constant.character.escape.backslash
captures:
1: punctuation.definition.escape.backslash
include:
- match: '^\s*(include|using)\s+(?:("[^"]*")|(<.*>))'
scope: meta.preprocessor.$1.smpl
captures:
1: keyword.control.directive.$1.smpl
isoPath:
- match: <
captures:
0: punctuation.definition.string.begin.smpl
push:
- meta_scope: string.quoted.other.lt-gt.include.smpl
- match: '>'
captures:
0: punctuation.definition.string.end.smpl
pop: true
lineAdded:
- match: ^(\+).*
scope: markup.inserted.diff.smpl
captures:
1: punctuation.definition.inserted.diff.smpl
lineDeleted:
- match: ^(-).*
scope: markup.deleted.diff.smpl
captures:
1: punctuation.definition.deleted.diff.smpl
lineMatched:
- match: ^(\*)\s*(\S.*)
captures:
1: keyword.operator.semantic-match.diff.smpl
2: markup.changed.diff.smpl
metavariables:
- match: ^(@).*(@)\s*$
captures:
0: meta.diff.range.smpl
1: punctuation.definition.range.diff.begin.smpl
2: punctuation.definition.range.diff.end.smpl
push:
- meta_scope: meta.diff.header.metavariables.smpl
- match: ^(@@)
captures:
0: meta.diff.range.smpl
1: punctuation.definition.range.diff.smpl
pop: true
scripts:
- match: (^(@).*?(?<=\s|@)(script|initialize|finalize):python(?=\s|@).*?(@)\s*$)
captures:
0: meta.diff.header.metavariables.smpl
1: meta.diff.range.smpl
2: punctuation.definition.range.diff.begin.smpl
3: punctuation.definition.range.diff.end.smpl
push:
- match: ^(?=@(?!@\s*$))
pop: true
- match: ^
push:
- meta_scope: meta.diff.header.metavariables.smpl
- match: ^(@@)
captures:
0: meta.diff.range.smpl
1: punctuation.definition.range.diff.smpl
pop: true
- match: (?<=@@)\s*$\n?
push:
- meta_content_scope: source.embedded.python
- match: ^(?=@)
pop: true
- include: comment
- include: scope:source.python
- match: (^(@).*?(?<=\s|@)(script|initialize|finalize):ocaml(?=\s|@).*?(@)\s*$)
captures:
0: meta.diff.header.metavariables.smpl
1: meta.diff.range.smpl
2: punctuation.definition.range.diff.begin.smpl
3: punctuation.definition.range.diff.end.smpl
push:
- match: ^(?=@(?!@\s*$))
pop: true
- match: ^
push:
- meta_scope: meta.diff.header.metavariables.smpl
- match: ^(@@)
captures:
0: meta.diff.range.smpl
1: punctuation.definition.range.diff.smpl
pop: true
- match: (?<=@@)\s*$\n?
push:
- meta_content_scope: source.embedded.ocaml
- match: ^(?=@)
pop: true
- include: comment
- include: scope:source.ocaml
str:
- include: strDouble
- include: strSingle
strDouble:
- match: '"'
captures:
0: punctuation.definition.string.begin
push:
- meta_scope: string.quoted.double
- match: '"|(?=$)'
captures:
0: punctuation.definition.string.end
pop: true
- include: esc
strSingle:
- match: "'"
captures:
0: punctuation.definition.string.begin
push:
- meta_scope: string.quoted.single
- match: '''|(?=$)'
captures:
0: punctuation.definition.string.end
pop: true
- include: esc
variables:
- match: '(?<!^)(@)[\w]+'
scope: variable.at-prefix.smpl
captures:
1: keyword.operator.variable.smpl
virtual:
- match: ^\s*(virtual)\s+(.*)
captures:
1: storage.modifier.virtual.smpl
when:
- match: '(?<=\s|\.{3})(when)\s*(any(?:\s|$)|!=)'
captures:
1: keyword.control.flow.when.smpl
2: keyword.operator.comparison.smpl