@@ -1,9 +1,9 @@
11<?xml version="1.0" encoding="UTF-8"?>
22<syntax name="haskell">
33 <meta>
4− <name>Haskell</name>
5− <type>compiled</type>
6− <preferred-file-extension>hs</preferred-file-extension>
4+ <name>Haskell</name>
5+ <type>compiled</type>
6+ <preferred-file-extension>hs</preferred-file-extension>
77 </meta>
88
99 <detectors>
@@ -57,6 +57,7 @@
5757 <include syntax="self" collection="type-family-definition" />
5858 <include syntax="self" collection="pattern-definition" />
5959 <include syntax="self" collection="type-definition" />
60+ <!-- <include syntax="self" collection="type-annotation" /> -->
6061 <include syntax="self" collection="GADT-definition" />
6162 <include syntax="self" collection="instance" />
6263 <include syntax="self" collection="typeclass" />
@@ -65,6 +66,7 @@
6566
6667 <template-scopes>
6768 <include syntax="self" collection="Quote" />
69+ <include syntax="self" collection="comments" />
6870 </template-scopes>
6971
7072 <collections>
@@ -77,27 +79,51 @@
7779 </collection>
7880
7981 <collection name="expressions">
80− <scope name="haskell.construct.keyword.at">
81− <expression>@</expression>
82− </scope>
83− <scope name="haskell.construct.keyword.case-arrow">
84− <expression>-></expression>
85− </scope>
86− <scope name="haskell.construct.keyword.bind-arrow">
87− <expression><-</expression>
88− </scope>
89− <include syntax="self" collection="keywords" />
82+ <include syntax="self" collection="do-bind" />
9083 <include syntax="self" collection="literal" />
9184 <include syntax="self" collection="operators" />
92− <include syntax="self" collection="record-match" />
9385 <include syntax="self" collection="list" />
94− <include syntax="self" collection="view-pattern" />
9586 <include syntax="self" collection="lambda-case" />
9687 <include syntax="self" collection="lambda-head" />
97− <include syntax="self" collection="case-expression" />
98− <include syntax="self" collection="qconid" />
88+ <include syntax="self" collection="type-applications" />
89+ <include syntax="self" collection="outer-case-expression" />
9990 <include syntax="self" collection="qvarid" />
10091 <include syntax="self" collection="tuple" />
92+
93+
94+ <!-- Needed for do binds -->
95+ <!-- <include syntax="self" collection="pattern-match" /> -->
96+ </collection>
97+
98+ <collection name="pattern-match">
99+ <include syntax="self" collection="literal" />
100+ <include syntax="self" collection="tuple-match" />
101+ <!-- <include syntax="self" collection="at-pattern" /> -->
102+ <include syntax="self" collection="varid" />
103+ <include syntax="self" collection="qconid" />
104+ <include syntax="self" collection="record-match" />
105+ <include syntax="self" collection="list-pattern" />
106+ <include syntax="self" collection="view-pattern" />
107+ </collection>
108+
109+ <collection name="type-applications">
110+ <scope name="type-applications">
111+ <starts-with>
112+ <expression>(\s@)\(</expression>
113+ <capture number="1" name="haskell.keyword.operator.typeapplication" />
114+ </starts-with>
115+ <ends-with>
116+ <expression>)</expression>
117+ </ends-with>
118+ <subscopes>
119+ <include syntax="self" collection="type" />
120+ </subscopes>
121+ </scope>
122+ <scope name="type-applications-single">
123+ <expression>(@)(\w+)</expression>
124+ <capture number="1" name="haskell.keyword.operator.typeapplication" />
125+ <capture number="2" name="haskell.identifier.type" />
126+ </scope>
101127 </collection>
102128
103129 <collection name="Quote">
@@ -136,8 +162,8 @@
136162 <capture number="1" name="haskell.pattern.record.bracket" />
137163 </ends-with>
138164 <subscopes>
139− <include syntax="self" collection="comments" />
140− <include syntax="self" collection="expressions" />
165+ <include syntax="self" collection="pattern-match" />
166+ <include syntax="self" collection="varid" />
141167 <scope name="record-sep">
142168 <expression>=</expression>
143169 </scope>
@@ -159,7 +185,6 @@
159185 <capture number="1" name="haskell.pattern.record.bracket" />
160186 </ends-with>
161187 <subscopes>
162− <include syntax="self" collection="comments" />
163188 <scope name="haskell.pattern.record.wildcard">
164189 <expression>\.\.</expression>
165190 </scope>
@@ -186,12 +211,29 @@
186211 <capture number="1" name="haskell.list.bracket" />
187212 </ends-with>
188213 <subscopes>
189− <include syntax="self" collection="comments" />
190214 <include syntax="self" collection="expressions" />
191215 </subscopes>
192216 </scope>
193217 </collection>
194218
219+ <collection name="list-pattern">
220+ <symbol type="expression" />
221+ <scope name="haskell.pattern.list">
222+ <starts-with>
223+ <expression>(\[)</expression>
224+ <capture number="1" name="haskell.pattern.list.bracket" />
225+ </starts-with>
226+ <ends-with>
227+ <expression>(\])</expression>
228+ <capture number="1" name="haskell.pattern.list.bracket" />
229+ </ends-with>
230+ <subscopes>
231+ <include syntax="self" collection="pattern-match" />
232+ </subscopes>
233+ </scope>
234+ </collection>
235+
236+
195237 <collection name="view-pattern">
196238 <scope name="haskell.pattern.view">
197239 <symbol type="expression" />
@@ -208,7 +250,24 @@
208250 <scope name="haskell.pattern.view.operator.arrow">
209251 <expression>-></expression>
210252 </scope>
211− <include syntax="self" collection="expressions" />
253+ <include syntax="self" collection="pattern-match" />
254+ </subscopes>
255+ </scope>
256+ </collection>
257+
258+ <collection name="tuple-match">
259+ <symbol type="expression" />
260+ <scope name="haskell.pattern.tuple">
261+ <starts-with>
262+ <expression>(\()</expression>
263+ <capture number="1" name="haskell.pattern.tuple.bracket" />
264+ </starts-with>
265+ <ends-with>
266+ <expression>(\))</expression>
267+ <capture number="1" name="haskell.pattern.tuple.bracket" />
268+ </ends-with>
269+ <subscopes>
270+ <include syntax="self" collection="pattern-match" />
212271 </subscopes>
213272 </scope>
214273 </collection>
@@ -224,11 +283,53 @@
224283 <capture number="1" name="haskell.case.keyword.condition" />
225284 </ends-with>
226285 <subscopes anchored="true">
286+ <include syntax="self" collection="pattern-match" />
287+ </subscopes>
288+ </scope>
289+ </collection>
290+
291+ <collection name="case-match">
292+ <scope name="case-match">
293+ <starts-with>
294+ <expression>(?=((\h*)\S.*->($|\h)))</expression>
295+ </starts-with>
296+ <ends-with>
297+ <expression>-></expression>
298+ </ends-with>
299+ <subscopes anchored="true">
300+ <include syntax="self" collection="pattern-match" />
301+ </subscopes>
302+ </scope>
303+ </collection>
304+
305+ <collection name="inner-case-expressions">
306+ <scope name="inner-case-expressions">
307+ <starts-with>
308+ <expression>(?=((\h*)\S.*->($|\h)))</expression>
309+ </starts-with>
310+ <ends-with>
311+ <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
312+ </ends-with>
313+ <subscopes>
314+ <include syntax="self" collection="case-match" />
227315 <include syntax="self" collection="expressions" />
228316 </subscopes>
229317 </scope>
230318 </collection>
231319
320+ <collection name="outer-case-expression">
321+ <scope name="outer-case-expression">
322+ <starts-with>
323+ <expression>(?=case)</expression>
324+ </starts-with>
325+ <ends-with />
326+ <subscopes anchored="true" skip-whitespace="false">
327+ <include syntax="self" collection="case-expression" />
328+ <include syntax="self" collection="inner-case-expressions" repeat="true" />
329+ </subscopes>
330+ </scope>
331+ </collection>
332+
232333 <collection name="tuple">
233334 <symbol type="expression" />
234335 <scope name="haskell.tuple">
@@ -241,73 +342,60 @@
241342 <capture number="1" name="haskell.tuple.bracket" />
242343 </ends-with>
243344 <subscopes>
244− <include syntax="self" collection="comments" />
245345 <include syntax="self" collection="expressions" />
246346 </subscopes>
247347 </scope>
248348 </collection>
249349
250350 <collection name="typeclass">
251− <scope name="haskell.definition.class.head">
252− <symbol type="class" scope="global" name-selector="haskell.keyword.construct.class.name">
253− <context behavior="whitespace" foldable="true" />
254− </symbol>
351+ <symbol type="interface" />
352+ <scope name="haskell.definition.class">
255353 <starts-with>
256354 <expression>^(\h*)(class)($|\h)</expression>
257355 <capture number="2" name="haskell.keyword.construct.class" />
258356 </starts-with>
259− <ends-with />
260− <subscopes anchored="true">
261− <scope name="haskell.keyword.construct.class.name">
262− <starts-with>
263− <expression></expression>
264− </starts-with>
265− <ends-with>
266− <expression>(?=(where|^\s*$))</expression>
267− </ends-with>
268− <subscopes>
269− <include syntax="self" collection="comments" />
270− <include syntax="self" collection="type" />
271− </subscopes>
272− </scope>
273− <scope name="haskell.keyword.construct.where" optional="true">
357+ <ends-with>
358+ <template>^(?!\s+\1\S)(?!\s*$)</template>
359+ </ends-with>
360+ <subscopes>
361+ <scope name="haskell.keyword.construct.where">
274362 <expression>where</expression>
275363 </scope>
364+ <include syntax="self" collection="type" />
365+ <include syntax="self" collection="type-definition" />
366+ <!-- <include syntax="self" collection="type-annotation" /> -->
367+ <include syntax="self" collection="definition" />
276368 </subscopes>
277369 </scope>
278370 </collection>
279371
280372 <collection name="instance">
281373 <scope name="haskell.instance">
282− <symbol type="category" name-selector="haskell.keyword.construct.instance.name">
283− <context behavior="whitespace" foldable="true" />
284− </symbol>
374+ <symbol type="category" />
285375 <starts-with>
286376 <expression>^(\h*)(instance)($|\h)</expression>
287377 <capture number="2" name="haskell.keyword.construct.instance" />
288378 </starts-with>
289− <ends-with />
290− <subscopes anchored="true">
291− <scope name="haskell.keyword.construct.instance.name">
292− <starts-with>
293− <expression></expression>
294− </starts-with>
295− <ends-with>
296− <expression>(?=(where|^\s*$))</expression>
297− </ends-with>
298− <subscopes>
299− <include syntax="self" collection="type" />
300− </subscopes>
301− </scope>
302− <scope name="haskell.keyword.construct.where" optional="true">
379+ <ends-with>
380+ <template>^(?!\s+\1\S)(?!\s*$)</template>
381+ </ends-with>
382+ <subscopes>
383+ <scope name="haskell.keyword.construct.where">
303384 <expression>where</expression>
304385 </scope>
386+ <include syntax="self" collection="type" />
387+ <include syntax="self" collection="type-definition" />
388+ <include syntax="self" collection="type-annotation" />
389+ <include syntax="self" collection="definition" />
305390 </subscopes>
306391 </scope>
307392 </collection>
308393
309394 <collection name="type-family-definition">
310395 <scope name="haskell.definition.type-family.type">
396+ <symbol type="type">
397+ <context behavior="subtree" foldable="false" />
398+ </symbol>
311399 <starts-with>
312400 <expression>^(\h*)(type\h+family)</expression>
313401 <capture number="2" name="haskell.keyword.construct.type-family" />
@@ -346,7 +434,6 @@
346434 <template>^(?!\s+\1\S)(?!\s*$)</template>
347435 </ends-with>
348436 <subscopes>
349− <include syntax="self" collection="comments" />
350437 <include syntax="self" collection="type" optional="true" repeat="true" />
351438 <scope>
352439 <expression>=</expression>
@@ -359,26 +446,65 @@
359446 <collection name="definition">
360447 <scope name="haskell.definition.type.function">
361448 <symbol type="function">
362− <context behavior="whitespace" foldable="true" />
449+ <display-name>
450+ <component selector="haskell.definition.type.function" />
451+ </display-name>
452+
363453 </symbol>
364454 <starts-with>
365455 <expression>^(?=(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h))</expression>
366456 <capture number="2" name="haskell.keyword.construct.default" />
367− <capture number="3" name="haskell.identifier.function.name" />
457+ <capture number="3" name="haskell.identifier.function" />
368458 </starts-with>
369459 <ends-with>
370460 <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
371461 </ends-with>
372462 <subscopes>
373− <include syntax="self" collection="comments" />
374463 <include syntax="self" collection="type-annotation" />
375464 <include syntax="self" collection="implementation" />
376465 </subscopes>
377466 </scope>
378467 </collection>
379468
469+ <collection name="do-bind">
470+ <scope name="do-bind">
471+ <starts-with>
472+ <expression>^(?=((\h*)\S.+<-($|\h)))</expression>
473+ </starts-with>
474+ <ends-with>
475+ <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
476+ </ends-with>
477+ <subscopes>
478+ <include syntax="self" collection="do-pattern" />
479+ <include syntax="self" collection="expressions" />
480+ <!-- <scope name="bind-arrow">
481+ <expression><-</expression>
482+ </scope> -->
483+ </subscopes>
484+ </scope>
485+ </collection>
486+
487+ <collection name="do-pattern">
488+ <scope name="do-pattern">
489+ <starts-with>
490+ <expression>^(?=((\h*)\S.+<-($|\h)))</expression>
491+ </starts-with>
492+ <ends-with>
493+ <expression><-</expression>
494+ </ends-with>
495+ <subscopes>
496+ <include syntax="self" collection="pattern-match" />
497+ <!-- <scope name="bind-arrow">
498+ <expression><-</expression>
499+ </scope>
500+ <include syntax="self" collection="expressions" repeat="true" /> -->
501+ </subscopes>
502+ </scope>
503+ </collection>
504+
380505 <collection name="implementation">
381− <scope name="haskell.definition.type.function.implementation">
506+ <scope name="haskell.definition.type.function">
507+ <local scope="within-construct" />
382508 <starts-with>
383509 <expression>^(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h)</expression>
384510 <capture number="2" name="haskell.keyword.construct.default" />
@@ -388,20 +514,14 @@
388514 <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
389515 </ends-with>
390516 <subscopes>
391− <include syntax="self" collection="comments" />
392− <include syntax="self" collection="pattern-match" optional="true" repeat="true" />
393− <scope>
394− <expression>=</expression>
395− <capture number="0" name="haskell.construct.function.keyword.eq" />
396− </scope>
397− <include syntax="self" collection="expressions" optional="true" repeat="true" />
398− <include syntax="self" collection="where-clause" optional="true" />
517+ <include syntax="self" collection="where-clause" />
518+ <include syntax="self" collection="expressions" />
399519 </subscopes>
400520 </scope>
401521 </collection>
402522
403523 <collection name="type-annotation">
404− <scope name="haskell.definition.type.function.type-signature">
524+ <scope name="haskell.definition.type.function">
405525 <starts-with>
406526 <expression>^(\h*)`?(\w(\w|')*)`?\h*::($|\h)</expression>
407527 <capture number="2" name="haskell.identifier.function" />
@@ -410,7 +530,6 @@
410530 <template>^(?!\s+\1\S)(?!\s*$)</template>
411531 </ends-with>
412532 <subscopes>
413− <include syntax="self" collection="comments" />
414533 <include syntax="self" collection="type" />
415534 </subscopes>
416535 </scope>
@@ -418,19 +537,15 @@
418537
419538 <collection name="type-definition">
420539 <scope name="haskell.definition.type">
421− <symbol type="type" scope="global">
422− <context behavior="whitespace" foldable="true" />
423− </symbol>
424540 <starts-with>
425541 <expression>^(\h*)(type)\h+(\w(\w|')*)</expression>
426542 <capture number="2" name="haskell.keyword.construct.type" />
427− <capture number="3" name="haskell.identifier.type.name" />
543+ <capture number="3" name="haskell.identifier.type" />
428544 </starts-with>
429545 <ends-with>
430546 <template>^(?!\s+\1\S)(?!\s*$)</template>
431547 </ends-with>
432548 <subscopes>
433− <include syntax="self" collection="comments" />
434549 <include syntax="self" collection="type" />
435550 </subscopes>
436551 </scope>
@@ -438,7 +553,7 @@
438553
439554 <collection name="GADT-definition">
440555 <scope name="haskell.definition.struct.GADT">
441− <symbol type="struct" scope="global">
556+ <symbol type="struct">
442557 <context behavior="subtree" foldable="false" />
443558 </symbol>
444559 <starts-with>
@@ -450,7 +565,6 @@
450565 <template>^(?!\s+\1\S)(?!\s*$)</template>
451566 </ends-with>
452567 <subscopes>
453− <include syntax="self" collection="comments" />
454568 <scope name="haskell.keyword.construct.where">
455569 <expression>where</expression>
456570 </scope>
@@ -466,26 +580,21 @@
466580 <collection name="gadt-constructor">
467581 <scope name="haskell.identifier.type.struct.data.constructor">
468582 <symbol type="constructor">
469− <context behavior="subtree" foldable="true" />
583+ <context behavior="whitespace" />
470584 </symbol>
471− <starts-with>
472− <expression>(^|=|\||^)\h+([A-Z](\w|')*)</expression>
473− <capture number="2" name="haskell.identifier.data.name" />
474− </starts-with>
475− <ends-with />
476− <subscopes anchored="true">
477− <include syntax="self" collection="record-definition" />
478− </subscopes>
585+ <expression>(^|=|\|)\h+([A-Z](\w|')*)</expression>
586+ <capture number="2" name="haskell.identifier.data.name" />
587+ </scope>
588+ <scope name="identifier.type.struct.GADT.constructor">
589+ <symbol type="constructor"></symbol>
590+ <expression>^\h+([A-Z](\w|')*)</expression>
591+ <capture number="1" name="haskell.identifier.data.name" />
479592 </scope>
480593 </collection>
481594
482595 <collection name="deriving-clause">
483596 <scope name="haskell.record.construct.deriving.keyword">
484− <expression>deriving(\h+(newtype|stock|anyclass))?</expression>
485− </scope>
486− <scope name="haskell.record.construct.deriving.keyword">
487− <include syntax="self" collection="comments" />
488− <expression>via</expression>
597+ <expression>deriving\h+(newtype|stock|anyclass)</expression>
489598 </scope>
490599 </collection>
491600
@@ -503,7 +612,6 @@
503612 <capture number="1" name="haskell.record.bracket" />
504613 </ends-with>
505614 <subscopes>
506− <include syntax="self" collection="comments" />
507615 <include syntax="self" collection="record-definition-field-name" />
508616 <include syntax="self" collection="type" />
509617 </subscopes>
@@ -520,13 +628,6 @@
520628 </collection>
521629
522630 <collection name="type">
523− <scope name="haskell.keyword.construct.function-arrow">
524− <expression>-></expression>
525− </scope>
526− <scope name="haskell.keyword.construct.fat-arrow">
527− <expression>=></expression>
528− </scope>
529− <include syntax="self" collection="strings" />
530631 <scope name="haskell.type.construct.tuple">
531632 <starts-with>
532633 <expression>\(</expression>
@@ -535,7 +636,6 @@
535636 <expression>\)</expression>
536637 </ends-with>
537638 <subscopes>
538− <include syntax="self" collection="comments" />
539639 <scope name="haskell.construct.type.typle.comma">
540640 <expression>\,</expression>
541641 </scope>
@@ -550,7 +650,6 @@
550650 <expression>\]</expression>
551651 </ends-with>
552652 <subscopes>
553− <include syntax="self" collection="comments" />
554653 <include syntax="self" collection="type" />
555654 </subscopes>
556655 </scope>
@@ -562,7 +661,7 @@
562661 </scope>
563662 <include syntax="self" collection="type-list" />
564663 <scope>
565− <expression>(([A-Z](\w|')*\.)*)'*\!?([A-Z](\w|')*)</expression>
664+ <expression>(([A-Z](\w|')*\.)*)'*([A-Z](\w|')*)</expression>
566665 <capture number="1" name="haskell.identifier.package.module" />
567666 <capture number="4" name="haskell.identifier.type" />
568667 </scope>
@@ -570,7 +669,13 @@
570669 <expression>forall</expression>
571670 </scope>
572671 <scope name="haskell.identifier.type.variable">
573− <expression>(?!where)(?!=)((?!(\(|\)|\,|\!))\S)((?!(\(|\)|\,))\w)*</expression>
672+ <expression>(?!=)((?!(\(|\)|\,))\S)((?!(\(|\)|\,))\S)*</expression>
673+ </scope>
674+ <scope name="haskell.keyword.construct.function-arrow">
675+ <expression>-></expression>
676+ </scope>
677+ <scope name="haskell.keyword.construct.fat-arrow">
678+ <expression>=></expression>
574679 </scope>
575680 </collection>
576681
@@ -585,7 +690,6 @@
585690 <template>^(?!\s+\1\S)(?!\s*$)</template>
586691 </ends-with>
587692 <subscopes>
588− <include syntax="self" collection="comments" />
589693 <scope name="haskell.keyword.construct.where">
590694 <expression>where</expression>
591695 </scope>
@@ -605,7 +709,6 @@
605709 <capture number="1" name="haskell.type-list.bracket" />
606710 </ends-with>
607711 <subscopes>
608− <include syntax="self" collection="comments" />
609712 <include syntax="self" collection="type" />
610713 </subscopes>
611714 </scope>
@@ -622,7 +725,6 @@
622725 <capture number="1" name="haskell.keyword.construct.lambda" />
623726 </ends-with>
624727 <subscopes>
625− <include syntax="self" collection="comments" />
626728 <include syntax="self" collection="pattern-match" />
627729 </subscopes>
628730 </scope>
@@ -636,6 +738,7 @@
636738
637739 <collection name="where-clause">
638740 <scope name="haskell.construct.where">
741+ <local scope="within-parent" />
639742 <starts-with>
640743 <expression>^(\h*)(where)</expression>
641744 <capture number="2" name="haskell.construct.keyword.where" />
@@ -644,7 +747,6 @@
644747 <template>^(?!\1\s*\S)(?!s*$)</template>
645748 </ends-with>
646749 <subscopes>
647− <include syntax="self" collection="comments" />
648750 <include syntax="self" collection="definition" />
649751 </subscopes>
650752 </scope>
@@ -684,12 +786,12 @@
684786
685787
686788 <collection name="strings">
687− <scope name="haskell.string.double-quoted" spell-check="true">
789+ <scope name="haskell.string.double-quoted">
688790 <starts-with>
689− <expression>"</expression>
791+ <expression>"</expression>
690792 </starts-with>
691793 <ends-with>
692− <expression>"</expression>
794+ <expression>"</expression>
693795 </ends-with>
694796 <subscopes>
695797 <scope name="haskell.string.escape-sequences">
@@ -726,7 +828,6 @@
726828 </ends-with>
727829 <subscopes>
728830 <scope name="identifier.haskell.type">
729− <symbol type="expression" />
730831 <symbol type="expression" />
731832 <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
732833 <capture number="1" name="identifier.type" />
@@ -751,7 +852,6 @@
751852 </ends-with>
752853 <subscopes>
753854 <scope name="haskell.construct.qualified">
754− <symbol type="expression" />
755855 <expression>qualified</expression>
756856 <capture number="0" name="haskell.construct.keyword.qualified" />
757857 </scope>
@@ -769,7 +869,6 @@
769869 </ends-with>
770870 <subscopes anchored="true">
771871 <include syntax="self" collection="import-list" />
772− <symbol type="expression" />
773872 </subscopes>
774873 </scope>
775874
@@ -803,7 +902,6 @@
803902 </ends-with>
804903 <subscopes>
805904 <scope name="haskell.identifier.struct">
806− <symbol type="expression" />
807905 <symbol type="reference" scope="local" />
808906 <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
809907 <capture number="1" name="haskell.import-list.identifier.type.name" />
@@ -817,6 +915,13 @@
817915 </scope>
818916 </collection>
819917
918+ <!-- <collection name="special">
919+ <scope>
920+ <expression>(;|,)</expression>
921+ </scope>
922+ </collection> -->
923+
924+
820925 <collection name="reservedop">
821926 <scope name="keyword.operator">
822927 <expression>(\.\.|:|::|=|\\|\||<-|->|@|~|=>)</expression>
@@ -824,11 +929,10 @@
824929 </collection>
825930
826931 <collection name="keywords">
827− <scope name="haskell.keyword.self">
932+ <scope name="haskell.keyword.modifier">
828933 <symbol type="keyword" />
829934 <strings>
830935 <string>do</string>
831− <string>mdo</string>
832936 <string>in</string>
833937 <string>infix</string>
834938 <string>infixl</string>
@@ -866,18 +970,1016 @@
866970 <strings>
867971 <string>undefined</string>
868972 <string>_</string>
869− <string>@</string>
870973 </strings>
871974 </scope>
872975 </collection>
873976
874977 <collection name="comments">
875978 <scope name="haskell.comment.single" spell-check="true">
876− <symbol type="comment" />
877− <expression> --.*$</expression>
979+ <starts-with>
980+ <expression>--</expression>
981+ </starts-with>
982+ <ends-with>
983+ <expression>$</expression>
984+ </ends-with>
985+ </scope>
986+ <scope name="haskell.comment.block" spell-check="true">
987+ <starts-with>
988+ <expression>{-</expression>
989+ </starts-with>
990+ <ends-with>
991+ <expression>-}</expression>
992+ </ends-with>
993+ </scope>
994+ </collection>
995+
996+
997+ </collections>
998+</syntax><?xml version="1.0" encoding="UTF-8"?>
999+<syntax name="haskell">
1000+ <meta>
1001+ <name>Haskell</name>
1002+ <type>compiled</type>
1003+ <preferred-file-extension>hs</preferred-file-extension>
1004+ </meta>
1005+
1006+ <detectors>
1007+ <extension priority="1.0">hs</extension>
1008+ </detectors>
1009+
1010+ <comments>
1011+ <single>
1012+ <expression>--</expression>
1013+ </single>
1014+ <multiline>
1015+ <starts-with>
1016+ <expression>{-</expression>
1017+ </starts-with>
1018+ <ends-with>
1019+ <expression>-}</expression>
1020+ </ends-with>
1021+ </multiline>
1022+ </comments>
1023+
1024+ <brackets>
1025+ <pair open="{" close="}" />
1026+ <pair open="[" close="]" />
1027+ <pair open="(" close=")" />
1028+ </brackets>
1029+
1030+ <surrounding-pairs>
1031+ <pair open="[" close="]" />
1032+ <pair open="(" close=")" />
1033+ <pair open="'" close="'" />
1034+ <pair open=""" close=""" />
1035+ <pair open="`" close="`" />
1036+ </surrounding-pairs>
1037+
1038+ <indentation>
1039+ <increase>
1040+ <expression>
1041+ (case|class|do|let|where|=).*
1042+ </expression>
1043+ </increase>
1044+ <decrease>
1045+ <expression>^\\s*(end|done|with|in|else)\\b|^\\s*;;</expression>
1046+ </decrease>
1047+ </indentation>
1048+
1049+
1050+ <scopes>
1051+ <include syntax="self" collection="comments" />
1052+ <include syntax="self" collection="module" />
1053+ <include syntax="self" collection="import" />
1054+ <include syntax="self" collection="type-family-definition" />
1055+ <include syntax="self" collection="pattern-definition" />
1056+ <include syntax="self" collection="type-definition" />
1057+ <!-- <include syntax="self" collection="type-annotation" /> -->
1058+ <include syntax="self" collection="GADT-definition" />
1059+ <include syntax="self" collection="instance" />
1060+ <include syntax="self" collection="typeclass" />
1061+ <include syntax="self" collection="definition" />
1062+ </scopes>
1063+
1064+ <template-scopes>
1065+ <include syntax="self" collection="Quote" />
1066+ <include syntax="self" collection="comments" />
1067+ </template-scopes>
1068+
1069+ <collections>
1070+
1071+
1072+ <collection name="operators">
1073+ <scope name="keyword.modifier">
1074+ <expression>(!|#|\$|%|&|⋆|\+|\.|/|<|=|>|\?|@|\\|\^|\||-|~|:)+</expression>
1075+ </scope>
1076+ </collection>
1077+
1078+ <collection name="expressions">
1079+ <include syntax="self" collection="do-bind" />
1080+ <include syntax="self" collection="literal" />
1081+ <include syntax="self" collection="operators" />
1082+ <include syntax="self" collection="list" />
1083+ <include syntax="self" collection="lambda-case" />
1084+ <include syntax="self" collection="lambda-head" />
1085+ <include syntax="self" collection="type-applications" />
1086+ <include syntax="self" collection="outer-case-expression" />
1087+ <include syntax="self" collection="qvarid" />
1088+ <include syntax="self" collection="tuple" />
1089+
1090+
1091+ <!-- Needed for do binds -->
1092+ <!-- <include syntax="self" collection="pattern-match" /> -->
1093+ </collection>
1094+
1095+ <collection name="pattern-match">
1096+ <include syntax="self" collection="literal" />
1097+ <include syntax="self" collection="tuple-match" />
1098+ <!-- <include syntax="self" collection="at-pattern" /> -->
1099+ <include syntax="self" collection="varid" />
1100+ <include syntax="self" collection="qconid" />
1101+ <include syntax="self" collection="record-match" />
1102+ <include syntax="self" collection="list-pattern" />
1103+ <include syntax="self" collection="view-pattern" />
1104+ </collection>
1105+
1106+ <collection name="type-applications">
1107+ <scope name="type-applications">
1108+ <starts-with>
1109+ <expression>(\s@)\(</expression>
1110+ <capture number="1" name="haskell.keyword.operator.typeapplication" />
1111+ </starts-with>
1112+ <ends-with>
1113+ <expression>)</expression>
1114+ </ends-with>
1115+ <subscopes>
1116+ <include syntax="self" collection="type" />
1117+ </subscopes>
1118+ </scope>
1119+ <scope name="type-applications-single">
1120+ <expression>(@)(\w+)</expression>
1121+ <capture number="1" name="haskell.keyword.operator.typeapplication" />
1122+ <capture number="2" name="haskell.identifier.type" />
1123+ </scope>
1124+ </collection>
1125+
1126+ <collection name="Quote">
1127+ <scope name="haskell.quasiquote.string-template">
1128+ <starts-with>
1129+ <expression>\[((?:\w|')+)\|</expression>
1130+ <capture number="1" name="haskell.identifier.constant" />
1131+ </starts-with>
1132+ <ends-with>
1133+ <expression>\|\]</expression>
1134+ </ends-with>
1135+ <subscopes>
1136+ <scope name="haskell.quasiquote.string-template.value">
1137+ <expression>.+?</expression>
1138+ </scope>
1139+ </subscopes>
1140+ </scope>
1141+ </collection>
1142+
1143+ <collection name="record-match">
1144+ <include syntax="self" collection="qconid" />
1145+ <include syntax="self" collection="record-fields-match" />
1146+ <include syntax="self" collection="record-fields-match-all" />
1147+ </collection>
1148+
1149+
1150+ <collection name="record-fields-match">
1151+ <scope name="record-fields-match">
1152+ <symbol type="expression" />
1153+ <starts-with>
1154+ <expression>(\{)</expression>
1155+ <capture number="1" name="haskell.pattern.record.bracket" />
1156+ </starts-with>
1157+ <ends-with>
1158+ <expression>(\})</expression>
1159+ <capture number="1" name="haskell.pattern.record.bracket" />
1160+ </ends-with>
1161+ <subscopes>
1162+ <include syntax="self" collection="pattern-match" />
1163+ <include syntax="self" collection="varid" />
1164+ <scope name="record-sep">
1165+ <expression>=</expression>
1166+ </scope>
1167+ <scope name="record-sep">
1168+ <expression>,</expression>
1169+ </scope>
1170+ </subscopes>
1171+ </scope>
1172+ </collection>
1173+
1174+ <collection name="record-fields-match-wildcard">
1175+ <scope name="record-fields-match-all">
1176+ <starts-with>
1177+ <expression>(\{)</expression>
1178+ <capture number="1" name="haskell.pattern.record.bracket" />
1179+ </starts-with>
1180+ <ends-with>
1181+ <expression>(\})</expression>
1182+ <capture number="1" name="haskell.pattern.record.bracket" />
1183+ </ends-with>
1184+ <subscopes>
1185+ <scope name="haskell.pattern.record.wildcard">
1186+ <expression>\.\.</expression>
1187+ </scope>
1188+ </subscopes>
1189+ </scope>
1190+ </collection>
1191+
1192+ <collection name="bind-arrow">
1193+ <scope name="haskell.operator.bind-arrow">
1194+ <expression><-</expression>
1195+ </scope>
1196+ </collection>
1197+
1198+
1199+ <collection name="list">
1200+ <symbol type="expression" />
1201+ <scope name="haskell.list">
1202+ <starts-with>
1203+ <expression>(\[)</expression>
1204+ <capture number="1" name="haskell.list.bracket" />
1205+ </starts-with>
1206+ <ends-with>
1207+ <expression>(\])</expression>
1208+ <capture number="1" name="haskell.list.bracket" />
1209+ </ends-with>
1210+ <subscopes>
1211+ <include syntax="self" collection="expressions" />
1212+ </subscopes>
1213+ </scope>
1214+ </collection>
1215+
1216+ <collection name="list-pattern">
1217+ <symbol type="expression" />
1218+ <scope name="haskell.pattern.list">
1219+ <starts-with>
1220+ <expression>(\[)</expression>
1221+ <capture number="1" name="haskell.pattern.list.bracket" />
1222+ </starts-with>
1223+ <ends-with>
1224+ <expression>(\])</expression>
1225+ <capture number="1" name="haskell.pattern.list.bracket" />
1226+ </ends-with>
1227+ <subscopes>
1228+ <include syntax="self" collection="pattern-match" />
1229+ </subscopes>
1230+ </scope>
1231+ </collection>
1232+
1233+
1234+ <collection name="view-pattern">
1235+ <scope name="haskell.pattern.view">
1236+ <symbol type="expression" />
1237+ <starts-with>
1238+ <expression>(\()</expression>
1239+ <capture number="1" name="haskell.pattern.view.bracket" />
1240+ </starts-with>
1241+ <ends-with>
1242+ <expression>(\))</expression>
1243+ <capture number="1" name="haskell.pattern.view.bracket" />
1244+ </ends-with>
1245+ <subscopes anchored="true">
1246+ <include syntax="self" collection="expressions" />
1247+ <scope name="haskell.pattern.view.operator.arrow">
1248+ <expression>-></expression>
1249+ </scope>
1250+ <include syntax="self" collection="pattern-match" />
1251+ </subscopes>
1252+ </scope>
1253+ </collection>
1254+
1255+ <collection name="tuple-match">
1256+ <symbol type="expression" />
1257+ <scope name="haskell.pattern.tuple">
1258+ <starts-with>
1259+ <expression>(\()</expression>
1260+ <capture number="1" name="haskell.pattern.tuple.bracket" />
1261+ </starts-with>
1262+ <ends-with>
1263+ <expression>(\))</expression>
1264+ <capture number="1" name="haskell.pattern.tuple.bracket" />
1265+ </ends-with>
1266+ <subscopes>
1267+ <include syntax="self" collection="pattern-match" />
1268+ </subscopes>
1269+ </scope>
1270+ </collection>
1271+
1272+ <collection name="case-expression">
1273+ <scope name="haskell.case">
1274+ <starts-with>
1275+ <expression>(case)</expression>
1276+ <capture number="1" name="haskell.case.keyword.condition" />
1277+ </starts-with>
1278+ <ends-with>
1279+ <expression>(of)</expression>
1280+ <capture number="1" name="haskell.case.keyword.condition" />
1281+ </ends-with>
1282+ <subscopes anchored="true">
1283+ <include syntax="self" collection="pattern-match" />
1284+ </subscopes>
1285+ </scope>
1286+ </collection>
1287+
1288+ <collection name="case-match">
1289+ <scope name="case-match">
1290+ <starts-with>
1291+ <expression>(?=((\h*)\S.*->($|\h)))</expression>
1292+ </starts-with>
1293+ <ends-with>
1294+ <expression>-></expression>
1295+ </ends-with>
1296+ <subscopes anchored="true">
1297+ <include syntax="self" collection="pattern-match" />
1298+ </subscopes>
1299+ </scope>
1300+ </collection>
1301+
1302+ <collection name="inner-case-expressions">
1303+ <scope name="inner-case-expressions">
1304+ <starts-with>
1305+ <expression>(?=((\h*)\S.*->($|\h)))</expression>
1306+ </starts-with>
1307+ <ends-with>
1308+ <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
1309+ </ends-with>
1310+ <subscopes>
1311+ <include syntax="self" collection="case-match" />
1312+ <include syntax="self" collection="expressions" />
1313+ </subscopes>
1314+ </scope>
1315+ </collection>
1316+
1317+ <collection name="outer-case-expression">
1318+ <scope name="outer-case-expression">
1319+ <starts-with>
1320+ <expression>(?=case)</expression>
1321+ </starts-with>
1322+ <ends-with />
1323+ <subscopes anchored="true" skip-whitespace="false">
1324+ <include syntax="self" collection="case-expression" />
1325+ <include syntax="self" collection="inner-case-expressions" repeat="true" />
1326+ </subscopes>
1327+ </scope>
1328+ </collection>
1329+
1330+ <collection name="tuple">
1331+ <symbol type="expression" />
1332+ <scope name="haskell.tuple">
1333+ <starts-with>
1334+ <expression>(\()</expression>
1335+ <capture number="1" name="haskell.tuple.bracket" />
1336+ </starts-with>
1337+ <ends-with>
1338+ <expression>(\))</expression>
1339+ <capture number="1" name="haskell.tuple.bracket" />
1340+ </ends-with>
1341+ <subscopes>
1342+ <include syntax="self" collection="expressions" />
1343+ </subscopes>
1344+ </scope>
1345+ </collection>
1346+
1347+ <collection name="typeclass">
1348+ <symbol type="interface" />
1349+ <scope name="haskell.definition.class">
1350+ <starts-with>
1351+ <expression>^(\h*)(class)($|\h)</expression>
1352+ <capture number="2" name="haskell.keyword.construct.class" />
1353+ </starts-with>
1354+ <ends-with>
1355+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1356+ </ends-with>
1357+ <subscopes>
1358+ <scope name="haskell.keyword.construct.where">
1359+ <expression>where</expression>
1360+ </scope>
1361+ <include syntax="self" collection="type" />
1362+ <include syntax="self" collection="type-definition" />
1363+ <!-- <include syntax="self" collection="type-annotation" /> -->
1364+ <include syntax="self" collection="definition" />
1365+ </subscopes>
1366+ </scope>
1367+ </collection>
1368+
1369+ <collection name="instance">
1370+ <scope name="haskell.instance">
1371+ <symbol type="category" />
1372+ <starts-with>
1373+ <expression>^(\h*)(instance)($|\h)</expression>
1374+ <capture number="2" name="haskell.keyword.construct.instance" />
1375+ </starts-with>
1376+ <ends-with>
1377+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1378+ </ends-with>
1379+ <subscopes>
1380+ <scope name="haskell.keyword.construct.where">
1381+ <expression>where</expression>
1382+ </scope>
1383+ <include syntax="self" collection="type" />
1384+ <include syntax="self" collection="type-definition" />
1385+ <include syntax="self" collection="type-annotation" />
1386+ <include syntax="self" collection="definition" />
1387+ </subscopes>
1388+ </scope>
1389+ </collection>
1390+
1391+ <collection name="type-family-definition">
1392+ <scope name="haskell.definition.type-family.type">
1393+ <symbol type="type">
1394+ <context behavior="subtree" foldable="false" />
1395+ </symbol>
1396+ <starts-with>
1397+ <expression>^(\h*)(type\h+family)</expression>
1398+ <capture number="2" name="haskell.keyword.construct.type-family" />
1399+ </starts-with>
1400+ <ends-with>
1401+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1402+ </ends-with>
1403+ <subscopes anchored="true" skip-whitespace="false">
1404+ <scope name="haskell.type-family.head">
1405+ <starts-with>
1406+ <expression></expression>
1407+ </starts-with>
1408+ <ends-with>
1409+ <expression>where</expression>
1410+ <capture number="0" name="haskell.keyword.construct.where" />
1411+ </ends-with>
1412+ <subscopes anchored="true">
1413+ <scope name="haskell.identifier.type-family.type.name">
1414+ <expression>\S+</expression>
1415+ </scope>
1416+ <include syntax="self" collection="type" repeat="true" optional="true" />
1417+ </subscopes>
1418+ </scope>
1419+
1420+ <include syntax="self" collection="type-family-case-definition" optional="true" repeat="true" />
1421+ </subscopes>
1422+ </scope>
1423+ </collection>
1424+
1425+ <collection name="type-family-case-definition">
1426+ <scope name="haskell.definition.type-family.type.case">
1427+ <starts-with>
1428+ <expression>^(\h*)(?=\S)</expression>
1429+ </starts-with>
1430+ <ends-with>
1431+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1432+ </ends-with>
1433+ <subscopes>
1434+ <include syntax="self" collection="type" optional="true" repeat="true" />
1435+ <scope>
1436+ <expression>=</expression>
1437+ </scope>
1438+ <include syntax="self" collection="type" optional="true" repeat="true" />
1439+ </subscopes>
1440+ </scope>
1441+ </collection>
1442+
1443+ <collection name="definition">
1444+ <scope name="haskell.definition.type.function">
1445+ <symbol type="function">
1446+ <display-name>
1447+ <component selector="haskell.definition.type.function" />
1448+ </display-name>
1449+
1450+ </symbol>
1451+ <starts-with>
1452+ <expression>^(?=(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h))</expression>
1453+ <capture number="2" name="haskell.keyword.construct.default" />
1454+ <capture number="3" name="haskell.identifier.function" />
1455+ </starts-with>
1456+ <ends-with>
1457+ <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
1458+ </ends-with>
1459+ <subscopes>
1460+ <include syntax="self" collection="type-annotation" />
1461+ <include syntax="self" collection="implementation" />
1462+ </subscopes>
1463+ </scope>
1464+ </collection>
1465+
1466+ <collection name="do-bind">
1467+ <scope name="do-bind">
1468+ <starts-with>
1469+ <expression>^(?=((\h*)\S.+<-($|\h)))</expression>
1470+ </starts-with>
1471+ <ends-with>
1472+ <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
1473+ </ends-with>
1474+ <subscopes>
1475+ <include syntax="self" collection="do-pattern" />
1476+ <include syntax="self" collection="expressions" />
1477+ <!-- <scope name="bind-arrow">
1478+ <expression><-</expression>
1479+ </scope> -->
1480+ </subscopes>
1481+ </scope>
1482+ </collection>
1483+
1484+ <collection name="do-pattern">
1485+ <scope name="do-pattern">
1486+ <starts-with>
1487+ <expression>^(?=((\h*)\S.+<-($|\h)))</expression>
1488+ </starts-with>
1489+ <ends-with>
1490+ <expression><-</expression>
1491+ </ends-with>
1492+ <subscopes>
1493+ <include syntax="self" collection="pattern-match" />
1494+ <!-- <scope name="bind-arrow">
1495+ <expression><-</expression>
1496+ </scope>
1497+ <include syntax="self" collection="expressions" repeat="true" /> -->
1498+ </subscopes>
1499+ </scope>
1500+ </collection>
1501+
1502+ <collection name="implementation">
1503+ <scope name="haskell.definition.type.function">
1504+ <local scope="within-construct" />
1505+ <starts-with>
1506+ <expression>^(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h)</expression>
1507+ <capture number="2" name="haskell.keyword.construct.default" />
1508+ <capture number="3" name="haskell.identifier.function" />
1509+ </starts-with>
1510+ <ends-with>
1511+ <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
1512+ </ends-with>
1513+ <subscopes>
1514+ <include syntax="self" collection="where-clause" />
1515+ <include syntax="self" collection="expressions" />
1516+ </subscopes>
1517+ </scope>
1518+ </collection>
1519+
1520+ <collection name="type-annotation">
1521+ <scope name="haskell.definition.type.function">
1522+ <starts-with>
1523+ <expression>^(\h*)`?(\w(\w|')*)`?\h*::($|\h)</expression>
1524+ <capture number="2" name="haskell.identifier.function" />
1525+ </starts-with>
1526+ <ends-with>
1527+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1528+ </ends-with>
1529+ <subscopes>
1530+ <include syntax="self" collection="type" />
1531+ </subscopes>
1532+ </scope>
1533+ </collection>
1534+
1535+ <collection name="type-definition">
1536+ <scope name="haskell.definition.type">
1537+ <starts-with>
1538+ <expression>^(\h*)(type)\h+(\w(\w|')*)</expression>
1539+ <capture number="2" name="haskell.keyword.construct.type" />
1540+ <capture number="3" name="haskell.identifier.type" />
1541+ </starts-with>
1542+ <ends-with>
1543+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1544+ </ends-with>
1545+ <subscopes>
1546+ <include syntax="self" collection="type" />
1547+ </subscopes>
1548+ </scope>
1549+ </collection>
1550+
1551+ <collection name="GADT-definition">
1552+ <scope name="haskell.definition.struct.GADT">
1553+ <symbol type="struct">
1554+ <context behavior="subtree" foldable="false" />
1555+ </symbol>
1556+ <starts-with>
1557+ <expression>^(\h*)(data|newtype)\h+(\w(\w|')*)</expression>
1558+ <capture number="2" name="haskell.keyword.construct.data.GADT" />
1559+ <capture number="3" name="haskell.identifier.data.type.name" />
1560+ </starts-with>
1561+ <ends-with>
1562+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1563+ </ends-with>
1564+ <subscopes>
1565+ <scope name="haskell.keyword.construct.where">
1566+ <expression>where</expression>
1567+ </scope>
1568+
1569+ <include syntax="self" collection="deriving-clause" />
1570+ <include syntax="self" collection="record-definition" />
1571+ <include syntax="self" collection="gadt-constructor" />
1572+ <include syntax="self" collection="type" />
1573+ </subscopes>
1574+ </scope>
1575+ </collection>
1576+
1577+ <collection name="gadt-constructor">
1578+ <scope name="haskell.identifier.type.struct.data.constructor">
1579+ <symbol type="constructor">
1580+ <context behavior="whitespace" />
1581+ </symbol>
1582+ <expression>(^|=|\|)\h+([A-Z](\w|')*)</expression>
1583+ <capture number="2" name="haskell.identifier.data.name" />
1584+ </scope>
1585+ <scope name="identifier.type.struct.GADT.constructor">
1586+ <symbol type="constructor"></symbol>
1587+ <expression>^\h+([A-Z](\w|')*)</expression>
1588+ <capture number="1" name="haskell.identifier.data.name" />
1589+ </scope>
1590+ </collection>
1591+
1592+ <collection name="deriving-clause">
1593+ <scope name="haskell.record.construct.deriving.keyword">
1594+ <expression>deriving\h+(newtype|stock|anyclass)</expression>
1595+ </scope>
1596+ </collection>
1597+
1598+ <collection name="record-definition">
1599+ <scope name="haskell.record">
1600+ <symbol>
1601+ <context behavior="subtree" foldable="true" />
1602+ </symbol>
1603+ <starts-with>
1604+ <expression>(?=\{)</expression>
1605+ <capture number="0" name="haskell.record.bracket" />
1606+ </starts-with>
1607+ <ends-with>
1608+ <expression>(\})</expression>
1609+ <capture number="1" name="haskell.record.bracket" />
1610+ </ends-with>
1611+ <subscopes>
1612+ <include syntax="self" collection="record-definition-field-name" />
1613+ <include syntax="self" collection="type" />
1614+ </subscopes>
1615+ </scope>
1616+ </collection>
1617+
1618+ <collection name="record-definition-field-name">
1619+ <scope name="haskell.record.definition.property">
1620+ <symbol type="property" />
1621+ <expression>(((?![A-Z])\w(\w|')*)\h*::|(^|\{|,)\h*((?![A-Z])\w(\w|')*))</expression>
1622+ <capture number="5" name="haskell.record.definition.property.field.property.name" />
1623+ <capture number="2" name="haskell.record.definition.property.field.property.name" />
1624+ </scope>
1625+ </collection>
1626+
1627+ <collection name="type">
1628+ <scope name="haskell.type.construct.tuple">
1629+ <starts-with>
1630+ <expression>\(</expression>
1631+ </starts-with>
1632+ <ends-with>
1633+ <expression>\)</expression>
1634+ </ends-with>
1635+ <subscopes>
1636+ <scope name="haskell.construct.type.typle.comma">
1637+ <expression>\,</expression>
1638+ </scope>
1639+ <include syntax="self" collection="type" />
1640+ </subscopes>
1641+ </scope>
1642+ <scope name="haskell.type.list">
1643+ <starts-with>
1644+ <expression>'?\[</expression>
1645+ </starts-with>
1646+ <ends-with>
1647+ <expression>\]</expression>
1648+ </ends-with>
1649+ <subscopes>
1650+ <include syntax="self" collection="type" />
1651+ </subscopes>
1652+ </scope>
1653+ <scope name="haskell.type.star">
1654+ <expression>\*</expression>
1655+ </scope>
1656+ <scope name="haskell.keyword.construct.type-annotation-operator">
1657+ <expression>::</expression>
1658+ </scope>
1659+ <include syntax="self" collection="type-list" />
1660+ <scope>
1661+ <expression>(([A-Z](\w|')*\.)*)'*([A-Z](\w|')*)</expression>
1662+ <capture number="1" name="haskell.identifier.package.module" />
1663+ <capture number="4" name="haskell.identifier.type" />
1664+ </scope>
1665+ <scope name="haskell.keyword.construct.forall">
1666+ <expression>forall</expression>
1667+ </scope>
1668+ <scope name="haskell.identifier.type.variable">
1669+ <expression>(?!=)((?!(\(|\)|\,))\S)((?!(\(|\)|\,))\S)*</expression>
1670+ </scope>
1671+ <scope name="haskell.keyword.construct.function-arrow">
1672+ <expression>-></expression>
1673+ </scope>
1674+ <scope name="haskell.keyword.construct.fat-arrow">
1675+ <expression>=></expression>
1676+ </scope>
1677+ </collection>
1678+
1679+ <collection name="pattern-definition">
1680+ <scope name="haskell.pattern">
1681+ <starts-with>
1682+ <expression>^(\h*)(pattern)\h+(\w(\w|')*)</expression>
1683+ <capture number="2" name="haskell.keyword.construct.pattern" />
1684+ <capture number="3" name="haskell.identifier.decorator.pattern" />
1685+ </starts-with>
1686+ <ends-with>
1687+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1688+ </ends-with>
1689+ <subscopes>
1690+ <scope name="haskell.keyword.construct.where">
1691+ <expression>where</expression>
1692+ </scope>
1693+ <include syntax="self" collection="expressions" />
1694+ </subscopes>
1695+ </scope>
1696+ </collection>
1697+
1698+ <collection name="type-list">
1699+ <scope name="haskell.type-list">
1700+ <starts-with>
1701+ <expression>('\[)</expression>
1702+ <capture number="1" name="haskell.type-list.bracket" />
1703+ </starts-with>
1704+ <ends-with>
1705+ <expression>(\])</expression>
1706+ <capture number="1" name="haskell.type-list.bracket" />
1707+ </ends-with>
1708+ <subscopes>
1709+ <include syntax="self" collection="type" />
1710+ </subscopes>
1711+ </scope>
1712+ </collection>
1713+
1714+ <collection name="lambda-head">
1715+ <scope name="haskell.lambda">
1716+ <starts-with>
1717+ <expression>(\\)</expression>
1718+ <capture number="1" name="haskell.keyword.construct.lambda" />
1719+ </starts-with>
1720+ <ends-with>
1721+ <expression>(->)</expression>
1722+ <capture number="1" name="haskell.keyword.construct.lambda" />
1723+ </ends-with>
1724+ <subscopes>
1725+ <include syntax="self" collection="pattern-match" />
1726+ </subscopes>
1727+ </scope>
1728+ </collection>
1729+
1730+ <collection name="lambda-case">
1731+ <scope name="haskell.keyword.condition.lambda-case">
1732+ <expression>\\case</expression>
1733+ </scope>
1734+ </collection>
1735+
1736+ <collection name="where-clause">
1737+ <scope name="haskell.construct.where">
1738+ <local scope="within-parent" />
1739+ <starts-with>
1740+ <expression>^(\h*)(where)</expression>
1741+ <capture number="2" name="haskell.construct.keyword.where" />
1742+ </starts-with>
1743+ <ends-with>
1744+ <template>^(?!\1\s*\S)(?!s*$)</template>
1745+ </ends-with>
1746+ <subscopes>
1747+ <include syntax="self" collection="definition" />
1748+ </subscopes>
1749+ </scope>
1750+ </collection>
1751+
1752+
1753+ <collection name="qvarid">
1754+ <scope name="haskell.identifier.function">
1755+ <expression>(([A-Z](\w|')*\.)*)(\w(\w|')*)</expression>
1756+ <capture number="1" name="haskell.identifier.package.module" />
1757+ <capture number="4" name="haskell.identifier.type" />
1758+ </scope>
1759+ </collection>
1760+
1761+ <collection name="varid">
1762+ <scope name="haskell.identifier.variable">
1763+ <expression>\w(\w|')*</expression>
1764+ </scope>
1765+ </collection>
1766+
1767+ <collection name="qconid">
1768+ <scope name="haskell.identifier.type.struct.constructor">
1769+ <expression>([A-Z](\w|')*\.)*[A-Z](\w|')*</expression>
1770+ </scope>
1771+ </collection>
1772+
1773+ <collection name="qconsym">
1774+ <scope name="haskell.identifier.decorator.pattern">
1775+ <expression>([A-Z](\w|')*\.):(\w|')*</expression>
1776+ </scope>
1777+ </collection>
1778+
1779+ <collection name="literal">
1780+ <include syntax="self" collection="number" />
1781+ <include syntax="self" collection="strings" />
1782+ </collection>
1783+
1784+
1785+ <collection name="strings">
1786+ <scope name="haskell.string.double-quoted">
1787+ <starts-with>
1788+ <expression>"</expression>
1789+ </starts-with>
1790+ <ends-with>
1791+ <expression>"</expression>
1792+ </ends-with>
1793+ <subscopes>
1794+ <scope name="haskell.string.escape-sequences">
1795+ <expression>\\.</expression>
1796+ </scope>
1797+ </subscopes>
1798+ </scope>
1799+ <scope name="haskell.string.single-quoted">
1800+ <expression>'([^'\\]|\\.)'</expression>
1801+ </scope>
1802+ </collection>
1803+
1804+
1805+ <collection name="number">
1806+ <scope name="haskell.value.number">
1807+ <expression>(0x|0o|0O|0X)?\d+(\d|_)*(\.[\d|_]+)?((e|E)(\+|-)?\d+)?</expression>
1808+ </scope>
1809+ </collection>
1810+
1811+
1812+ <collection name="module">
1813+ <scope name="haskell.definition.module.package">
1814+ <symbol type="package">
1815+ <context behavior="subtree" foldable="true" export-local="true" />
1816+ </symbol>
1817+ <starts-with>
1818+ <expression>^(module)\s+((\w|\.)+)</expression>
1819+ <capture number="1" name="haskell.construct.keyword.module" />
1820+ <capture number="2" name="haskell.definition.module.package" />
1821+ </starts-with>
1822+ <ends-with>
1823+ <expression>(where)</expression>
1824+ <capture number="1" name="haskell.construct.keyword.module" />
1825+ </ends-with>
1826+ <subscopes>
1827+ <scope name="identifier.haskell.type">
1828+ <symbol type="expression" />
1829+ <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
1830+ <capture number="1" name="identifier.type" />
1831+ </scope>
1832+ <scope name="identifier.variable">
1833+ <symbol type="expression" />
1834+ <expression>(\w|')+</expression>
1835+ <capture number="0" name="identifier.haskell.function" />
1836+ </scope>
1837+ </subscopes>
1838+ </scope>
1839+ </collection>
1840+
1841+ <collection name="import">
1842+ <scope name="haskell.construct.import">
1843+ <starts-with>
1844+ <expression>^(import)\s</expression>
1845+ <capture number="1" name="haskell.construct.keyword.import" />
1846+ </starts-with>
1847+ <ends-with>
1848+ <expression>(?=^\S)</expression>
1849+ </ends-with>
1850+ <subscopes>
1851+ <scope name="haskell.construct.qualified">
1852+ <expression>qualified</expression>
1853+ <capture number="0" name="haskell.construct.keyword.qualified" />
1854+ </scope>
1855+
1856+ <scope name="haskell.construct.hiding">
1857+ <symbol type="keyword">
1858+ <context behavior="subtree" />
1859+ </symbol>
1860+ <starts-with>
1861+ <expression>(hiding)\h*(?=\()</expression>
1862+ <capture number="1" name="haskell.construct.keyword.hiding" />
1863+ </starts-with>
1864+ <ends-with>
1865+ <expression>(?=\))</expression>
1866+ </ends-with>
1867+ <subscopes anchored="true">
1868+ <include syntax="self" collection="import-list" />
1869+ </subscopes>
1870+ </scope>
1871+
1872+ <scope name="haskell.construct.keyword.as">
1873+ <symbol type="package" />
1874+ <expression>as(\h+([A-Z]\w*))?</expression>
1875+ <capture number="2" name="haskell.package.qualified.name" />
1876+ </scope>
1877+ <scope name="haskell.identifier.module.package">
1878+ <symbol type="package" />
1879+ <expression>([A-Z](\w|')*\.)*[A-Z](\w|')*</expression>
1880+ <capture number="0" name="haskell.package.name" />
1881+ </scope>
1882+ <include syntax="self" collection="import-list" />
1883+ </subscopes>
1884+ </scope>
1885+ </collection>
1886+
1887+ <collection name="import-list">
1888+ <scope name="import-list">
1889+ <symbol>
1890+ <context behavior="subtree" export-local="true" />
1891+ </symbol>
1892+ <starts-with>
1893+ <expression>(\()</expression>
1894+ <capture number="1" name="haskell.import-list.bracket" />
1895+ </starts-with>
1896+ <ends-with>
1897+ <expression>(\))</expression>
1898+ <capture number="1" name="haskell.import-list.bracket" />
1899+ </ends-with>
1900+ <subscopes>
1901+ <scope name="haskell.identifier.struct">
1902+ <symbol type="reference" scope="local" />
1903+ <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
1904+ <capture number="1" name="haskell.import-list.identifier.type.name" />
1905+ </scope>
1906+ <scope name="haskell.identifier.function">
1907+ <symbol type="reference" scope="local" />
1908+ <expression>(\w|')+</expression>
1909+ <capture number="0" name="haskell.import-list.function.name" />
1910+ </scope>
1911+ </subscopes>
1912+ </scope>
1913+ </collection>
1914+
1915+ <!-- <collection name="special">
1916+ <scope>
1917+ <expression>(;|,)</expression>
1918+ </scope>
1919+ </collection> -->
1920+
1921+
1922+ <collection name="reservedop">
1923+ <scope name="keyword.operator">
1924+ <expression>(\.\.|:|::|=|\\|\||<-|->|@|~|=>)</expression>
1925+ </scope>
1926+ </collection>
1927+
1928+ <collection name="keywords">
1929+ <scope name="haskell.keyword.modifier">
1930+ <symbol type="keyword" />
1931+ <strings>
1932+ <string>do</string>
1933+ <string>in</string>
1934+ <string>infix</string>
1935+ <string>infixl</string>
1936+ <string>infixr</string>
1937+ <string>where</string>
1938+ <string>let</string>
1939+ </strings>
1940+ </scope>
1941+ <scope name="haskell.keyword.condition">
1942+ <symbol type="keyword" />
1943+ <strings>
1944+ <string>of</string>
1945+ <string>case</string>
1946+ <string>else</string>
1947+ <string>if</string>
1948+ <string>then</string>
1949+ </strings>
1950+ </scope>
1951+ <scope name="haskell.keyword.keyword.construct">
1952+ <symbol type="keyword" />
1953+ <strings>
1954+ <string>instance</string>
1955+ <string>module</string>
1956+ <string>type</string>
1957+ <string>class</string>
1958+ <string>data</string>
1959+ <string>default</string>
1960+ <string>deriving</string>
1961+ <string>foreign</string>
1962+ </strings>
1963+ </scope>
1964+ <scope name="haskell.keyword.self">
1965+ <symbol type="keyword" />
1966+ <strings>
1967+ <string>undefined</string>
1968+ <string>_</string>
1969+ </strings>
1970+ </scope>
1971+ </collection>
1972+
1973+ <collection name="comments">
1974+ <scope name="haskell.comment.single" spell-check="true">
1975+ <starts-with>
1976+ <expression>--</expression>
1977+ </starts-with>
1978+ <ends-with>
1979+ <expression>$</expression>
1980+ </ends-with>
8781981 </scope>
8791982 <scope name="haskell.comment.block" spell-check="true">
880− <symbol type="comment" />
8811983 <starts-with>
8821984 <expression>{-</expression>
8831985 </starts-with>
@@ -889,4 +1991,4 @@
8891991
8901992
8911993 </collections>
892−</syntax>
1994+</syntax>