@@ -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,8 @@
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" /> -->
61+ <include syntax="self" collection="data-definition" />
6062 <include syntax="self" collection="GADT-definition" />
6163 <include syntax="self" collection="instance" />
6264 <include syntax="self" collection="typeclass" />
@@ -65,6 +67,7 @@
6567
6668 <template-scopes>
6769 <include syntax="self" collection="Quote" />
70+ <include syntax="self" collection="comments" />
6871 </template-scopes>
6972
7073 <collections>
@@ -77,27 +80,51 @@
7780 </collection>
7881
7982 <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" />
83+ <include syntax="self" collection="do-bind" />
9084 <include syntax="self" collection="literal" />
9185 <include syntax="self" collection="operators" />
92− <include syntax="self" collection="record-match" />
9386 <include syntax="self" collection="list" />
94− <include syntax="self" collection="view-pattern" />
9587 <include syntax="self" collection="lambda-case" />
9688 <include syntax="self" collection="lambda-head" />
97− <include syntax="self" collection="case-expression" />
98− <include syntax="self" collection="qconid" />
89+ <include syntax="self" collection="type-applications" />
90+ <include syntax="self" collection="outer-case-expression" />
9991 <include syntax="self" collection="qvarid" />
10092 <include syntax="self" collection="tuple" />
93+
94+
95+ <!-- Needed for do binds -->
96+ <!-- <include syntax="self" collection="pattern-match" /> -->
97+ </collection>
98+
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" />
108+ </collection>
109+
110+ <collection name="type-applications">
111+ <scope name="type-applications">
112+ <starts-with>
113+ <expression>(\s@)\(</expression>
114+ <capture number="1" name="haskell.keyword.operator.typeapplication" />
115+ </starts-with>
116+ <ends-with>
117+ <expression>)</expression>
118+ </ends-with>
119+ <subscopes>
120+ <include syntax="self" collection="type" />
121+ </subscopes>
122+ </scope>
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" />
127+ </scope>
101128 </collection>
102129
103130 <collection name="Quote">
@@ -136,8 +163,8 @@
136163 <capture number="1" name="haskell.pattern.record.bracket" />
137164 </ends-with>
138165 <subscopes>
139− <include syntax="self" collection="comments" />
140− <include syntax="self" collection="expressions" />
166+ <include syntax="self" collection="pattern-match" />
167+ <include syntax="self" collection="varid" />
141168 <scope name="record-sep">
142169 <expression>=</expression>
143170 </scope>
@@ -159,7 +186,6 @@
159186 <capture number="1" name="haskell.pattern.record.bracket" />
160187 </ends-with>
161188 <subscopes>
162− <include syntax="self" collection="comments" />
163189 <scope name="haskell.pattern.record.wildcard">
164190 <expression>\.\.</expression>
165191 </scope>
@@ -186,12 +212,29 @@
186212 <capture number="1" name="haskell.list.bracket" />
187213 </ends-with>
188214 <subscopes>
189− <include syntax="self" collection="comments" />
190215 <include syntax="self" collection="expressions" />
191216 </subscopes>
192217 </scope>
193218 </collection>
194219
220+ <collection name="list-pattern">
221+ <symbol type="expression" />
222+ <scope name="haskell.pattern.list">
223+ <starts-with>
224+ <expression>(\[)</expression>
225+ <capture number="1" name="haskell.pattern.list.bracket" />
226+ </starts-with>
227+ <ends-with>
228+ <expression>(\])</expression>
229+ <capture number="1" name="haskell.pattern.list.bracket" />
230+ </ends-with>
231+ <subscopes>
232+ <include syntax="self" collection="pattern-match" />
233+ </subscopes>
234+ </scope>
235+ </collection>
236+
237+
195238 <collection name="view-pattern">
196239 <scope name="haskell.pattern.view">
197240 <symbol type="expression" />
@@ -208,7 +251,24 @@
208251 <scope name="haskell.pattern.view.operator.arrow">
209252 <expression>-></expression>
210253 </scope>
211− <include syntax="self" collection="expressions" />
254+ <include syntax="self" collection="pattern-match" />
255+ </subscopes>
256+ </scope>
257+ </collection>
258+
259+ <collection name="tuple-match">
260+ <symbol type="expression" />
261+ <scope name="haskell.pattern.tuple">
262+ <starts-with>
263+ <expression>(\()</expression>
264+ <capture number="1" name="haskell.pattern.tuple.bracket" />
265+ </starts-with>
266+ <ends-with>
267+ <expression>(\))</expression>
268+ <capture number="1" name="haskell.pattern.tuple.bracket" />
269+ </ends-with>
270+ <subscopes>
271+ <include syntax="self" collection="pattern-match" />
212272 </subscopes>
213273 </scope>
214274 </collection>
@@ -224,11 +284,53 @@
224284 <capture number="1" name="haskell.case.keyword.condition" />
225285 </ends-with>
226286 <subscopes anchored="true">
287+ <include syntax="self" collection="pattern-match" />
288+ </subscopes>
289+ </scope>
290+ </collection>
291+
292+ <collection name="case-match">
293+ <scope name="case-match">
294+ <starts-with>
295+ <expression>(?=((\h*)\S.*->($|\h)))</expression>
296+ </starts-with>
297+ <ends-with>
298+ <expression>-></expression>
299+ </ends-with>
300+ <subscopes anchored="true">
301+ <include syntax="self" collection="pattern-match" />
302+ </subscopes>
303+ </scope>
304+ </collection>
305+
306+ <collection name="inner-case-expressions">
307+ <scope name="inner-case-expressions">
308+ <starts-with>
309+ <expression>(?=((\h*)\S.*->($|\h)))</expression>
310+ </starts-with>
311+ <ends-with>
312+ <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
313+ </ends-with>
314+ <subscopes>
315+ <include syntax="self" collection="case-match" />
227316 <include syntax="self" collection="expressions" />
228317 </subscopes>
229318 </scope>
230319 </collection>
231320
321+ <collection name="outer-case-expression">
322+ <scope name="outer-case-expression">
323+ <starts-with>
324+ <expression>(?=case)</expression>
325+ </starts-with>
326+ <ends-with />
327+ <subscopes anchored="true" skip-whitespace="false">
328+ <include syntax="self" collection="case-expression" />
329+ <include syntax="self" collection="inner-case-expressions" repeat="true" />
330+ </subscopes>
331+ </scope>
332+ </collection>
333+
232334 <collection name="tuple">
233335 <symbol type="expression" />
234336 <scope name="haskell.tuple">
@@ -241,117 +343,70 @@
241343 <capture number="1" name="haskell.tuple.bracket" />
242344 </ends-with>
243345 <subscopes>
244− <include syntax="self" collection="comments" />
245346 <include syntax="self" collection="expressions" />
246347 </subscopes>
247348 </scope>
248349 </collection>
249350
250351 <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>
352+ <symbol type="interface" />
353+ <scope name="haskell.definition.class">
255354 <starts-with>
256355 <expression>^(\h*)(class)($|\h)</expression>
257356 <capture number="2" name="haskell.keyword.construct.class" />
258357 </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">
358+ <ends-with>
359+ <template>^(?!\s+\1\S)(?!\s*$)</template>
360+ </ends-with>
361+ <subscopes>
362+ <scope name="haskell.keyword.construct.where">
274363 <expression>where</expression>
275364 </scope>
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" />
276369 </subscopes>
277370 </scope>
278371 </collection>
279372
280373 <collection name="instance">
281374 <scope name="haskell.instance">
282− <symbol type="category" name-selector="haskell.keyword.construct.instance.name">
283− <context behavior="whitespace" foldable="true" />
284− </symbol>
375+ <symbol type="category" />
285376 <starts-with>
286377 <expression>^(\h*)(instance)($|\h)</expression>
287378 <capture number="2" name="haskell.keyword.construct.instance" />
288379 </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">
303− <expression>where</expression>
304− </scope>
305− </subscopes>
306− </scope>
307− </collection>
308−
309− <collection name="type-family-definition">
310− <scope name="haskell.definition.type-family.type">
311− <starts-with>
312− <expression>^(\h*)(type\h+family)</expression>
313− <capture number="2" name="haskell.keyword.construct.type-family" />
314− </starts-with>
315380 <ends-with>
316381 <template>^(?!\s+\1\S)(?!\s*$)</template>
317382 </ends-with>
318− <subscopes anchored="true" skip-whitespace="false">
319− <scope name="haskell.type-family.head">
320− <starts-with>
321− <expression></expression>
322− </starts-with>
323− <ends-with>
324− <expression>where</expression>
325− <capture number="0" name="haskell.keyword.construct.where" />
326− </ends-with>
327− <subscopes anchored="true">
328− <scope name="haskell.identifier.type-family.type.name">
329− <expression>\S+</expression>
330− </scope>
331− <include syntax="self" collection="type" repeat="true" optional="true" />
332− </subscopes>
383+ <subscopes>
384+ <scope name="haskell.keyword.construct.where">
385+ <expression>where</expression>
333386 </scope>
334−
335− <include syntax="self" collection="type-family-case-definition" optional="true" repeat="true" />
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" />
336391 </subscopes>
337392 </scope>
338393 </collection>
339394
340− <collection name="type-family-case-definition">
341− <scope name="haskell.definition.type-family.type.case">
395+ <collection name="type-family-definition">
396+ <scope name="haskell.definition.type.type-family">
397+ <symbol type="type" />
342398 <starts-with>
343− <expression>^(\h*)(?=\S)</expression>
399+ <expression>^(\h*)(type\h+family)\h+`?(\w(\w|')*)`?($|\h)</expression>
400+ <capture number="2" name="haskell.keyword.construct.type-family" />
344401 </starts-with>
345402 <ends-with>
346403 <template>^(?!\s+\1\S)(?!\s*$)</template>
347404 </ends-with>
348405 <subscopes>
349− <include syntax="self" collection="comments" />
350− <include syntax="self" collection="type" optional="true" repeat="true" />
351− <scope>
352− <expression>=</expression>
406+ <scope name="haskell.keyword.construct.where">
407+ <expression>where</expression>
353408 </scope>
354− <include syntax="self" collection="type" optional="true" repeat="true" />
409+ <include syntax="self" collection="type" />
355410 </subscopes>
356411 </scope>
357412 </collection>
@@ -359,26 +414,65 @@
359414 <collection name="definition">
360415 <scope name="haskell.definition.type.function">
361416 <symbol type="function">
362− <context behavior="whitespace" foldable="true" />
417+ <display-name>
418+ <component selector="haskell.definition.type.function" />
419+ </display-name>
420+
363421 </symbol>
364422 <starts-with>
365423 <expression>^(?=(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h))</expression>
366424 <capture number="2" name="haskell.keyword.construct.default" />
367− <capture number="3" name="haskell.identifier.function.name" />
425+ <capture number="3" name="haskell.identifier.function" />
368426 </starts-with>
369427 <ends-with>
370428 <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
371429 </ends-with>
372430 <subscopes>
373− <include syntax="self" collection="comments" />
374431 <include syntax="self" collection="type-annotation" />
375432 <include syntax="self" collection="implementation" />
376433 </subscopes>
377434 </scope>
378435 </collection>
379436
437+ <collection name="do-bind">
438+ <scope name="do-bind">
439+ <starts-with>
440+ <expression>^(?=((\h*)\S.+<-($|\h)))</expression>
441+ </starts-with>
442+ <ends-with>
443+ <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
444+ </ends-with>
445+ <subscopes>
446+ <include syntax="self" collection="do-pattern" />
447+ <include syntax="self" collection="expressions" />
448+ <!-- <scope name="bind-arrow">
449+ <expression><-</expression>
450+ </scope> -->
451+ </subscopes>
452+ </scope>
453+ </collection>
454+
455+ <collection name="do-pattern">
456+ <scope name="do-pattern">
457+ <starts-with>
458+ <expression>^(?=((\h*)\S.+<-($|\h)))</expression>
459+ </starts-with>
460+ <ends-with>
461+ <expression><-</expression>
462+ </ends-with>
463+ <subscopes>
464+ <include syntax="self" collection="pattern-match" />
465+ <!-- <scope name="bind-arrow">
466+ <expression><-</expression>
467+ </scope>
468+ <include syntax="self" collection="expressions" repeat="true" /> -->
469+ </subscopes>
470+ </scope>
471+ </collection>
472+
380473 <collection name="implementation">
381− <scope name="haskell.definition.type.function.implementation">
474+ <scope name="haskell.definition.type.function">
475+ <local scope="within-construct" />
382476 <starts-with>
383477 <expression>^(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h)</expression>
384478 <capture number="2" name="haskell.keyword.construct.default" />
@@ -388,20 +482,14 @@
388482 <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
389483 </ends-with>
390484 <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" />
485+ <include syntax="self" collection="where-clause" />
486+ <include syntax="self" collection="expressions" />
399487 </subscopes>
400488 </scope>
401489 </collection>
402490
403491 <collection name="type-annotation">
404− <scope name="haskell.definition.type.function.type-signature">
492+ <scope name="haskell.definition.type.function">
405493 <starts-with>
406494 <expression>^(\h*)`?(\w(\w|')*)`?\h*::($|\h)</expression>
407495 <capture number="2" name="haskell.identifier.function" />
@@ -410,7 +498,6 @@
410498 <template>^(?!\s+\1\S)(?!\s*$)</template>
411499 </ends-with>
412500 <subscopes>
413− <include syntax="self" collection="comments" />
414501 <include syntax="self" collection="type" />
415502 </subscopes>
416503 </scope>
@@ -418,19 +505,15 @@
418505
419506 <collection name="type-definition">
420507 <scope name="haskell.definition.type">
421− <symbol type="type" scope="global">
422− <context behavior="whitespace" foldable="true" />
423− </symbol>
424508 <starts-with>
425509 <expression>^(\h*)(type)\h+(\w(\w|')*)</expression>
426510 <capture number="2" name="haskell.keyword.construct.type" />
427− <capture number="3" name="haskell.identifier.type.name" />
511+ <capture number="3" name="haskell.identifier.type" />
428512 </starts-with>
429513 <ends-with>
430514 <template>^(?!\s+\1\S)(?!\s*$)</template>
431515 </ends-with>
432516 <subscopes>
433− <include syntax="self" collection="comments" />
434517 <include syntax="self" collection="type" />
435518 </subscopes>
436519 </scope>
@@ -438,72 +521,66 @@
438521
439522 <collection name="GADT-definition">
440523 <scope name="haskell.definition.struct.GADT">
441− <symbol type="struct" scope="global">
442− <context behavior="subtree" foldable="false" />
443− </symbol>
444524 <starts-with>
445− <expression>^(\h*)(data|newtype)\h+(\w(\w|')*)</expression>
525+ <expression>^(\h*)(data)\h+(\w(\w|')*)</expression>
446526 <capture number="2" name="haskell.keyword.construct.data.GADT" />
447− <capture number="3" name="haskell.identifier.data.type.name" />
448527 </starts-with>
449528 <ends-with>
450529 <template>^(?!\s+\1\S)(?!\s*$)</template>
451530 </ends-with>
452531 <subscopes>
453− <include syntax="self" collection="comments" />
454− <scope name="haskell.keyword.construct.where">
455− <expression>where</expression>
456− </scope>
457−
458− <include syntax="self" collection="deriving-clause" />
459− <include syntax="self" collection="record-definition" />
460532 <include syntax="self" collection="gadt-constructor" />
461533 <include syntax="self" collection="type" />
534+ <include syntax="self" collection="record-definition" />
535+ <include syntax="self" collection="record-definition-field-name" />
462536 </subscopes>
463537 </scope>
464538 </collection>
465539
466540 <collection name="gadt-constructor">
467− <scope name="haskell.identifier.type.struct.data.constructor">
468− <symbol type="constructor">
469− <context behavior="subtree" foldable="true" />
470− </symbol>
541+ <scope name="identifier.type.struct.GADT.constructor">
542+ <expression>^\h+[A-Z](\w|')*</expression>
543+ </scope>
544+ </collection>
545+
546+ <collection name="data-definition">
547+ <scope name="haskell.definition.struct.data">
471548 <starts-with>
472− <expression>(^|=|\||^)\h+([A-Z](\w|')*)</expression>
473− <capture number="2" name="haskell.identifier.data.name" />
549+ <expression>^(\h*)(data|newtype)\h+(\w(\w|')*)</expression>
550+ <capture number="2" name="haskell.keyword.construct.data.newtype" />
551+ <capture number="3" name="haskell.identifier.type" />
474552 </starts-with>
475− <ends-with />
476− <subscopes anchored="true">
553+ <ends-with>
554+ <template>^(?!\s+\1\S)(?!\s*$)</template>
555+ </ends-with>
556+ <subscopes>
477557 <include syntax="self" collection="record-definition" />
558+ <include syntax="self" collection="data-constructor" />
559+ <include syntax="self" collection="type" />
478560 </subscopes>
479561 </scope>
480562 </collection>
481563
482− <collection name="deriving-clause">
483− <scope name="haskell.record.construct.deriving.keyword">
484− <expression>deriving(\h+(newtype|stock|anyclass))?</expression>
564+ <collection name="data-constructor">
565+ <scope name="haskell.identifier.type.struct.data.constructor">
566+ <expression>=\h+[A-Z](\w|')*</expression>
485567 </scope>
486− <scope name="haskell.record.construct.deriving.keyword">
487− <include syntax="self" collection="comments" />
488− <expression>via</expression>
568+ <scope name="haskell.identifier.type.struct.data.constructor">
569+ <expression>\|\h+[A-Z](\w|')*</expression>
489570 </scope>
490571 </collection>
491572
492573 <collection name="record-definition">
493574 <scope name="haskell.record">
494− <symbol>
495− <context behavior="subtree" foldable="true" />
496− </symbol>
497575 <starts-with>
498− <expression>(?=\{)</expression>
499− <capture number="0" name="haskell.record.bracket" />
576+ <expression>(\{)</expression>
577+ <capture number="1" name="haskell.record.bracket" />
500578 </starts-with>
501579 <ends-with>
502580 <expression>(\})</expression>
503581 <capture number="1" name="haskell.record.bracket" />
504582 </ends-with>
505583 <subscopes>
506− <include syntax="self" collection="comments" />
507584 <include syntax="self" collection="record-definition-field-name" />
508585 <include syntax="self" collection="type" />
509586 </subscopes>
@@ -512,65 +589,26 @@
512589
513590 <collection name="record-definition-field-name">
514591 <scope name="haskell.record.definition.property">
515− <symbol type="property" />
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" />
592+ <expression>\w(\w|')*\h*::</expression>
519593 </scope>
520594 </collection>
521595
522596 <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" />
530− <scope name="haskell.type.construct.tuple">
531− <starts-with>
532− <expression>\(</expression>
533− </starts-with>
534− <ends-with>
535− <expression>\)</expression>
536− </ends-with>
537− <subscopes>
538− <include syntax="self" collection="comments" />
539− <scope name="haskell.construct.type.typle.comma">
540− <expression>\,</expression>
541− </scope>
542− <include syntax="self" collection="type" />
543− </subscopes>
544− </scope>
545− <scope name="haskell.type.list">
546− <starts-with>
547− <expression>'?\[</expression>
548− </starts-with>
549− <ends-with>
550− <expression>\]</expression>
551− </ends-with>
552− <subscopes>
553− <include syntax="self" collection="comments" />
554− <include syntax="self" collection="type" />
555− </subscopes>
556− </scope>
557− <scope name="haskell.type.star">
558− <expression>\*</expression>
559− </scope>
560− <scope name="haskell.keyword.construct.type-annotation-operator">
561− <expression>::</expression>
562− </scope>
563597 <include syntax="self" collection="type-list" />
564− <scope>
565− <expression>(([A-Z](\w|')*\.)*)'*\!?([A-Z](\w|')*)</expression>
566− <capture number="1" name="haskell.identifier.package.module" />
567− <capture number="4" name="haskell.identifier.type" />
598+ <scope name="haskell.identifier.type">
599+ <expression>([A-Z](\w|')*\.)*[A-Z](\w|')*</expression>
568600 </scope>
569601 <scope name="haskell.keyword.construct.forall">
570602 <expression>forall</expression>
571603 </scope>
572604 <scope name="haskell.identifier.type.variable">
573− <expression>(?!where)(?!=)((?!(\(|\)|\,|\!))\S)((?!(\(|\)|\,))\w)*</expression>
605+ <expression>\w(\w|')*</expression>
606+ </scope>
607+ <scope name="haskell.keyword.construct.function-arrow">
608+ <expression>-></expression>
609+ </scope>
610+ <scope name="haskell.keyword.construct.fat-arrow">
611+ <expression>=></expression>
574612 </scope>
575613 </collection>
576614
@@ -585,7 +623,6 @@
585623 <template>^(?!\s+\1\S)(?!\s*$)</template>
586624 </ends-with>
587625 <subscopes>
588− <include syntax="self" collection="comments" />
589626 <scope name="haskell.keyword.construct.where">
590627 <expression>where</expression>
591628 </scope>
@@ -605,7 +642,6 @@
605642 <capture number="1" name="haskell.type-list.bracket" />
606643 </ends-with>
607644 <subscopes>
608− <include syntax="self" collection="comments" />
609645 <include syntax="self" collection="type" />
610646 </subscopes>
611647 </scope>
@@ -622,7 +658,6 @@
622658 <capture number="1" name="haskell.keyword.construct.lambda" />
623659 </ends-with>
624660 <subscopes>
625− <include syntax="self" collection="comments" />
626661 <include syntax="self" collection="pattern-match" />
627662 </subscopes>
628663 </scope>
@@ -636,6 +671,7 @@
636671
637672 <collection name="where-clause">
638673 <scope name="haskell.construct.where">
674+ <local scope="within-parent" />
639675 <starts-with>
640676 <expression>^(\h*)(where)</expression>
641677 <capture number="2" name="haskell.construct.keyword.where" />
@@ -644,7 +680,6 @@
644680 <template>^(?!\1\s*\S)(?!s*$)</template>
645681 </ends-with>
646682 <subscopes>
647− <include syntax="self" collection="comments" />
648683 <include syntax="self" collection="definition" />
649684 </subscopes>
650685 </scope>
@@ -653,9 +688,7 @@
653688
654689 <collection name="qvarid">
655690 <scope name="haskell.identifier.function">
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" />
691+ <expression>([A-Z](\w|')*\.)*\w(\w|')*</expression>
659692 </scope>
660693 </collection>
661694
@@ -684,12 +717,12 @@
684717
685718
686719 <collection name="strings">
687− <scope name="haskell.string.double-quoted" spell-check="true">
720+ <scope name="haskell.string.double-quoted">
688721 <starts-with>
689− <expression>"</expression>
722+ <expression>"</expression>
690723 </starts-with>
691724 <ends-with>
692− <expression>"</expression>
725+ <expression>"</expression>
693726 </ends-with>
694727 <subscopes>
695728 <scope name="haskell.string.escape-sequences">
@@ -726,7 +759,6 @@
726759 </ends-with>
727760 <subscopes>
728761 <scope name="identifier.haskell.type">
729− <symbol type="expression" />
730762 <symbol type="expression" />
731763 <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
732764 <capture number="1" name="identifier.type" />
@@ -751,7 +783,6 @@
751783 </ends-with>
752784 <subscopes>
753785 <scope name="haskell.construct.qualified">
754− <symbol type="expression" />
755786 <expression>qualified</expression>
756787 <capture number="0" name="haskell.construct.keyword.qualified" />
757788 </scope>
@@ -769,7 +800,6 @@
769800 </ends-with>
770801 <subscopes anchored="true">
771802 <include syntax="self" collection="import-list" />
772− <symbol type="expression" />
773803 </subscopes>
774804 </scope>
775805
@@ -803,7 +833,6 @@
803833 </ends-with>
804834 <subscopes>
805835 <scope name="haskell.identifier.struct">
806− <symbol type="expression" />
807836 <symbol type="reference" scope="local" />
808837 <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
809838 <capture number="1" name="haskell.import-list.identifier.type.name" />
@@ -817,6 +846,13 @@
817846 </scope>
818847 </collection>
819848
849+ <!-- <collection name="special">
850+ <scope>
851+ <expression>(;|,)</expression>
852+ </scope>
853+ </collection> -->
854+
855+
820856 <collection name="reservedop">
821857 <scope name="keyword.operator">
822858 <expression>(\.\.|:|::|=|\\|\||<-|->|@|~|=>)</expression>
@@ -824,11 +860,10 @@
824860 </collection>
825861
826862 <collection name="keywords">
827− <scope name="haskell.keyword.self">
863+ <scope name="haskell.keyword.modifier">
828864 <symbol type="keyword" />
829865 <strings>
830866 <string>do</string>
831− <string>mdo</string>
832867 <string>in</string>
833868 <string>infix</string>
834869 <string>infixl</string>
@@ -866,18 +901,20 @@
866901 <strings>
867902 <string>undefined</string>
868903 <string>_</string>
869− <string>@</string>
870904 </strings>
871905 </scope>
872906 </collection>
873907
874908 <collection name="comments">
875909 <scope name="haskell.comment.single" spell-check="true">
876− <symbol type="comment" />
877− <expression> --.*$</expression>
910+ <starts-with>
911+ <expression>--</expression>
912+ </starts-with>
913+ <ends-with>
914+ <expression>$</expression>
915+ </ends-with>
878916 </scope>
879917 <scope name="haskell.comment.block" spell-check="true">
880− <symbol type="comment" />
881918 <starts-with>
882919 <expression>{-</expression>
883920 </starts-with>
@@ -889,4 +926,4 @@
889926
890927
891928 </collections>
892−</syntax>
929+</syntax>