/
SyntaxDefinition.xml
230 lines (178 loc) · 9.57 KB
/
SyntaxDefinition.xml
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<?xml version="1.0" encoding="UTF-8"?>
<syntax>
<!--
The <head> tag encloses some global information about the mode.
This tag is required.
-->
<head>
<!--
The <name> specifies the modes name.
This tag is required and must match with the name in the plist after the SEEMode..
-->
<name>YAML</name>
<!-- optional to add spelling-dictionary autocomplete words -->
<autocompleteoptions use-spelling-dictionary="yes" />
<!--
The <charsintokens> and the <charsdelimitingtokens> instruct the syntax highlighter
where to tokenize the text for fast finding of plain strings.
The <charsintokens> tag specifies the characters that can occur in strings,
the <charsdelimitingtokens> tag specifies the tags that cannot occur in strings.
One of these tags has to be specified.
Tip: Use CDATA here.
-->
<charsintokens><![CDATA[_0987654321abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@]]></charsintokens>
<!-- <charsdelimitingtokens><![CDATA[ -]]></charsdelimitingtokens> -->
<!--
the <charsincompletion> defines characters used for autocompletion. e.g. in perl
you want this to include the $ sign to autocomplete variables.
If left out the regular expression word boundaries are used.
-->
<!-- <charsincompletion><![CDATA[_0987654321abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-@$</=>!]]></charsincompletion> -->
</head>
<!--
The <states> tag encloses all syntax states.
States are areas of the test that begin and end with an regex like comments or strings,
with exception of the default state, that exists anywhere where no other state exists.
This tag is required.
-->
<states>
<!--
The <default> tag specifies what is colored within the default state (see above).
It features the following attributes, all optional if not noted otherwise:
id
Has to be a unique string. Has to be specified.
color
a html comptible color in three or six letter hexadecimal format.
Used for text on bright document background colors.
inverted-color
a html comptible color in three or six letter hexadecimal format.
Used for text if a dark document background color is set.
font-weight
normal Normal font-weight (default)
bold Bold text in popup
font-style
normal Normal font-weight (default)
italic Bold text in popup
usesymbolsfrommode
a mode name to use the symbol recognition from
when left out the value is inherited from the parent state
useautocompletefrommode
a mode name to use the autocomplete from - default is this mode
when left out the value is inherited from the parent state
type
a string description of the type. currently only the values
"string" and "comment" have meaning and cause bracket matching
and syntax highlighting to ignore these areas of text
-->
<default id="Base" color="#f00" inverted-color="#0f0">
<!--
The <keywords> tag specifies keyword groups within the current state.
It features the following attributes, all optional if not noted otherwise:
id
Has to be a unique string. Has to be specified.
color
a html comptible color in three or six letter hexadecimal format.
Used for text on bright document background colors.
inverted-color
a html comptible color in three or six letter hexadecimal format.
Used for text if a dark document background color is set.
font-weight
normal Normal font-weight (default)
bold Bold text in popup
font-style
normal Normal font-weight (default)
italic Bold text in popup
casesensitive
yes This group is case sensitive (default)
no Ignore case for the group
useforautocomplete
yes Add this group's strings to the autocomplete dictionary (default)
no Don't add to autocomplete dictionary
-->
<keywords id="Keywords" color="#6C0540" casesensitive="no" useforautocomplete="yes">
<!--
<string> tags specify plain text to be colored. If your tag does not
get colored, check in <charsintokens> if you are tokenizing correctly.
-->
<!-- <string>de_DE</string>
<string>en_GB</string> -->
<!--
<regex> tags specify regular expression to be colored.
Only the first group will be colored, so enclose the part to color
with parens.
The example colors digits prefixed by foo. (only the digits)
-->
<regex>^(.*?):</regex>
</keywords>
<keywords id="Other keywords" color="#400080" font-weight="bold" font-style="italic">
<string>de_DE</string>
<string>en_GB</string>
</keywords>
<!--
The <state> tag specifies a state other than the default state.
It features the same attributes as <default>.
It has to contain a <begin> and a <end> tag which in turn have to
contain a <regex> tag. They can contain <keywords> tags like specified above.
For example here a states for C blockcomments, C++ singleline comments and strings.
The strings state handles escaped quotes with a lookbehind regular expression
(see a regex tutorial) and colors "foobar" with strings.
-->
<state id="Comment" color="#236E25" font-style="italic">
<begin><regex>(?:^|\s)#</regex></begin>
<end><regex>[\n\r]</regex></end>
</state>
<state id="String" color="#760f15">
<begin><regex>"</regex></begin>
<end><regex>(((?<!\\)(\\\\)*)|^)"</regex></end>
<keywords id="Other keywords" color="#400080" font-style="italic">
<string>foobar</string>
</keywords>
</state>
<!--
The <import> tag lets you import substates and keywords from other modes.
It features the following attributes, all optional if not noted otherwise:
mode
the mode to import from if left out it will import from this mode
state
the state to import - if left out the content of the
default state will be imported
keywords-only
'yes' if you only want to import the keywords and not the substates
of that state
-->
<state id="Inline Javascript" color="#000" usesymbolsfrommode="Javascript" useautocompletefrommode="Javascript">
<begin><regex><(?=script)</regex></begin>
<end><regex>/script></regex></end>
<import mode="Javascript" />
<keywords id="Script Tags" color="#881280" font-style="italic">
<regex>(\A<\Z)</regex>
<regex>(</script[^>]*>)</regex>
</keywords>
<state id="Opening Script Tag" color="#881280" font-style="italic" usesymbolsfrommode="HTML" useautocompletefrommode="HTML">
<begin><regex>\Ascript</regex></begin>
<end><regex>></regex></end>
<import mode="XML" state="Tags" />
</state>
</state>
<!--
The <state-link> tag lets you reuse complete states including the
begin and end regex as well as the attributes on the linked .
It features the following attributes, all optional if not noted otherwise:
state
the state to link - not optional
mode
the mode to import from if left out it will import from this mode
-->
<state-link state="PHP" mode="PHP-HTML" />
<state id="Ruby" color="#000000" inverted-color="#ffffff" font-style="normal" font-weight="normal" usesymbolsfrommode="Ruby" useautocompletefrommode="Ruby">
<begin><regex>(?:<%=?)</regex></begin>
<end><regex>(?:-?%>)</regex></end>
<import mode="Ruby" />
<keywords id="ERB Delimiter" color="#d00000" inverted-color="#ff2f2f" font-style="normal" font-weight="normal" useforautocomplete="no">
<regex>(-?%>)</regex>
<regex>(<%=?)</regex>
</keywords>
</state>
</default>
</states>
</syntax>