@@ -1,9 +1,9 @@
1<?xml version="1.0" encoding="UTF-8"?>
1<?xml version="1.0" encoding="UTF-8"?>
2<syntax name="haskell">
2<syntax name="haskell">
4− <name>Haskell</name>
4+ <name>Haskell</name>
5− <type>compiled</type>
5+ <type>compiled</type>
6− <preferred-file-extension>hs</preferred-file-extension>
6+ <preferred-file-extension>hs</preferred-file-extension>
9 <detectors>
9 <detectors>
@@ -57,8 +57,6 @@
57 <include syntax="self" collection="type-family-definition" />
57 <include syntax="self" collection="type-family-definition" />
58 <include syntax="self" collection="pattern-definition" />
58 <include syntax="self" collection="pattern-definition" />
59 <include syntax="self" collection="type-definition" />
59 <include syntax="self" collection="type-definition" />
60− <!-- <include syntax="self" collection="type-annotation" /> -->
61− <include syntax="self" collection="data-definition" />
62 <include syntax="self" collection="GADT-definition" />
60 <include syntax="self" collection="GADT-definition" />
63 <include syntax="self" collection="instance" />
61 <include syntax="self" collection="instance" />
64 <include syntax="self" collection="typeclass" />
62 <include syntax="self" collection="typeclass" />
@@ -67,7 +65,6 @@
68 <template-scopes>
66 <template-scopes>
69 <include syntax="self" collection="Quote" />
67 <include syntax="self" collection="Quote" />
70− <include syntax="self" collection="comments" />
71 </template-scopes>
68 </template-scopes>
73 <collections>
70 <collections>
@@ -80,51 +77,27 @@
80 </collection>
77 </collection>
82 <collection name="expressions">
79 <collection name="expressions">
80+ <scope name="haskell.construct.keyword.at">
81+ <expression>@</expression>
83+ <scope name="haskell.construct.keyword.case-arrow">
84+ <expression>-></expression>
86+ <scope name="haskell.construct.keyword.bind-arrow">
87+ <expression><-</expression>
83− <include syntax="self" collection="do-bind" />
89+ <include syntax="self" collection="keywords" />
84 <include syntax="self" collection="literal" />
90 <include syntax="self" collection="literal" />
85 <include syntax="self" collection="operators" />
91 <include syntax="self" collection="operators" />
92+ <include syntax="self" collection="record-match" />
86 <include syntax="self" collection="list" />
93 <include syntax="self" collection="list" />
94+ <include syntax="self" collection="view-pattern" />
87 <include syntax="self" collection="lambda-case" />
95 <include syntax="self" collection="lambda-case" />
88 <include syntax="self" collection="lambda-head" />
96 <include syntax="self" collection="lambda-head" />
89− <include syntax="self" collection="type-applications" />
97+ <include syntax="self" collection="case-expression" />
90− <include syntax="self" collection="outer-case-expression" />
98+ <include syntax="self" collection="qconid" />
91 <include syntax="self" collection="qvarid" />
99 <include syntax="self" collection="qvarid" />
92 <include syntax="self" collection="tuple" />
100 <include syntax="self" collection="tuple" />
95− <!-- Needed for do binds -->
96− <!-- <include syntax="self" collection="pattern-match" /> -->
99− <collection name="pattern-match">
100− <include syntax="self" collection="literal" />
101− <include syntax="self" collection="tuple-match" />
102− <!-- <include syntax="self" collection="at-pattern" /> -->
103− <include syntax="self" collection="varid" />
104− <include syntax="self" collection="qconid" />
105− <include syntax="self" collection="record-match" />
106− <include syntax="self" collection="list-pattern" />
107− <include syntax="self" collection="view-pattern" />
110− <collection name="type-applications">
111− <scope name="type-applications">
113− <expression>(\s@)\(</expression>
114− <capture number="1" name="haskell.keyword.operator.typeapplication" />
117− <expression>)</expression>
120− <include syntax="self" collection="type" />
123− <scope name="type-applications-single">
124− <expression>(@)(\w+)</expression>
125− <capture number="1" name="haskell.keyword.operator.typeapplication" />
126− <capture number="2" name="haskell.identifier.type" />
128 </collection>
101 </collection>
130 <collection name="Quote">
103 <collection name="Quote">
@@ -163,8 +136,8 @@
163 <capture number="1" name="haskell.pattern.record.bracket" />
136 <capture number="1" name="haskell.pattern.record.bracket" />
164 </ends-with>
137 </ends-with>
165 <subscopes>
138 <subscopes>
166− <include syntax="self" collection="pattern-match" />
139+ <include syntax="self" collection="comments" />
167− <include syntax="self" collection="varid" />
140+ <include syntax="self" collection="expressions" />
168 <scope name="record-sep">
141 <scope name="record-sep">
169 <expression>=</expression>
142 <expression>=</expression>
@@ -186,6 +159,7 @@
186 <capture number="1" name="haskell.pattern.record.bracket" />
159 <capture number="1" name="haskell.pattern.record.bracket" />
187 </ends-with>
160 </ends-with>
188 <subscopes>
161 <subscopes>
162+ <include syntax="self" collection="comments" />
189 <scope name="haskell.pattern.record.wildcard">
163 <scope name="haskell.pattern.record.wildcard">
190 <expression>\.\.</expression>
164 <expression>\.\.</expression>
@@ -212,29 +186,12 @@
212 <capture number="1" name="haskell.list.bracket" />
186 <capture number="1" name="haskell.list.bracket" />
213 </ends-with>
187 </ends-with>
214 <subscopes>
188 <subscopes>
189+ <include syntax="self" collection="comments" />
215 <include syntax="self" collection="expressions" />
190 <include syntax="self" collection="expressions" />
216 </subscopes>
191 </subscopes>
218 </collection>
193 </collection>
220− <collection name="list-pattern">
221− <symbol type="expression" />
222− <scope name="haskell.pattern.list">
224− <expression>(\[)</expression>
225− <capture number="1" name="haskell.pattern.list.bracket" />
228− <expression>(\])</expression>
229− <capture number="1" name="haskell.pattern.list.bracket" />
232− <include syntax="self" collection="pattern-match" />
238 <collection name="view-pattern">
195 <collection name="view-pattern">
239 <scope name="haskell.pattern.view">
196 <scope name="haskell.pattern.view">
240 <symbol type="expression" />
197 <symbol type="expression" />
@@ -251,24 +208,7 @@
251 <scope name="haskell.pattern.view.operator.arrow">
208 <scope name="haskell.pattern.view.operator.arrow">
252 <expression>-></expression>
209 <expression>-></expression>
254− <include syntax="self" collection="pattern-match" />
211+ <include syntax="self" collection="expressions" />
259− <collection name="tuple-match">
260− <symbol type="expression" />
261− <scope name="haskell.pattern.tuple">
263− <expression>(\()</expression>
264− <capture number="1" name="haskell.pattern.tuple.bracket" />
267− <expression>(\))</expression>
268− <capture number="1" name="haskell.pattern.tuple.bracket" />
271− <include syntax="self" collection="pattern-match" />
272 </subscopes>
212 </subscopes>
274 </collection>
214 </collection>
@@ -284,53 +224,11 @@
284 <capture number="1" name="haskell.case.keyword.condition" />
224 <capture number="1" name="haskell.case.keyword.condition" />
285 </ends-with>
225 </ends-with>
286 <subscopes anchored="true">
226 <subscopes anchored="true">
287− <include syntax="self" collection="pattern-match" />
292− <collection name="case-match">
293− <scope name="case-match">
295− <expression>(?=((\h*)\S.*->($|\h)))</expression>
298− <expression>-></expression>
300− <subscopes anchored="true">
301− <include syntax="self" collection="pattern-match" />
306− <collection name="inner-case-expressions">
307− <scope name="inner-case-expressions">
309− <expression>(?=((\h*)\S.*->($|\h)))</expression>
312− <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
315− <include syntax="self" collection="case-match" />
316 <include syntax="self" collection="expressions" />
227 <include syntax="self" collection="expressions" />
317 </subscopes>
228 </subscopes>
319 </collection>
230 </collection>
321− <collection name="outer-case-expression">
322− <scope name="outer-case-expression">
324− <expression>(?=case)</expression>
327− <subscopes anchored="true" skip-whitespace="false">
328− <include syntax="self" collection="case-expression" />
329− <include syntax="self" collection="inner-case-expressions" repeat="true" />
334 <collection name="tuple">
232 <collection name="tuple">
335 <symbol type="expression" />
233 <symbol type="expression" />
336 <scope name="haskell.tuple">
234 <scope name="haskell.tuple">
@@ -343,136 +241,144 @@
343 <capture number="1" name="haskell.tuple.bracket" />
241 <capture number="1" name="haskell.tuple.bracket" />
344 </ends-with>
242 </ends-with>
345 <subscopes>
243 <subscopes>
244+ <include syntax="self" collection="comments" />
346 <include syntax="self" collection="expressions" />
245 <include syntax="self" collection="expressions" />
347 </subscopes>
246 </subscopes>
349 </collection>
248 </collection>
351 <collection name="typeclass">
250 <collection name="typeclass">
352− <symbol type="interface" />
251+ <scope name="haskell.definition.class.head">
353− <scope name="haskell.definition.class">
252+ <symbol type="class" scope="global" name-selector="haskell.keyword.construct.class.name">
253+ <context behavior="whitespace" foldable="true" />
354 <starts-with>
255 <starts-with>
355 <expression>^(\h*)(class)($|\h)</expression>
256 <expression>^(\h*)(class)($|\h)</expression>
356 <capture number="2" name="haskell.keyword.construct.class" />
257 <capture number="2" name="haskell.keyword.construct.class" />
357 </starts-with>
258 </starts-with>
358− <ends-with>
259+ <ends-with />
359− <template>^(?!\s+\1\S)(?!\s*$)</template>
260+ <subscopes anchored="true">
261+ <scope name="haskell.keyword.construct.class.name">
263+ <expression></expression>
266+ <expression>(?=(where|^\s*$))</expression>
360− </ends-with>
267+ </ends-with>
361− <subscopes>
268+ <subscopes>
269+ <include syntax="self" collection="comments" />
270+ <include syntax="self" collection="type" />
362− <scope name="haskell.keyword.construct.where">
273+ <scope name="haskell.keyword.construct.where" optional="true">
363 <expression>where</expression>
274 <expression>where</expression>
365− <include syntax="self" collection="type" />
366− <include syntax="self" collection="type-definition" />
367− <!-- <include syntax="self" collection="type-annotation" /> -->
368− <include syntax="self" collection="definition" />
369 </subscopes>
276 </subscopes>
371 </collection>
278 </collection>
373 <collection name="instance">
280 <collection name="instance">
374 <scope name="haskell.instance">
281 <scope name="haskell.instance">
375− <symbol type="category" />
282+ <symbol type="category" name-selector="haskell.keyword.construct.instance.name">
283+ <context behavior="whitespace" foldable="true" />
376 <starts-with>
285 <starts-with>
377 <expression>^(\h*)(instance)($|\h)</expression>
286 <expression>^(\h*)(instance)($|\h)</expression>
378 <capture number="2" name="haskell.keyword.construct.instance" />
287 <capture number="2" name="haskell.keyword.construct.instance" />
379 </starts-with>
288 </starts-with>
380− <ends-with>
289+ <ends-with />
381− <template>^(?!\s+\1\S)(?!\s*$)</template>
290+ <subscopes anchored="true">
291+ <scope name="haskell.keyword.construct.instance.name">
293+ <expression></expression>
296+ <expression>(?=(where|^\s*$))</expression>
382− </ends-with>
297+ </ends-with>
383− <subscopes>
298+ <subscopes>
299+ <include syntax="self" collection="type" />
384− <scope name="haskell.keyword.construct.where">
302+ <scope name="haskell.keyword.construct.where" optional="true">
385 <expression>where</expression>
303 <expression>where</expression>
387− <include syntax="self" collection="type" />
388− <include syntax="self" collection="type-definition" />
389− <include syntax="self" collection="type-annotation" />
390− <include syntax="self" collection="definition" />
391 </subscopes>
305 </subscopes>
393 </collection>
307 </collection>
395 <collection name="type-family-definition">
309 <collection name="type-family-definition">
396− <scope name="haskell.definition.type.type-family">
310+ <scope name="haskell.definition.type-family.type">
397− <symbol type="type" />
398 <starts-with>
311 <starts-with>
399− <expression>^(\h*)(type\h+family)\h+`?(\w(\w|')*)`?($|\h)</expression>
312+ <expression>^(\h*)(type\h+family)</expression>
400 <capture number="2" name="haskell.keyword.construct.type-family" />
313 <capture number="2" name="haskell.keyword.construct.type-family" />
401 </starts-with>
314 </starts-with>
402 <ends-with>
315 <ends-with>
403 <template>^(?!\s+\1\S)(?!\s*$)</template>
316 <template>^(?!\s+\1\S)(?!\s*$)</template>
404 </ends-with>
317 </ends-with>
405− <subscopes>
318+ <subscopes anchored="true" skip-whitespace="false">
319+ <scope name="haskell.type-family.head">
321+ <expression></expression>
324+ <expression>where</expression>
406− <scope name="haskell.keyword.construct.where">
325+ <capture number="0" name="haskell.keyword.construct.where" />
327+ <subscopes anchored="true">
328+ <scope name="haskell.identifier.type-family.type.name">
407− <expression>where</expression>
329+ <expression>\S+</expression>
331+ <include syntax="self" collection="type" repeat="true" optional="true" />
409− <include syntax="self" collection="type" />
414− <collection name="definition">
415− <scope name="haskell.definition.type.function">
416− <symbol type="function">
418− <component selector="haskell.definition.type.function" />
423− <expression>^(?=(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h))</expression>
424− <capture number="2" name="haskell.keyword.construct.default" />
425− <capture number="3" name="haskell.identifier.function" />
428− <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
431− <include syntax="self" collection="type-annotation" />
335+ <include syntax="self" collection="type-family-case-definition" optional="true" repeat="true" />
432− <include syntax="self" collection="implementation" />
433 </subscopes>
336 </subscopes>
435 </collection>
338 </collection>
437− <collection name="do-bind">
340+ <collection name="type-family-case-definition">
438− <scope name="do-bind">
341+ <scope name="haskell.definition.type-family.type.case">
439 <starts-with>
342 <starts-with>
440− <expression>^(?=((\h*)\S.+<-($|\h)))</expression>
343+ <expression>^(\h*)(?=\S)</expression>
441 </starts-with>
344 </starts-with>
442 <ends-with>
345 <ends-with>
443− <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
346+ <template>^(?!\s+\1\S)(?!\s*$)</template>
444 </ends-with>
347 </ends-with>
445 <subscopes>
348 <subscopes>
446− <include syntax="self" collection="do-pattern" />
349+ <include syntax="self" collection="comments" />
447− <include syntax="self" collection="expressions" />
350+ <include syntax="self" collection="type" optional="true" repeat="true" />
448− <!-- <scope name="bind-arrow">
351+ <scope>
449− <expression><-</expression>
352+ <expression>=</expression>
450− </scope> -->
353+ </scope>
354+ <include syntax="self" collection="type" optional="true" repeat="true" />
451 </subscopes>
355 </subscopes>
453 </collection>
357 </collection>
455− <collection name="do-pattern">
359+ <collection name="definition">
456− <scope name="do-pattern">
360+ <scope name="haskell.definition.type.function">
361+ <symbol type="function">
362+ <context behavior="whitespace" foldable="true" />
457 <starts-with>
364 <starts-with>
458− <expression>^(?=((\h*)\S.+<-($|\h)))</expression>
365+ <expression>^(?=(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h))</expression>
366+ <capture number="2" name="haskell.keyword.construct.default" />
367+ <capture number="3" name="haskell.identifier.function.name" />
459 </starts-with>
368 </starts-with>
460 <ends-with>
369 <ends-with>
461− <expression><-</expression>
370+ <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
462 </ends-with>
371 </ends-with>
463 <subscopes>
372 <subscopes>
464− <include syntax="self" collection="pattern-match" />
373+ <include syntax="self" collection="comments" />
465− <!-- <scope name="bind-arrow">
374+ <include syntax="self" collection="type-annotation" />
466− <expression><-</expression>
468− <include syntax="self" collection="expressions" repeat="true" /> -->
375+ <include syntax="self" collection="implementation" />
469 </subscopes>
376 </subscopes>
471 </collection>
378 </collection>
473 <collection name="implementation">
380 <collection name="implementation">
474− <scope name="haskell.definition.type.function">
381+ <scope name="haskell.definition.type.function.implementation">
475− <local scope="within-construct" />
476 <starts-with>
382 <starts-with>
477 <expression>^(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h)</expression>
383 <expression>^(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h)</expression>
478 <capture number="2" name="haskell.keyword.construct.default" />
384 <capture number="2" name="haskell.keyword.construct.default" />
@@ -482,14 +388,20 @@
482 <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
388 <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
483 </ends-with>
389 </ends-with>
484 <subscopes>
390 <subscopes>
485− <include syntax="self" collection="where-clause" />
391+ <include syntax="self" collection="comments" />
486− <include syntax="self" collection="expressions" />
392+ <include syntax="self" collection="pattern-match" optional="true" repeat="true" />
394+ <expression>=</expression>
395+ <capture number="0" name="haskell.construct.function.keyword.eq" />
397+ <include syntax="self" collection="expressions" optional="true" repeat="true" />
398+ <include syntax="self" collection="where-clause" optional="true" />
487 </subscopes>
399 </subscopes>
489 </collection>
401 </collection>
491 <collection name="type-annotation">
403 <collection name="type-annotation">
492− <scope name="haskell.definition.type.function">
404+ <scope name="haskell.definition.type.function.type-signature">
493 <starts-with>
405 <starts-with>
494 <expression>^(\h*)`?(\w(\w|')*)`?\h*::($|\h)</expression>
406 <expression>^(\h*)`?(\w(\w|')*)`?\h*::($|\h)</expression>
495 <capture number="2" name="haskell.identifier.function" />
407 <capture number="2" name="haskell.identifier.function" />
@@ -498,6 +410,7 @@
498 <template>^(?!\s+\1\S)(?!\s*$)</template>
410 <template>^(?!\s+\1\S)(?!\s*$)</template>
499 </ends-with>
411 </ends-with>
500 <subscopes>
412 <subscopes>
413+ <include syntax="self" collection="comments" />
501 <include syntax="self" collection="type" />
414 <include syntax="self" collection="type" />
502 </subscopes>
415 </subscopes>
@@ -505,15 +418,19 @@
506 <collection name="type-definition">
419 <collection name="type-definition">
507 <scope name="haskell.definition.type">
420 <scope name="haskell.definition.type">
421+ <symbol type="type" scope="global">
422+ <context behavior="whitespace" foldable="true" />
508 <starts-with>
424 <starts-with>
509 <expression>^(\h*)(type)\h+(\w(\w|')*)</expression>
425 <expression>^(\h*)(type)\h+(\w(\w|')*)</expression>
510 <capture number="2" name="haskell.keyword.construct.type" />
426 <capture number="2" name="haskell.keyword.construct.type" />
511− <capture number="3" name="haskell.identifier.type" />
427+ <capture number="3" name="haskell.identifier.type.name" />
512 </starts-with>
428 </starts-with>
513 <ends-with>
429 <ends-with>
514 <template>^(?!\s+\1\S)(?!\s*$)</template>
430 <template>^(?!\s+\1\S)(?!\s*$)</template>
515 </ends-with>
431 </ends-with>
516 <subscopes>
432 <subscopes>
433+ <include syntax="self" collection="comments" />
517 <include syntax="self" collection="type" />
434 <include syntax="self" collection="type" />
518 </subscopes>
435 </subscopes>
@@ -521,66 +438,72 @@
522 <collection name="GADT-definition">
439 <collection name="GADT-definition">
523 <scope name="haskell.definition.struct.GADT">
440 <scope name="haskell.definition.struct.GADT">
441+ <symbol type="struct" scope="global">
442+ <context behavior="subtree" foldable="false" />
524 <starts-with>
444 <starts-with>
525− <expression>^(\h*)(data)\h+(\w(\w|')*)</expression>
445+ <expression>^(\h*)(data|newtype)\h+(\w(\w|')*)</expression>
526 <capture number="2" name="haskell.keyword.construct.data.GADT" />
446 <capture number="2" name="haskell.keyword.construct.data.GADT" />
447+ <capture number="3" name="haskell.identifier.data.type.name" />
527 </starts-with>
448 </starts-with>
528 <ends-with>
449 <ends-with>
529 <template>^(?!\s+\1\S)(?!\s*$)</template>
450 <template>^(?!\s+\1\S)(?!\s*$)</template>
530 </ends-with>
451 </ends-with>
531 <subscopes>
452 <subscopes>
453+ <include syntax="self" collection="comments" />
454+ <scope name="haskell.keyword.construct.where">
455+ <expression>where</expression>
458+ <include syntax="self" collection="deriving-clause" />
459+ <include syntax="self" collection="record-definition" />
532 <include syntax="self" collection="gadt-constructor" />
460 <include syntax="self" collection="gadt-constructor" />
533 <include syntax="self" collection="type" />
461 <include syntax="self" collection="type" />
534− <include syntax="self" collection="record-definition" />
535− <include syntax="self" collection="record-definition-field-name" />
536 </subscopes>
462 </subscopes>
538 </collection>
464 </collection>
540 <collection name="gadt-constructor">
466 <collection name="gadt-constructor">
541− <scope name="identifier.type.struct.GADT.constructor">
467+ <scope name="haskell.identifier.type.struct.data.constructor">
542− <expression>^\h+[A-Z](\w|')*</expression>
468+ <symbol type="constructor">
543− </scope>
469+ <context behavior="subtree" foldable="true" />
544− </collection>
470+ </symbol>
546− <collection name="data-definition">
547− <scope name="haskell.definition.struct.data">
548 <starts-with>
471 <starts-with>
549− <expression>^(\h*)(data|newtype)\h+(\w(\w|')*)</expression>
472+ <expression>(^|=|\||^)\h+([A-Z](\w|')*)</expression>
550− <capture number="2" name="haskell.keyword.construct.data.newtype" />
473+ <capture number="2" name="haskell.identifier.data.name" />
551− <capture number="3" name="haskell.identifier.type" />
552 </starts-with>
474 </starts-with>
553− <ends-with>
475+ <ends-with />
554− <template>^(?!\s+\1\S)(?!\s*$)</template>
556− <subscopes>
476+ <subscopes anchored="true">
557 <include syntax="self" collection="record-definition" />
477 <include syntax="self" collection="record-definition" />
558− <include syntax="self" collection="data-constructor" />
559− <include syntax="self" collection="type" />
560 </subscopes>
478 </subscopes>
562 </collection>
480 </collection>
564− <collection name="data-constructor">
482+ <collection name="deriving-clause">
565− <scope name="haskell.identifier.type.struct.data.constructor">
483+ <scope name="haskell.record.construct.deriving.keyword">
566− <expression>=\h+[A-Z](\w|')*</expression>
484+ <expression>deriving(\h+(newtype|stock|anyclass))?</expression>
568− <scope name="haskell.identifier.type.struct.data.constructor">
486+ <scope name="haskell.record.construct.deriving.keyword">
487+ <include syntax="self" collection="comments" />
569− <expression>\|\h+[A-Z](\w|')*</expression>
488+ <expression>via</expression>
571 </collection>
490 </collection>
573 <collection name="record-definition">
492 <collection name="record-definition">
574 <scope name="haskell.record">
493 <scope name="haskell.record">
495+ <context behavior="subtree" foldable="true" />
575 <starts-with>
497 <starts-with>
576− <expression>(\{)</expression>
498+ <expression>(?=\{)</expression>
577− <capture number="1" name="haskell.record.bracket" />
499+ <capture number="0" name="haskell.record.bracket" />
578 </starts-with>
500 </starts-with>
579 <ends-with>
501 <ends-with>
580 <expression>(\})</expression>
502 <expression>(\})</expression>
581 <capture number="1" name="haskell.record.bracket" />
503 <capture number="1" name="haskell.record.bracket" />
582 </ends-with>
504 </ends-with>
583 <subscopes>
505 <subscopes>
506+ <include syntax="self" collection="comments" />
584 <include syntax="self" collection="record-definition-field-name" />
507 <include syntax="self" collection="record-definition-field-name" />
585 <include syntax="self" collection="type" />
508 <include syntax="self" collection="type" />
586 </subscopes>
509 </subscopes>
@@ -589,26 +512,65 @@
590 <collection name="record-definition-field-name">
513 <collection name="record-definition-field-name">
591 <scope name="haskell.record.definition.property">
514 <scope name="haskell.record.definition.property">
515+ <symbol type="property" />
592− <expression>\w(\w|')*\h*::</expression>
516+ <expression>(((?![A-Z])\w(\w|')*)\h*::|(^|\{|,)\h*((?![A-Z])\w(\w|')*))</expression>
517+ <capture number="5" name="haskell.record.definition.property.field.property.name" />
518+ <capture number="2" name="haskell.record.definition.property.field.property.name" />
594 </collection>
520 </collection>
596 <collection name="type">
522 <collection name="type">
523+ <scope name="haskell.keyword.construct.function-arrow">
524+ <expression>-></expression>
526+ <scope name="haskell.keyword.construct.fat-arrow">
527+ <expression>=></expression>
529+ <include syntax="self" collection="strings" />
530+ <scope name="haskell.type.construct.tuple">
532+ <expression>\(</expression>
535+ <expression>\)</expression>
538+ <include syntax="self" collection="comments" />
539+ <scope name="haskell.construct.type.typle.comma">
540+ <expression>\,</expression>
542+ <include syntax="self" collection="type" />
545+ <scope name="haskell.type.list">
547+ <expression>'?\[</expression>
550+ <expression>\]</expression>
553+ <include syntax="self" collection="comments" />
554+ <include syntax="self" collection="type" />
557+ <scope name="haskell.type.star">
558+ <expression>\*</expression>
560+ <scope name="haskell.keyword.construct.type-annotation-operator">
561+ <expression>::</expression>
597 <include syntax="self" collection="type-list" />
563 <include syntax="self" collection="type-list" />
565+ <expression>(([A-Z](\w|')*\.)*)'*\!?([A-Z](\w|')*)</expression>
566+ <capture number="1" name="haskell.identifier.package.module" />
598− <scope name="haskell.identifier.type">
567+ <capture number="4" name="haskell.identifier.type" />
599− <expression>([A-Z](\w|')*\.)*[A-Z](\w|')*</expression>
601 <scope name="haskell.keyword.construct.forall">
569 <scope name="haskell.keyword.construct.forall">
602 <expression>forall</expression>
570 <expression>forall</expression>
604 <scope name="haskell.identifier.type.variable">
572 <scope name="haskell.identifier.type.variable">
605− <expression>\w(\w|')*</expression>
573+ <expression>(?!where)(?!=)((?!(\(|\)|\,|\!))\S)((?!(\(|\)|\,))\w)*</expression>
607− <scope name="haskell.keyword.construct.function-arrow">
608− <expression>-></expression>
610− <scope name="haskell.keyword.construct.fat-arrow">
611− <expression>=></expression>
613 </collection>
575 </collection>
@@ -623,6 +585,7 @@
623 <template>^(?!\s+\1\S)(?!\s*$)</template>
585 <template>^(?!\s+\1\S)(?!\s*$)</template>
624 </ends-with>
586 </ends-with>
625 <subscopes>
587 <subscopes>
588+ <include syntax="self" collection="comments" />
626 <scope name="haskell.keyword.construct.where">
589 <scope name="haskell.keyword.construct.where">
627 <expression>where</expression>
590 <expression>where</expression>
@@ -642,6 +605,7 @@
642 <capture number="1" name="haskell.type-list.bracket" />
605 <capture number="1" name="haskell.type-list.bracket" />
643 </ends-with>
606 </ends-with>
644 <subscopes>
607 <subscopes>
608+ <include syntax="self" collection="comments" />
645 <include syntax="self" collection="type" />
609 <include syntax="self" collection="type" />
646 </subscopes>
610 </subscopes>
@@ -658,6 +622,7 @@
658 <capture number="1" name="haskell.keyword.construct.lambda" />
622 <capture number="1" name="haskell.keyword.construct.lambda" />
659 </ends-with>
623 </ends-with>
660 <subscopes>
624 <subscopes>
625+ <include syntax="self" collection="comments" />
661 <include syntax="self" collection="pattern-match" />
626 <include syntax="self" collection="pattern-match" />
662 </subscopes>
627 </subscopes>
@@ -671,7 +636,6 @@
672 <collection name="where-clause">
637 <collection name="where-clause">
673 <scope name="haskell.construct.where">
638 <scope name="haskell.construct.where">
674− <local scope="within-parent" />
675 <starts-with>
639 <starts-with>
676 <expression>^(\h*)(where)</expression>
640 <expression>^(\h*)(where)</expression>
677 <capture number="2" name="haskell.construct.keyword.where" />
641 <capture number="2" name="haskell.construct.keyword.where" />
@@ -680,6 +644,7 @@
680 <template>^(?!\1\s*\S)(?!s*$)</template>
644 <template>^(?!\1\s*\S)(?!s*$)</template>
681 </ends-with>
645 </ends-with>
682 <subscopes>
646 <subscopes>
647+ <include syntax="self" collection="comments" />
683 <include syntax="self" collection="definition" />
648 <include syntax="self" collection="definition" />
684 </subscopes>
649 </subscopes>
@@ -688,7 +653,9 @@
689 <collection name="qvarid">
654 <collection name="qvarid">
690 <scope name="haskell.identifier.function">
655 <scope name="haskell.identifier.function">
691− <expression>([A-Z](\w|')*\.)*\w(\w|')*</expression>
656+ <expression>(([A-Z](\w|')*\.)*)(\w(\w|')*)</expression>
657+ <capture number="1" name="haskell.identifier.package.module" />
658+ <capture number="4" name="haskell.identifier.type" />
693 </collection>
660 </collection>
@@ -717,12 +684,12 @@
719 <collection name="strings">
686 <collection name="strings">
720− <scope name="haskell.string.double-quoted">
687+ <scope name="haskell.string.double-quoted" spell-check="true">
721 <starts-with>
688 <starts-with>
722− <expression>"</expression>
689+ <expression>"</expression>
723 </starts-with>
690 </starts-with>
724 <ends-with>
691 <ends-with>
725− <expression>"</expression>
692+ <expression>"</expression>
726 </ends-with>
693 </ends-with>
727 <subscopes>
694 <subscopes>
728 <scope name="haskell.string.escape-sequences">
695 <scope name="haskell.string.escape-sequences">
@@ -759,6 +726,7 @@
759 </ends-with>
726 </ends-with>
760 <subscopes>
727 <subscopes>
761 <scope name="identifier.haskell.type">
728 <scope name="identifier.haskell.type">
729+ <symbol type="expression" />
762 <symbol type="expression" />
730 <symbol type="expression" />
763 <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
731 <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
764 <capture number="1" name="identifier.type" />
732 <capture number="1" name="identifier.type" />
@@ -783,6 +751,7 @@
783 </ends-with>
751 </ends-with>
784 <subscopes>
752 <subscopes>
785 <scope name="haskell.construct.qualified">
753 <scope name="haskell.construct.qualified">
754+ <symbol type="expression" />
786 <expression>qualified</expression>
755 <expression>qualified</expression>
787 <capture number="0" name="haskell.construct.keyword.qualified" />
756 <capture number="0" name="haskell.construct.keyword.qualified" />
@@ -800,6 +769,7 @@
800 </ends-with>
769 </ends-with>
801 <subscopes anchored="true">
770 <subscopes anchored="true">
802 <include syntax="self" collection="import-list" />
771 <include syntax="self" collection="import-list" />
772+ <symbol type="expression" />
803 </subscopes>
773 </subscopes>
@@ -833,6 +803,7 @@
833 </ends-with>
803 </ends-with>
834 <subscopes>
804 <subscopes>
835 <scope name="haskell.identifier.struct">
805 <scope name="haskell.identifier.struct">
806+ <symbol type="expression" />
836 <symbol type="reference" scope="local" />
807 <symbol type="reference" scope="local" />
837 <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
808 <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
838 <capture number="1" name="haskell.import-list.identifier.type.name" />
809 <capture number="1" name="haskell.import-list.identifier.type.name" />
@@ -846,13 +817,6 @@
847 </collection>
818 </collection>
849− <!-- <collection name="special">
851− <expression>(;|,)</expression>
856 <collection name="reservedop">
820 <collection name="reservedop">
857 <scope name="keyword.operator">
821 <scope name="keyword.operator">
858 <expression>(\.\.|:|::|=|\\|\||<-|->|@|~|=>)</expression>
822 <expression>(\.\.|:|::|=|\\|\||<-|->|@|~|=>)</expression>
@@ -860,10 +824,11 @@
860 </collection>
824 </collection>
862 <collection name="keywords">
826 <collection name="keywords">
863− <scope name="haskell.keyword.modifier">
827+ <scope name="haskell.keyword.self">
864 <symbol type="keyword" />
828 <symbol type="keyword" />
865 <strings>
829 <strings>
866 <string>do</string>
830 <string>do</string>
831+ <string>mdo</string>
867 <string>in</string>
832 <string>in</string>
868 <string>infix</string>
833 <string>infix</string>
869 <string>infixl</string>
834 <string>infixl</string>
@@ -901,20 +866,18 @@
901 <strings>
866 <strings>
902 <string>undefined</string>
867 <string>undefined</string>
903 <string>_</string>
868 <string>_</string>
904 </strings>
870 </strings>
906 </collection>
872 </collection>
908 <collection name="comments">
874 <collection name="comments">
909 <scope name="haskell.comment.single" spell-check="true">
875 <scope name="haskell.comment.single" spell-check="true">
910− <starts-with>
876+ <symbol type="comment" />
911− <expression>--</expression>
914− <expression>$</expression>
877+ <expression> --.*$</expression>
917 <scope name="haskell.comment.block" spell-check="true">
879 <scope name="haskell.comment.block" spell-check="true">
880+ <symbol type="comment" />
918 <starts-with>
881 <starts-with>
919 <expression>{-</expression>
882 <expression>{-</expression>
920 </starts-with>
883 </starts-with>
@@ -926,4 +889,4 @@
928 </collections>
891 </collections>
929−</syntax>
892+</syntax>