Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/coffee.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
---|---|---|---|---|---|
2 | <!DOCTYPE language SYSTEM "language.dtd"> | 2 | <!DOCTYPE language SYSTEM "language.dtd"> | ||
3 | 3 | | |||
4 | <language name="CoffeeScript" | 4 | <language name="CoffeeScript" | ||
5 | version="5" | 5 | version="6" | ||
6 | kateversion="3.4" | 6 | kateversion="3.4" | ||
7 | section="Scripts" | 7 | section="Scripts" | ||
8 | extensions="Cakefile;*.coffee;*.coco;*.cson" | 8 | extensions="Cakefile;*.coffee;*.coco;*.cson" | ||
9 | mimetype="text/x-coffeescript;application/x-coffeescript;application/vnd.coffeescript" | 9 | mimetype="text/x-coffeescript;application/x-coffeescript;application/vnd.coffeescript" | ||
10 | indenter="python" | 10 | indenter="python" | ||
11 | casesensitive="1" | 11 | casesensitive="1" | ||
12 | author="Max Shawabkeh (max99x@gmail.com)" | 12 | author="Max Shawabkeh (max99x@gmail.com)" | ||
13 | license="MIT"> | 13 | license="MIT"> | ||
▲ Show 20 Lines • Show All 147 Lines • ▼ Show 20 Line(s) | 141 | <context name="Normal" attribute="Normal" lineEndContext="#stay"> | |||
161 | <!-- Generic identifiers. --> | 161 | <!-- Generic identifiers. --> | ||
162 | <RegExpr attribute="Identifier" context="#stay" String="[_$a-z][$\w]*\b" insensitive="true"/> | 162 | <RegExpr attribute="Identifier" context="#stay" String="[_$a-z][$\w]*\b" insensitive="true"/> | ||
163 | <!-- Strings. --> | 163 | <!-- Strings. --> | ||
164 | <StringDetect attribute="String" context="Heredoc" String="'''" beginRegion="Heredoc"/> | 164 | <StringDetect attribute="String" context="Heredoc" String="'''" beginRegion="Heredoc"/> | ||
165 | <StringDetect attribute="String" context="Rich Heredoc" String=""""" beginRegion="Rich Heredoc"/> | 165 | <StringDetect attribute="String" context="Rich Heredoc" String=""""" beginRegion="Rich Heredoc"/> | ||
166 | <DetectChar attribute="String" context="String" char="'"/> | 166 | <DetectChar attribute="String" context="String" char="'"/> | ||
167 | <DetectChar attribute="String" context="Rich String" char="""/> | 167 | <DetectChar attribute="String" context="Rich String" char="""/> | ||
168 | <!-- Embedded JavaScript. --> | 168 | <!-- Embedded JavaScript. --> | ||
169 | <StringDetect attribute="Javascript" context="Javascript Triple Backticks" String="```" beginRegion="Javascript TB"/> | ||||
169 | <DetectChar attribute="Javascript" context="Javascript" char="`" beginRegion="Javascript"/> | 170 | <DetectChar attribute="Javascript" context="Javascript" char="`" beginRegion="Javascript"/> | ||
170 | <!-- Comments. --> | 171 | <!-- Comments. --> | ||
171 | <StringDetect attribute="Comment" context="Multiline Comment" String="###" beginRegion="Comment"/> | 172 | <StringDetect attribute="Comment" context="Multiline Comment" String="###" beginRegion="Comment"/> | ||
172 | <DetectChar attribute="Comment" context="Comment" char="#"/> | 173 | <DetectChar attribute="Comment" context="Comment" char="#"/> | ||
173 | <!-- Regular expressions. --> | 174 | <!-- Regular expressions. --> | ||
174 | <StringDetect attribute="Regex" context="Multiline Regex" String="///" beginRegion="Multiline Regex"/> | 175 | <StringDetect attribute="Regex" context="Multiline Regex" String="///" beginRegion="Multiline Regex"/> | ||
175 | <RegExpr attribute="Regex" context="#stay" String="/([^/\\\r\n]|\\.)*/[mig]{0,3}"/> | 176 | <RegExpr attribute="Regex" context="#stay" String="/([^/\\\r\n]|\\.)*/[mig]{0,3}"/> | ||
176 | <!-- Member objects. --> | 177 | <!-- Member objects. --> | ||
Show All 21 Lines | 198 | <context name="Comment" attribute="Comment" lineEndContext="#pop"> | |||
198 | <IncludeRules context="##Alerts_indent"/> | 199 | <IncludeRules context="##Alerts_indent"/> | ||
199 | </context> | 200 | </context> | ||
200 | <context name="Multiline Comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="1"> | 201 | <context name="Multiline Comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="1"> | ||
201 | <StringDetect attribute="Comment" context="#pop" String="###" endRegion="Comment"/> | 202 | <StringDetect attribute="Comment" context="#pop" String="###" endRegion="Comment"/> | ||
202 | <IncludeRules context="##Alerts_indent"/> | 203 | <IncludeRules context="##Alerts_indent"/> | ||
203 | </context> | 204 | </context> | ||
204 | <!-- Single-line strings. --> | 205 | <!-- Single-line strings. --> | ||
205 | <context name="String" attribute="String" lineEndContext="#stay"> | 206 | <context name="String" attribute="String" lineEndContext="#stay"> | ||
206 | <HlCStringChar attribute="String" context="#stay"/> | 207 | <IncludeRules context="Escape"/> | ||
207 | <DetectChar attribute="String" context="#pop" char="'"/> | 208 | <DetectChar attribute="String" context="#pop" char="'"/> | ||
208 | </context> | 209 | </context> | ||
209 | <context name="Rich String" attribute="String" lineEndContext="#stay"> | 210 | <context name="Rich String" attribute="String" lineEndContext="#stay"> | ||
210 | <HlCStringChar attribute="String" context="#stay"/> | 211 | <IncludeRules context="Escape"/> | ||
211 | <Detect2Chars attribute="Embedding" context="Embedding" char="#" char1="{"/> | 212 | <Detect2Chars attribute="Embedding" context="Embedding" char="#" char1="{"/> | ||
212 | <DetectChar attribute="String" context="#pop" char="""/> | 213 | <DetectChar attribute="String" context="#pop" char="""/> | ||
213 | </context> | 214 | </context> | ||
214 | <!-- Multi-line strings. --> | 215 | <!-- Multi-line strings. --> | ||
215 | <context name="Heredoc" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="1"> | 216 | <context name="Heredoc" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="1"> | ||
216 | <HlCStringChar attribute="String" context="#stay"/> | 217 | <IncludeRules context="Escape"/> | ||
217 | <StringDetect attribute="String" context="#pop" String="'''" endRegion="Heredoc"/> | 218 | <StringDetect attribute="String" context="#pop" String="'''" endRegion="Heredoc"/> | ||
218 | </context> | 219 | </context> | ||
219 | <context name="Rich Heredoc" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="1"> | 220 | <context name="Rich Heredoc" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="1"> | ||
220 | <HlCStringChar attribute="String" context="#stay"/> | 221 | <IncludeRules context="Escape"/> | ||
221 | <Detect2Chars attribute="Embedding" context="Embedding" char="#" char1="{"/> | 222 | <Detect2Chars attribute="Embedding" context="Embedding" char="#" char1="{"/> | ||
222 | <StringDetect attribute="String" context="#pop" String=""""" endRegion="Rich Heredoc"/> | 223 | <StringDetect attribute="String" context="#pop" String=""""" endRegion="Rich Heredoc"/> | ||
223 | </context> | 224 | </context> | ||
225 | <!-- Escaped characters. --> | ||||
226 | <context name="Escape" attribute="String" lineEndContext="#stay"> | ||||
227 | <!-- Hexadecimal, unicode & reserved character escape sequences. --> | ||||
228 | <RegExpr attribute="Escape" context="#stay" String="\\(x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u\{[0-9a-fA-F]+\}|[\\0bfnrtv"'])"/> | ||||
229 | <!-- Invalid escapes. Octal escape sequences are not allowed. --> | ||||
230 | <RegExpr attribute="Error" context="#stay" String="\\[ux1-7]"/> | ||||
231 | <!-- Make any character literal. --> | ||||
232 | <RegExpr attribute="Literal Character Escape" context="#stay" String="\\."/> | ||||
233 | <LineContinue attribute="Escape" context="#stay"/> | ||||
234 | </context> | ||||
224 | <!-- Expressions embedded in strings. --> | 235 | <!-- Expressions embedded in strings. --> | ||
225 | <context name="Embedding" attribute="Normal" lineEndContext="#stay"> | 236 | <context name="Embedding" attribute="Normal" lineEndContext="#stay"> | ||
226 | <DetectChar attribute="Embedding" context="#pop" char="}"/> | 237 | <DetectChar attribute="Embedding" context="#pop" char="}"/> | ||
227 | </context> | 238 | </context> | ||
228 | <!-- Embedded Javascript. --> | 239 | | ||
229 | <context name="Javascript" attribute="Javascript" lineEndContext="#stay" noIndentationBasedFolding="1"> | 240 | <!-- Embedded Javascript (one backtick). --> | ||
241 | <context name="Javascript" attribute="Normal" lineEndContext="#stay" noIndentationBasedFolding="1"> | ||||
230 | <DetectChar attribute="Javascript" context="#pop" char="`" endRegion="Javascript"/> | 242 | <DetectChar attribute="Javascript" context="#pop" char="`" endRegion="Javascript"/> | ||
231 | <!-- NOTE: This hides errors where a backtick is embedded in a JS string. --> | 243 | <!-- NOTE: This hides errors where a backtick is embedded in a JS string or a comment. --> | ||
244 | <IncludeRules context="Overwrite Javascript"/> | ||||
245 | <IncludeRules context="Normal##JavaScript" includeAttrib="true"/> | ||||
246 | </context> | ||||
247 | <!-- Allow template strings in JavaScript embedded code (with one backtick). --> | ||||
248 | <context name="Overwrite Javascript" attribute="Javascript" lineEndContext="#stay" noIndentationBasedFolding="1"> | ||||
249 | <!-- JavaScript Template. --> | ||||
250 | <Detect2Chars attribute="JavaScript Template" context="Javascript Template" char="\" char1="`"/> | ||||
251 | <RegExpr attribute="Error" context="#stay" String="String\.raw(?=`)"/> | ||||
252 | <StringDetect attribute="JavaScript Template" context="Javascript RawTemplate" String="String.raw\`"/> | ||||
253 | <!-- Contexts of javascript.xml. --> | ||||
254 | <DetectChar attribute="JavaScript Symbol" context="JavaScript Object" char="{" beginRegion="Brace" /> | ||||
255 | </context> | ||||
256 | <context name="JavaScript Object" attribute="Normal" lineEndContext="#stay" noIndentationBasedFolding="1"> | ||||
257 | <DetectChar context="#pop" char="`" lookAhead="true"/> | ||||
258 | <DetectChar attribute="JavaScript Symbol" context="#pop" char="}" endRegion="Brace"/> | ||||
259 | <IncludeRules context="Overwrite Javascript"/> | ||||
260 | <IncludeRules context="Object##JavaScript"/> | ||||
261 | </context> | ||||
262 | <context name="Javascript Template" attribute="JavaScript Template" lineEndContext="#stay" noIndentationBasedFolding="1"> | ||||
263 | <RegExpr attribute="Escape" context="#stay" String="\\\\\\`"/> | ||||
264 | <Detect2Chars attribute="JavaScript Template" context="#pop" char="\" char1="`"/> <!-- End template. --> | ||||
265 | <DetectChar context="#pop" char="`" lookAhead="true"/> | ||||
266 | <Detect2Chars attribute="JavaScript Substitution" context="Javascript Substitution" char="$" char1="{"/> | ||||
267 | <IncludeRules context="Template##JavaScript"/> | ||||
268 | <RegExpr attribute="Error" context="#stay" String="([^\\\s](?=`)|\S(?=\s+`))"/> | ||||
269 | </context> | ||||
270 | <context name="Javascript RawTemplate" attribute="JavaScript Template" lineEndContext="#stay"> | ||||
271 | <Detect2Chars attribute="JavaScript Template" context="#stay" char="\" char1="\"/> | ||||
272 | <Detect2Chars attribute="JavaScript Template" context="#pop" char="\" char1="`"/> | ||||
273 | <DetectChar context="#pop" char="`" lookAhead="true"/> | ||||
274 | <RegExpr attribute="Error" context="#stay" String="([^\\\s](?=`)|\S(?=\s+`))"/> | ||||
275 | </context> | ||||
276 | <context name="Javascript Substitution" attribute="Normal" lineEndContext="#stay" noIndentationBasedFolding="1"> | ||||
277 | <DetectChar attribute="Javascript" context="#pop" char="`" lookAhead="true"/> | ||||
278 | <DetectChar context="#pop" attribute="JavaScript Substitution" char="}"/> | ||||
279 | <IncludeRules context="Overwrite Javascript"/> | ||||
280 | <IncludeRules context="Substitution##JavaScript"/> | ||||
281 | </context> | ||||
282 | <!-- Embedded Javascript (triple backticks). --> | ||||
283 | <context name="Javascript Triple Backticks" attribute="Normal" lineEndContext="#stay" noIndentationBasedFolding="1"> | ||||
284 | <StringDetect attribute="Javascript" context="#pop" String="```" endRegion="Javascript TB"/> | ||||
285 | <DetectChar attribute="JavaScript Symbol" context="JavaScript-TB Object" char="{" beginRegion="Brace"/> | ||||
232 | <IncludeRules context="Normal##JavaScript" includeAttrib="true"/> | 286 | <IncludeRules context="Normal##JavaScript" includeAttrib="true"/> | ||
233 | </context> | 287 | </context> | ||
288 | <context name="JavaScript-TB Object" attribute="Normal" lineEndContext="#stay" noIndentationBasedFolding="1"> | ||||
289 | <StringDetect attribute="Javascript" context="#pop" String="```" lookAhead="true"/> | ||||
290 | <DetectChar attribute="JavaScript Symbol" context="#pop" char="}" endRegion="Brace"/> | ||||
291 | <DetectChar attribute="JavaScript Symbol" context="JavaScript-TB Object" char="{" beginRegion="Brace"/> | ||||
292 | <IncludeRules context="Object##JavaScript"/> | ||||
293 | </context> | ||||
234 | </contexts> | 294 | </contexts> | ||
235 | <!-- Style mappings. --> | 295 | <!-- Style mappings. --> | ||
236 | <itemDatas> | 296 | <itemDatas> | ||
237 | <itemData name="Normal" defStyleNum="dsNormal" spellChecking="false"/> | 297 | <itemData name="Normal" defStyleNum="dsNormal" spellChecking="false"/> | ||
238 | <itemData name="Identifier" defStyleNum="dsNormal" spellChecking="false"/> | 298 | <itemData name="Identifier" defStyleNum="dsNormal" spellChecking="false"/> | ||
239 | <itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/> | 299 | <itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/> | ||
240 | <itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/> | 300 | <itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/> | ||
241 | <itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false"/> | 301 | <itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false"/> | ||
Show All 9 Lines | |||||
251 | <itemData name="Javascript" defStyleNum="dsAlert" spellChecking="false" italic="1"/> | 311 | <itemData name="Javascript" defStyleNum="dsAlert" spellChecking="false" italic="1"/> | ||
252 | <itemData name="Regex" defStyleNum="dsString" spellChecking="false"/> | 312 | <itemData name="Regex" defStyleNum="dsString" spellChecking="false"/> | ||
253 | <itemData name="Reserved" defStyleNum="dsAlert" spellChecking="false"/> | 313 | <itemData name="Reserved" defStyleNum="dsAlert" spellChecking="false"/> | ||
254 | <itemData name="Value Keywords" defStyleNum="dsOthers" spellChecking="false"/> | 314 | <itemData name="Value Keywords" defStyleNum="dsOthers" spellChecking="false"/> | ||
255 | <itemData name="Globals" defStyleNum="dsOthers" spellChecking="false"/> | 315 | <itemData name="Globals" defStyleNum="dsOthers" spellChecking="false"/> | ||
256 | <!-- Context-sensitive globals - not styled by default. --> | 316 | <!-- Context-sensitive globals - not styled by default. --> | ||
257 | <itemData name="Browser Globals" defStyleNum="dsNormal" spellChecking="false"/> | 317 | <itemData name="Browser Globals" defStyleNum="dsNormal" spellChecking="false"/> | ||
258 | <itemData name="Node.js Globals" defStyleNum="dsNormal" spellChecking="false"/> | 318 | <itemData name="Node.js Globals" defStyleNum="dsNormal" spellChecking="false"/> | ||
319 | <itemData name="Escape" defStyleNum="dsSpecialChar" spellChecking="false" /> | ||||
320 | <itemData name="Literal Character Escape" defStyleNum="dsChar" spellChecking="false" /> | ||||
321 | <itemData name="Error" defStyleNum="dsError" spellChecking="false"/> | ||||
322 | | ||||
323 | <itemData name="JavaScript Symbol" defStyleNum="dsOperator" spellChecking="false"/> | ||||
324 | <itemData name="JavaScript Template" defStyleNum="dsVerbatimString"/> | ||||
325 | <itemData name="JavaScript Substitution" defStyleNum="dsSpecialChar" spellChecking="false"/> | ||||
259 | </itemDatas> | 326 | </itemDatas> | ||
260 | </highlighting> | 327 | </highlighting> | ||
261 | <!-- Global settings. --> | 328 | <!-- Global settings. --> | ||
262 | <general> | 329 | <general> | ||
263 | <indentation mode="python"/> | 330 | <indentation mode="python"/> | ||
264 | <folding indentationsensitive="1"/> | 331 | <folding indentationsensitive="1"/> | ||
265 | <comments> | 332 | <comments> | ||
266 | <comment name="singleLine" start="#"/> | 333 | <comment name="singleLine" start="#"/> | ||
267 | <comment name="multiLine" start="###" end="###" region="Comment"/> | 334 | <comment name="multiLine" start="###" end="###" region="Comment"/> | ||
268 | </comments> | 335 | </comments> | ||
269 | <keywords casesensitive="1" additionalDeliminator="#'"/> | 336 | <keywords casesensitive="1" additionalDeliminator="#'`"/> | ||
270 | <emptyLines> | 337 | <emptyLines> | ||
271 | <emptyLine regexpr="(?:\s+|\s*#.*)"/> | 338 | <emptyLine regexpr="(?:\s+|\s*#.*)"/> | ||
272 | </emptyLines> | 339 | </emptyLines> | ||
273 | </general> | 340 | </general> | ||
274 | </language> | 341 | </language> |