| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language> |
| 3 |
|
| 4 |
<language name="CoffeeScript" |
| 5 |
version="15" |
| 6 |
kateversion="5.53" |
| 7 |
section="Scripts" |
| 8 |
extensions="Cakefile;*.coffee;*.coco;*.cson" |
| 9 |
mimetype="text/x-coffeescript;application/x-coffeescript;application/vnd.coffeescript" |
| 10 |
indenter="python" |
| 11 |
casesensitive="1" |
| 12 |
author="Max Shawabkeh ([email protected])" |
| 13 |
license="MIT"> |
| 14 |
<highlighting> |
| 15 |
<!-- Built-in constants. --> |
| 16 |
<list name="value_keywords"> |
| 17 |
<item>false</item> |
| 18 |
<item>true</item> |
| 19 |
<item>yes</item> |
| 20 |
<item>no</item> |
| 21 |
<item>on</item> |
| 22 |
<item>off</item> |
| 23 |
<item>undefined</item> |
| 24 |
<item>null</item> |
| 25 |
<item>NaN</item> |
| 26 |
<item>Infinity</item> |
| 27 |
</list> |
| 28 |
<!-- Generic keywords. --> |
| 29 |
<list name="keywords"> |
| 30 |
<item>return</item> |
| 31 |
<item>break</item> |
| 32 |
<item>continue</item> |
| 33 |
<item>throw</item> |
| 34 |
<item>for</item> |
| 35 |
<item>while</item> |
| 36 |
<item>until</item> |
| 37 |
<item>loop</item> |
| 38 |
<item>if</item> |
| 39 |
<item>else</item> |
| 40 |
<item>unless</item> |
| 41 |
<item>switch</item> |
| 42 |
<item>when</item> |
| 43 |
<item>then</item> |
| 44 |
<item>and</item> |
| 45 |
<item>or</item> |
| 46 |
<item>in</item> |
| 47 |
<item>do</item> |
| 48 |
<item>of</item> |
| 49 |
<item>by</item> |
| 50 |
<item>is</item> |
| 51 |
<item>isnt</item> |
| 52 |
<item>not</item> |
| 53 |
<item>typeof</item> |
| 54 |
<item>delete</item> |
| 55 |
<item>where</item> |
| 56 |
<item>super</item> |
| 57 |
<item>try</item> |
| 58 |
<item>catch</item> |
| 59 |
<item>finally</item> |
| 60 |
<item>try</item> |
| 61 |
<item>catch</item> |
| 62 |
<item>finally</item> |
| 63 |
<item>constructor</item> |
| 64 |
</list> |
| 65 |
<!-- Keywords which are always followed by a class name. --> |
| 66 |
<list name="class_keywords"> |
| 67 |
<item>class</item> |
| 68 |
<item>extends</item> |
| 69 |
<item>new</item> |
| 70 |
<item>instanceof</item> |
| 71 |
</list> |
| 72 |
<!-- Reserved words. --> |
| 73 |
<list name="reserved"> |
| 74 |
<item>case</item> |
| 75 |
<item>default</item> |
| 76 |
<item>function</item> |
| 77 |
<item>var</item> |
| 78 |
<item>void</item> |
| 79 |
<item>with</item> |
| 80 |
<item>const</item> |
| 81 |
<item>let</item> |
| 82 |
<item>enum</item> |
| 83 |
<item>export</item> |
| 84 |
<item>import</item> |
| 85 |
<item>native</item> |
| 86 |
<item>__hasProp</item> |
| 87 |
<item>__extends</item> |
| 88 |
<item>__slice</item> |
| 89 |
<item>__bind</item> |
| 90 |
<item>__indexOf</item> |
| 91 |
</list> |
| 92 |
<!-- Built-in globals provided in most contexts. --> |
| 93 |
<list name="globals"> |
| 94 |
<item>Object</item> |
| 95 |
<item>Number</item> |
| 96 |
<item>Boolean</item> |
| 97 |
<item>Array</item> |
| 98 |
<item>String</item> |
| 99 |
<item>RegExp</item> |
| 100 |
<item>Function</item> |
| 101 |
<item>Date</item> |
| 102 |
<item>Math</item> |
| 103 |
<item>eval</item> |
| 104 |
<item>setInterval</item> |
| 105 |
<item>clearInterval</item> |
| 106 |
<item>setTimeout</item> |
| 107 |
<item>clearTimeout</item> |
| 108 |
<item>isFinite</item> |
| 109 |
<item>isNaN</item> |
| 110 |
<item>parseFloat</item> |
| 111 |
<item>parseInt</item> |
| 112 |
<item>escape</item> |
| 113 |
<item>unescape</item> |
| 114 |
<item>console</item> |
| 115 |
<item>encodeURI</item> |
| 116 |
<item>encodeURIComponent</item> |
| 117 |
<item>decodeURI</item> |
| 118 |
<item>decodeURIComponent</item> |
| 119 |
</list> |
| 120 |
<!-- Built-in globals provided in browser context. --> |
| 121 |
<list name="browser_globals"> |
| 122 |
<item>window</item> |
| 123 |
<item>document</item> |
| 124 |
<item>navigator</item> |
| 125 |
<item>location</item> |
| 126 |
<item>history</item> |
| 127 |
<item>screen</item> |
| 128 |
<item>alert</item> |
| 129 |
<item>prompt</item> |
| 130 |
</list> |
| 131 |
<!-- Built-in globals provided in Node.js context. --> |
| 132 |
<list name="nodejs_globals"> |
| 133 |
<item>process</item> |
| 134 |
<item>GLOBAL</item> |
| 135 |
<item>require</item> |
| 136 |
<item>exports</item> |
| 137 |
</list> |
| 138 |
<!-- Context-sensitive highlighting rules. --> |
| 139 |
<contexts> |
| 140 |
<!-- Generic code. --> |
| 141 |
<context name="Normal" attribute="Normal" lineEndContext="#stay"> |
| 142 |
<DetectSpaces/> |
| 143 |
<!-- Numbers. --> |
| 144 |
<Float attribute="Float" context="#stay"/> |
| 145 |
<Int attribute="Decimal" context="#stay"/> |
| 146 |
<HlCOct attribute="Oct" context="#stay"/> |
| 147 |
<HlCHex attribute="Hex" context="#stay"/> |
| 148 |
<!-- Keywords. --> |
| 149 |
<keyword attribute="Keyword" context="#stay" String="keywords"/> |
| 150 |
<keyword attribute="Keyword" context="Class" String="class_keywords"/> |
| 151 |
<keyword attribute="Value Keywords" context="#stay" String="value_keywords"/> |
| 152 |
<keyword attribute="Reserved" context="#stay" String="reserved"/> |
| 153 |
<!-- Globals. --> |
| 154 |
<keyword attribute="Globals" context="#stay" String="globals"/> |
| 155 |
<keyword attribute="Browser Globals" context="#stay" String="browser_globals"/> |
| 156 |
<keyword attribute="Node.js Globals" context="#stay" String="nodejs_globals"/> |
| 157 |
<!-- Member accessors. --> |
| 158 |
<RegExpr attribute="Accessor" context="#stay" String="(?:@[_$a-zA-Z][$\w]*|\bthis)\b" insensitive="false"/> |
| 159 |
<!-- Function definitions. Matches an optional argument list followed by a function arrow (normal or fat). --> |
| 160 |
<RegExpr attribute="Function" context="#stay" String="(?:\((?:\'[^']*'|"[^"]*"|[^()])*\))?\s*(?:\-|=)>" insensitive="true"/> |
| 161 |
<!-- Generic identifiers. --> |
| 162 |
<RegExpr attribute="Identifier" context="#stay" String="[_$a-z][$\w]*\b" insensitive="true"/> |
| 163 |
<!-- Strings. --> |
| 164 |
<StringDetect attribute="String" context="Heredoc" String="'''" beginRegion="Heredoc"/> |
| 165 |
<StringDetect attribute="String" context="Rich Heredoc" String=""""" beginRegion="Rich Heredoc"/> |
| 166 |
<DetectChar attribute="String" context="String" char="'"/> |
| 167 |
<DetectChar attribute="String" context="Rich String" char="""/> |
| 168 |
<!-- Embedded JavaScript. --> |
| 169 |
<StringDetect attribute="Javascript" context="Javascript Triple Backticks" String="```" beginRegion="Javascript TB"/> |
| 170 |
<DetectChar attribute="Javascript" context="Javascript" char="`" beginRegion="Javascript"/> |
| 171 |
<!-- Comments. --> |
| 172 |
<StringDetect attribute="Comment" context="Multiline Comment" String="###" beginRegion="Comment"/> |
| 173 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 174 |
<!-- Regular expressions. --> |
| 175 |
<StringDetect attribute="Regex" context="Multiline Regex" String="///" beginRegion="Multiline Regex"/> |
| 176 |
<RegExpr attribute="Regex" context="#stay" String="/(?:[^/\\\r\n]|\\.)*/[mig]{0,3}"/> |
| 177 |
<!-- Member objects. --> |
| 178 |
<DetectChar attribute="Symbol" context="Member Object" char="."/> |
| 179 |
<!-- Operators and other non-alphanumeric symbols. --> |
| 180 |
<AnyChar attribute="Symbol" context="#stay" String="():!%&+,-/.*<=>?[]|~^;{}"/> |
| 181 |
</context> |
| 182 |
<!-- Multiline regular expressions. --> |
| 183 |
<context name="Multiline Regex" attribute="Regex" lineEndContext="#stay" noIndentationBasedFolding="1"> |
| 184 |
<HlCStringChar attribute="Regex" context="#stay"/> |
| 185 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 186 |
<RegExpr attribute="Regex" context="#pop" String="///[mig]{0,3}" endRegion="Multiline Regex"/> |
| 187 |
</context> |
| 188 |
<!-- Class names. --> |
| 189 |
<context name="Class" attribute="Normal" lineEndContext="#stay"> |
| 190 |
<DetectSpaces/> |
| 191 |
<RegExpr attribute="Class" context="#pop" String="[@$:.\w\[\]]+"/> |
| 192 |
</context> |
| 193 |
<!-- Member objects. --> |
| 194 |
<context name="Member Object" attribute="Normal" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> |
| 195 |
<RegExpr attribute="Identifier" context="#pop" String="\s*[_$a-z][$\w]*" insensitive="true"/> |
| 196 |
</context> |
| 197 |
<!-- Comments. --> |
| 198 |
<context name="Comment" attribute="Comment" lineEndContext="#pop"> |
| 199 |
<IncludeRules context="##Comments"/> |
| 200 |
</context> |
| 201 |
<context name="Multiline Comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="1"> |
| 202 |
<StringDetect attribute="Comment" context="#pop" String="###" endRegion="Comment"/> |
| 203 |
<IncludeRules context="##Comments"/> |
| 204 |
</context> |
| 205 |
<!-- Single-line strings. --> |
| 206 |
<context name="String" attribute="String" lineEndContext="#stay"> |
| 207 |
<IncludeRules context="Escape"/> |
| 208 |
<DetectChar attribute="String" context="#pop" char="'"/> |
| 209 |
</context> |
| 210 |
<context name="Rich String" attribute="String" lineEndContext="#stay"> |
| 211 |
<IncludeRules context="Escape"/> |
| 212 |
<Detect2Chars attribute="Embedding" context="Embedding" char="#" char1="{"/> |
| 213 |
<DetectChar attribute="String" context="#pop" char="""/> |
| 214 |
</context> |
| 215 |
<!-- Multi-line strings. --> |
| 216 |
<context name="Heredoc" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="1"> |
| 217 |
<IncludeRules context="Escape"/> |
| 218 |
<StringDetect attribute="String" context="#pop" String="'''" endRegion="Heredoc"/> |
| 219 |
</context> |
| 220 |
<context name="Rich Heredoc" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="1"> |
| 221 |
<IncludeRules context="Escape"/> |
| 222 |
<Detect2Chars attribute="Embedding" context="Embedding" char="#" char1="{"/> |
| 223 |
<StringDetect attribute="String" context="#pop" String=""""" endRegion="Rich Heredoc"/> |
| 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> |
| 235 |
<!-- Expressions embedded in strings. --> |
| 236 |
<context name="Embedding" attribute="Normal" lineEndContext="#stay"> |
| 237 |
<DetectChar attribute="Embedding" context="#pop" char="}"/> |
| 238 |
</context> |
| 239 |
|
| 240 |
<!-- Embedded Javascript (one backtick). --> |
| 241 |
|
| 242 |
<context name="Javascript" attribute="Normal" lineEndContext="#stay" noIndentationBasedFolding="1"> |
| 243 |
<DetectChar attribute="Javascript" context="#pop" char="`" endRegion="Javascript"/> |
| 244 |
<!-- NOTE: This hides errors where a backtick is embedded in a JS string or a comment. --> |
| 245 |
<IncludeRules context="Overwrite Javascript"/> |
| 246 |
<IncludeRules context="Normal##JavaScript" includeAttrib="true"/> |
| 247 |
</context> |
| 248 |
|
| 249 |
<!-- Allow template strings in JavaScript embedded code (with one backtick). --> |
| 250 |
<context name="Overwrite Javascript" attribute="Normal" lineEndContext="#stay" noIndentationBasedFolding="1"> |
| 251 |
<!-- JavaScript Template. --> |
| 252 |
<Detect2Chars attribute="JavaScript Template" context="Javascript Template" char="\" char1="`" beginRegion="Template"/> |
| 253 |
<RegExpr context="Javascript StartRawTemplate" String="\b(String)\s*(\.)\s*(raw)\s*\\`" lookAhead="true"/> |
| 254 |
<!-- Tagged Template Literals --> |
| 255 |
<RegExpr attribute="JavaScript Function Name" context="#stay" String="[a-zA-Z_$[:^ascii:]][\w$[:^ascii:]]*(?=\s*\\`)" /> |
| 256 |
<RegExpr attribute="Error" context="#stay" String="\bString\s*\.\s*raw(?=\s*`)" /> |
| 257 |
<RegExpr attribute="Normal" context="#stay" String="[a-zA-Z_$[:^ascii:]][\w$[:^ascii:]]*(?=\s*`)" /> |
| 258 |
<!-- Contexts of javascript.xml. --> |
| 259 |
<DetectChar attribute="Normal" context="JavaScript Object" char="{" beginRegion="Brace" /> |
| 260 |
</context> |
| 261 |
<context name="JavaScript Object" attribute="Normal" lineEndContext="#stay" noIndentationBasedFolding="1"> |
| 262 |
<DetectChar context="#pop" char="`" lookAhead="true"/> |
| 263 |
<DetectChar attribute="Normal" context="#pop" char="}" endRegion="Brace"/> |
| 264 |
<IncludeRules context="Overwrite Javascript"/> |
| 265 |
<IncludeRules context="Object##JavaScript"/> |
| 266 |
</context> |
| 267 |
|
| 268 |
<context name="Javascript Template" attribute="JavaScript Template" lineEndContext="#stay" noIndentationBasedFolding="1"> |
| 269 |
<StringDetect attribute="Escape" context="#stay" String="\\\`"/> |
| 270 |
<Detect2Chars attribute="JavaScript Template" context="RegExpAfterString##JavaScript" char="\" char1="`" endRegion="Template"/> <!-- End template. --> |
| 271 |
<DetectChar context="#pop" char="`" lookAhead="true"/> |
| 272 |
<Detect2Chars attribute="JavaScript Substitution" context="Javascript Substitution" char="$" char1="{"/> |
| 273 |
<IncludeRules context="Template##JavaScript"/> |
| 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 attribute="JavaScript Substitution" context="#pop" char="}"/> |
| 279 |
<IncludeRules context="Overwrite Javascript"/> |
| 280 |
<IncludeRules context="Substitution##JavaScript"/> |
| 281 |
</context> |
| 282 |
|
| 283 |
<context name="Javascript StartRawTemplate" attribute="JavaScript Template" lineEndContext="#pop" noIndentationBasedFolding="1"> |
| 284 |
<DetectSpaces /> |
| 285 |
<Detect2Chars attribute="JavaScript Template" context="#pop!Javascript RawTemplate" char="\" char1="`" beginRegion="Template"/> |
| 286 |
<StringDetect attribute="JavaScript Built-in Objects" context="#stay" String="%1" dynamic="true"/> |
| 287 |
<DetectChar attribute="JavaScript Symbol" context="#stay" char="2" dynamic="true"/> |
| 288 |
<StringDetect attribute="JavaScript Function Name" context="#stay" String="%3" dynamic="true"/> |
| 289 |
</context> |
| 290 |
<context name="Javascript RawTemplate" attribute="JavaScript Template" lineEndContext="#stay" noIndentationBasedFolding="1"> |
| 291 |
<Detect2Chars attribute="JavaScript Template" context="#stay" char="\" char1="\"/> |
| 292 |
<Detect2Chars attribute="JavaScript Template" context="RegExpAfterString##JavaScript" char="\" char1="`" endRegion="Template"/> <!-- End template. --> |
| 293 |
<DetectChar context="#pop" char="`" lookAhead="true"/> |
| 294 |
<RegExpr attribute="Error" context="#stay" String="(?:[^\\\s](?=`)|\S(?=\s+`))"/> |
| 295 |
</context> |
| 296 |
|
| 297 |
<!-- Embedded Javascript (triple backticks). --> |
| 298 |
<context name="Javascript Triple Backticks" attribute="Normal" lineEndContext="#stay" noIndentationBasedFolding="1"> |
| 299 |
<StringDetect attribute="Javascript" context="#pop" String="```" endRegion="Javascript TB"/> |
| 300 |
<DetectChar attribute="Normal" context="JavaScript-TB Object" char="{" beginRegion="Brace"/> |
| 301 |
<IncludeRules context="Normal##JavaScript" includeAttrib="true"/> |
| 302 |
</context> |
| 303 |
<context name="JavaScript-TB Object" attribute="Normal" lineEndContext="#stay" noIndentationBasedFolding="1"> |
| 304 |
<StringDetect attribute="Javascript" context="#pop" String="```" lookAhead="true"/> |
| 305 |
<DetectChar attribute="Normal" context="#pop" char="}" endRegion="Brace"/> |
| 306 |
<DetectChar attribute="Normal" context="JavaScript-TB Object" char="{" beginRegion="Brace"/> |
| 307 |
<IncludeRules context="Object##JavaScript"/> |
| 308 |
</context> |
| 309 |
</contexts> |
| 310 |
<!-- Style mappings. --> |
| 311 |
<itemDatas> |
| 312 |
<itemData name="Normal" defStyleNum="dsNormal" spellChecking="false"/> |
| 313 |
<itemData name="Identifier" defStyleNum="dsNormal" spellChecking="false"/> |
| 314 |
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/> |
| 315 |
<itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/> |
| 316 |
<itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false"/> |
| 317 |
<itemData name="Float" defStyleNum="dsFloat" spellChecking="false"/> |
| 318 |
<itemData name="Oct" defStyleNum="dsBaseN" spellChecking="false"/> |
| 319 |
<itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false"/> |
| 320 |
<itemData name="String" defStyleNum="dsString" spellChecking="false"/> |
| 321 |
<itemData name="Comment" defStyleNum="dsComment" spellChecking="true"/> |
| 322 |
<itemData name="Symbol" defStyleNum="dsKeyword" spellChecking="false"/> |
| 323 |
<itemData name="Embedding" defStyleNum="dsChar" spellChecking="false"/> |
| 324 |
<itemData name="Accessor" defStyleNum="dsDataType" spellChecking="false"/> |
| 325 |
<itemData name="Class" defStyleNum="dsDataType" spellChecking="false" bold="1"/> |
| 326 |
<itemData name="Javascript" defStyleNum="dsAlert" spellChecking="false" italic="1"/> |
| 327 |
<itemData name="Regex" defStyleNum="dsString" spellChecking="false"/> |
| 328 |
<itemData name="Reserved" defStyleNum="dsAlert" spellChecking="false"/> |
| 329 |
<itemData name="Value Keywords" defStyleNum="dsOthers" spellChecking="false"/> |
| 330 |
<itemData name="Globals" defStyleNum="dsOthers" spellChecking="false"/> |
| 331 |
<!-- Context-sensitive globals - not styled by default. --> |
| 332 |
<itemData name="Browser Globals" defStyleNum="dsNormal" spellChecking="false"/> |
| 333 |
<itemData name="Node.js Globals" defStyleNum="dsNormal" spellChecking="false"/> |
| 334 |
<itemData name="Escape" defStyleNum="dsSpecialChar" spellChecking="false" /> |
| 335 |
<itemData name="Literal Character Escape" defStyleNum="dsChar" spellChecking="false" /> |
| 336 |
<itemData name="Error" defStyleNum="dsError" spellChecking="false"/> |
| 337 |
|
| 338 |
<itemData name="JavaScript Template" defStyleNum="dsVerbatimString"/> |
| 339 |
<itemData name="JavaScript Substitution" defStyleNum="dsSpecialChar" spellChecking="false"/> |
| 340 |
<itemData name="JavaScript Function Name" defStyleNum="dsFunction" spellChecking="false"/> |
| 341 |
<itemData name="JavaScript Built-in Objects" defStyleNum="dsBuiltIn" spellChecking="false" /> |
| 342 |
<itemData name="JavaScript Symbol" defStyleNum="dsOperator" spellChecking="false" /> |
| 343 |
</itemDatas> |
| 344 |
</highlighting> |
| 345 |
<!-- Global settings. --> |
| 346 |
<general> |
| 347 |
<folding indentationsensitive="1"/> |
| 348 |
<comments> |
| 349 |
<comment name="singleLine" start="#" position="afterwhitespace"/> |
| 350 |
<comment name="multiLine" start="###" end="###" region="Comment"/> |
| 351 |
</comments> |
| 352 |
<keywords casesensitive="1" additionalDeliminator="#'`"/> |
| 353 |
<emptyLines> |
| 354 |
<emptyLine regexpr="(?:\s+|\s*#.*)"/> |
| 355 |
</emptyLines> |
| 356 |
</general> |
| 357 |
</language> |
| 358 |
<!-- kate: replace-tabs on; tab-width 2; indent-width 2; --> |