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="9" | 5 | version="10" | ||
6 | kateversion="5.0" | 6 | kateversion="5.0" | ||
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 136 Lines • ▼ Show 20 Line(s) | 141 | <context name="Normal" attribute="Normal" lineEndContext="#stay"> | |||
150 | <keyword attribute="Keyword" context="Class" String="class_keywords"/> | 150 | <keyword attribute="Keyword" context="Class" String="class_keywords"/> | ||
151 | <keyword attribute="Value Keywords" context="#stay" String="value_keywords"/> | 151 | <keyword attribute="Value Keywords" context="#stay" String="value_keywords"/> | ||
152 | <keyword attribute="Reserved" context="#stay" String="reserved"/> | 152 | <keyword attribute="Reserved" context="#stay" String="reserved"/> | ||
153 | <!-- Globals. --> | 153 | <!-- Globals. --> | ||
154 | <keyword attribute="Globals" context="#stay" String="globals"/> | 154 | <keyword attribute="Globals" context="#stay" String="globals"/> | ||
155 | <keyword attribute="Browser Globals" context="#stay" String="browser_globals"/> | 155 | <keyword attribute="Browser Globals" context="#stay" String="browser_globals"/> | ||
156 | <keyword attribute="Node.js Globals" context="#stay" String="nodejs_globals"/> | 156 | <keyword attribute="Node.js Globals" context="#stay" String="nodejs_globals"/> | ||
157 | <!-- Member accessors. --> | 157 | <!-- Member accessors. --> | ||
158 | <RegExpr attribute="Accessor" context="#stay" String="(@[_$a-zA-Z][$\w]*|\bthis)\b" insensitive="false"/> | 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). --> | 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"/> | 160 | <RegExpr attribute="Function" context="#stay" String="(?:\((?:\'[^']*'|"[^"]*"|[^()])*\))?\s*(?:\-|=)>" insensitive="true"/> | ||
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 | <StringDetect attribute="Javascript" context="Javascript Triple Backticks" String="```" beginRegion="Javascript TB"/> | ||
170 | <DetectChar attribute="Javascript" context="Javascript" char="`" beginRegion="Javascript"/> | 170 | <DetectChar attribute="Javascript" context="Javascript" char="`" beginRegion="Javascript"/> | ||
171 | <!-- Comments. --> | 171 | <!-- Comments. --> | ||
172 | <StringDetect attribute="Comment" context="Multiline Comment" String="###" beginRegion="Comment"/> | 172 | <StringDetect attribute="Comment" context="Multiline Comment" String="###" beginRegion="Comment"/> | ||
173 | <DetectChar attribute="Comment" context="Comment" char="#"/> | 173 | <DetectChar attribute="Comment" context="Comment" char="#"/> | ||
174 | <!-- Regular expressions. --> | 174 | <!-- Regular expressions. --> | ||
175 | <StringDetect attribute="Regex" context="Multiline Regex" String="///" beginRegion="Multiline Regex"/> | 175 | <StringDetect attribute="Regex" context="Multiline Regex" String="///" beginRegion="Multiline Regex"/> | ||
176 | <RegExpr attribute="Regex" context="#stay" String="/([^/\\\r\n]|\\.)*/[mig]{0,3}"/> | 176 | <RegExpr attribute="Regex" context="#stay" String="/(?:[^/\\\r\n]|\\.)*/[mig]{0,3}"/> | ||
177 | <!-- Member objects. --> | 177 | <!-- Member objects. --> | ||
178 | <DetectChar attribute="Symbol" context="Member Object" char="."/> | 178 | <DetectChar attribute="Symbol" context="Member Object" char="."/> | ||
179 | <!-- Operators and other non-alphanumeric symbols. --> | 179 | <!-- Operators and other non-alphanumeric symbols. --> | ||
180 | <AnyChar attribute="Symbol" context="#stay" String="():!%&+,-/.*<=>?[]|~^;{}"/> | 180 | <AnyChar attribute="Symbol" context="#stay" String="():!%&+,-/.*<=>?[]|~^;{}"/> | ||
181 | </context> | 181 | </context> | ||
182 | <!-- Multiline regular expressions. --> | 182 | <!-- Multiline regular expressions. --> | ||
183 | <context name="Multiline Regex" attribute="Regex" lineEndContext="#stay" noIndentationBasedFolding="1"> | 183 | <context name="Multiline Regex" attribute="Regex" lineEndContext="#stay" noIndentationBasedFolding="1"> | ||
184 | <HlCStringChar attribute="Regex" context="#stay"/> | 184 | <HlCStringChar attribute="Regex" context="#stay"/> | ||
185 | <DetectChar attribute="Comment" context="Comment" char="#"/> | 185 | <DetectChar attribute="Comment" context="Comment" char="#"/> | ||
186 | <RegExpr attribute="Regex" context="#pop" String="///[mig]{0,3}" endRegion="Multiline Regex"/> | 186 | <RegExpr attribute="Regex" context="#pop" String="///[mig]{0,3}" endRegion="Multiline Regex"/> | ||
187 | </context> | 187 | </context> | ||
188 | <!-- Class names. --> | 188 | <!-- Class names. --> | ||
189 | <context name="Class" attribute="Normal" lineEndContext="#stay"> | 189 | <context name="Class" attribute="Normal" lineEndContext="#stay"> | ||
190 | <DetectSpaces/> | 190 | <DetectSpaces/> | ||
191 | <RegExpr attribute="Class" context="#pop" String="[@$:.\w\[\]]+"/> | 191 | <RegExpr attribute="Class" context="#pop" String="[@$:.\w\[\]]+"/> | ||
192 | </context> | 192 | </context> | ||
193 | <!-- Member objects. --> | 193 | <!-- Member objects. --> | ||
194 | <context name="Member Object" attribute="Normal" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | 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"/> | 195 | <RegExpr attribute="Identifier" context="#pop" String="\s*[_$a-z][$\w]*" insensitive="true"/> | ||
196 | </context> | 196 | </context> | ||
197 | <!-- Comments. --> | 197 | <!-- Comments. --> | ||
198 | <context name="Comment" attribute="Comment" lineEndContext="#pop"> | 198 | <context name="Comment" attribute="Comment" lineEndContext="#pop"> | ||
199 | <IncludeRules context="##Alerts"/> | 199 | <IncludeRules context="##Alerts"/> | ||
200 | <IncludeRules context="##Modelines"/> | ||||
200 | </context> | 201 | </context> | ||
201 | <context name="Multiline Comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="1"> | 202 | <context name="Multiline Comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="1"> | ||
202 | <StringDetect attribute="Comment" context="#pop" String="###" endRegion="Comment"/> | 203 | <StringDetect attribute="Comment" context="#pop" String="###" endRegion="Comment"/> | ||
203 | <IncludeRules context="##Alerts"/> | 204 | <IncludeRules context="##Alerts"/> | ||
205 | <IncludeRules context="##Modelines"/> | ||||
204 | </context> | 206 | </context> | ||
205 | <!-- Single-line strings. --> | 207 | <!-- Single-line strings. --> | ||
206 | <context name="String" attribute="String" lineEndContext="#stay"> | 208 | <context name="String" attribute="String" lineEndContext="#stay"> | ||
207 | <IncludeRules context="Escape"/> | 209 | <IncludeRules context="Escape"/> | ||
208 | <DetectChar attribute="String" context="#pop" char="'"/> | 210 | <DetectChar attribute="String" context="#pop" char="'"/> | ||
209 | </context> | 211 | </context> | ||
210 | <context name="Rich String" attribute="String" lineEndContext="#stay"> | 212 | <context name="Rich String" attribute="String" lineEndContext="#stay"> | ||
211 | <IncludeRules context="Escape"/> | 213 | <IncludeRules context="Escape"/> | ||
212 | <Detect2Chars attribute="Embedding" context="Embedding" char="#" char1="{"/> | 214 | <Detect2Chars attribute="Embedding" context="Embedding" char="#" char1="{"/> | ||
213 | <DetectChar attribute="String" context="#pop" char="""/> | 215 | <DetectChar attribute="String" context="#pop" char="""/> | ||
214 | </context> | 216 | </context> | ||
215 | <!-- Multi-line strings. --> | 217 | <!-- Multi-line strings. --> | ||
216 | <context name="Heredoc" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="1"> | 218 | <context name="Heredoc" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="1"> | ||
217 | <IncludeRules context="Escape"/> | 219 | <IncludeRules context="Escape"/> | ||
218 | <StringDetect attribute="String" context="#pop" String="'''" endRegion="Heredoc"/> | 220 | <StringDetect attribute="String" context="#pop" String="'''" endRegion="Heredoc"/> | ||
219 | </context> | 221 | </context> | ||
220 | <context name="Rich Heredoc" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="1"> | 222 | <context name="Rich Heredoc" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="1"> | ||
221 | <IncludeRules context="Escape"/> | 223 | <IncludeRules context="Escape"/> | ||
222 | <Detect2Chars attribute="Embedding" context="Embedding" char="#" char1="{"/> | 224 | <Detect2Chars attribute="Embedding" context="Embedding" char="#" char1="{"/> | ||
223 | <StringDetect attribute="String" context="#pop" String=""""" endRegion="Rich Heredoc"/> | 225 | <StringDetect attribute="String" context="#pop" String=""""" endRegion="Rich Heredoc"/> | ||
224 | </context> | 226 | </context> | ||
225 | <!-- Escaped characters. --> | 227 | <!-- Escaped characters. --> | ||
226 | <context name="Escape" attribute="String" lineEndContext="#stay"> | 228 | <context name="Escape" attribute="String" lineEndContext="#stay"> | ||
227 | <!-- Hexadecimal, unicode & reserved character escape sequences. --> | 229 | <!-- 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"'])"/> | 230 | <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. --> | 231 | <!-- Invalid escapes. Octal escape sequences are not allowed. --> | ||
230 | <RegExpr attribute="Error" context="#stay" String="\\[ux1-7]"/> | 232 | <RegExpr attribute="Error" context="#stay" String="\\[ux1-7]"/> | ||
231 | <!-- Make any character literal. --> | 233 | <!-- Make any character literal. --> | ||
232 | <RegExpr attribute="Literal Character Escape" context="#stay" String="\\."/> | 234 | <RegExpr attribute="Literal Character Escape" context="#stay" String="\\."/> | ||
233 | <LineContinue attribute="Escape" context="#stay"/> | 235 | <LineContinue attribute="Escape" context="#stay"/> | ||
234 | </context> | 236 | </context> | ||
235 | <!-- Expressions embedded in strings. --> | 237 | <!-- Expressions embedded in strings. --> | ||
236 | <context name="Embedding" attribute="Normal" lineEndContext="#stay"> | 238 | <context name="Embedding" attribute="Normal" lineEndContext="#stay"> | ||
Show All 23 Lines | 258 | <context name="JavaScript Object" attribute="Normal" lineEndContext="#stay" noIndentationBasedFolding="1"> | |||
260 | <IncludeRules context="Object##JavaScript"/> | 262 | <IncludeRules context="Object##JavaScript"/> | ||
261 | </context> | 263 | </context> | ||
262 | <context name="Javascript Template" attribute="JavaScript Template" lineEndContext="#stay" noIndentationBasedFolding="1"> | 264 | <context name="Javascript Template" attribute="JavaScript Template" lineEndContext="#stay" noIndentationBasedFolding="1"> | ||
263 | <RegExpr attribute="Escape" context="#stay" String="\\\\\\`"/> | 265 | <RegExpr attribute="Escape" context="#stay" String="\\\\\\`"/> | ||
264 | <Detect2Chars attribute="JavaScript Template" context="#pop" char="\" char1="`"/> <!-- End template. --> | 266 | <Detect2Chars attribute="JavaScript Template" context="#pop" char="\" char1="`"/> <!-- End template. --> | ||
265 | <DetectChar context="#pop" char="`" lookAhead="true"/> | 267 | <DetectChar context="#pop" char="`" lookAhead="true"/> | ||
266 | <Detect2Chars attribute="JavaScript Substitution" context="Javascript Substitution" char="$" char1="{"/> | 268 | <Detect2Chars attribute="JavaScript Substitution" context="Javascript Substitution" char="$" char1="{"/> | ||
267 | <IncludeRules context="Template##JavaScript"/> | 269 | <IncludeRules context="Template##JavaScript"/> | ||
268 | <RegExpr attribute="Error" context="#stay" String="([^\\\s](?=`)|\S(?=\s+`))"/> | 270 | <RegExpr attribute="Error" context="#stay" String="(?:[^\\\s](?=`)|\S(?=\s+`))"/> | ||
269 | </context> | 271 | </context> | ||
270 | <context name="Javascript RawTemplate" attribute="JavaScript Template" lineEndContext="#stay"> | 272 | <context name="Javascript RawTemplate" attribute="JavaScript Template" lineEndContext="#stay"> | ||
271 | <Detect2Chars attribute="JavaScript Template" context="#stay" char="\" char1="\"/> | 273 | <Detect2Chars attribute="JavaScript Template" context="#stay" char="\" char1="\"/> | ||
272 | <Detect2Chars attribute="JavaScript Template" context="#pop" char="\" char1="`"/> | 274 | <Detect2Chars attribute="JavaScript Template" context="#pop" char="\" char1="`"/> | ||
273 | <DetectChar context="#pop" char="`" lookAhead="true"/> | 275 | <DetectChar context="#pop" char="`" lookAhead="true"/> | ||
274 | <RegExpr attribute="Error" context="#stay" String="([^\\\s](?=`)|\S(?=\s+`))"/> | 276 | <RegExpr attribute="Error" context="#stay" String="(?:[^\\\s](?=`)|\S(?=\s+`))"/> | ||
275 | </context> | 277 | </context> | ||
276 | <context name="Javascript Substitution" attribute="Normal" lineEndContext="#stay" noIndentationBasedFolding="1"> | 278 | <context name="Javascript Substitution" attribute="Normal" lineEndContext="#stay" noIndentationBasedFolding="1"> | ||
277 | <DetectChar attribute="Javascript" context="#pop" char="`" lookAhead="true"/> | 279 | <DetectChar attribute="Javascript" context="#pop" char="`" lookAhead="true"/> | ||
278 | <DetectChar context="#pop" attribute="JavaScript Substitution" char="}"/> | 280 | <DetectChar context="#pop" attribute="JavaScript Substitution" char="}"/> | ||
279 | <IncludeRules context="Overwrite Javascript"/> | 281 | <IncludeRules context="Overwrite Javascript"/> | ||
280 | <IncludeRules context="Substitution##JavaScript"/> | 282 | <IncludeRules context="Substitution##JavaScript"/> | ||
281 | </context> | 283 | </context> | ||
282 | <!-- Embedded Javascript (triple backticks). --> | 284 | <!-- Embedded Javascript (triple backticks). --> | ||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |