@@ -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,8 +57,6 @@
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" />
6260 <include syntax="self" collection="GADT-definition" />
6361 <include syntax="self" collection="instance" />
6462 <include syntax="self" collection="typeclass" />
@@ -67,7 +65,6 @@
6765
6866 <template-scopes>
6967 <include syntax="self" collection="Quote" />
70− <include syntax="self" collection="comments" />
7168 </template-scopes>
7269
7370 <collections>
@@ -80,51 +77,27 @@
8077 </collection>
8178
8279 <collection name="expressions">
83− <include syntax="self" collection="do-bind" />
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" />
8490 <include syntax="self" collection="literal" />
8591 <include syntax="self" collection="operators" />
92+ <include syntax="self" collection="record-match" />
8693 <include syntax="self" collection="list" />
94+ <include syntax="self" collection="view-pattern" />
8795 <include syntax="self" collection="lambda-case" />
8896 <include syntax="self" collection="lambda-head" />
89− <include syntax="self" collection="type-applications" />
90− <include syntax="self" collection="outer-case-expression" />
97+ <include syntax="self" collection="case-expression" />
98+ <include syntax="self" collection="qconid" />
9199 <include syntax="self" collection="qvarid" />
92100 <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>
128101 </collection>
129102
130103 <collection name="Quote">
@@ -163,8 +136,8 @@
163136 <capture number="1" name="haskell.pattern.record.bracket" />
164137 </ends-with>
165138 <subscopes>
166− <include syntax="self" collection="pattern-match" />
167− <include syntax="self" collection="varid" />
139+ <include syntax="self" collection="comments" />
140+ <include syntax="self" collection="expressions" />
168141 <scope name="record-sep">
169142 <expression>=</expression>
170143 </scope>
@@ -186,6 +159,7 @@
186159 <capture number="1" name="haskell.pattern.record.bracket" />
187160 </ends-with>
188161 <subscopes>
162+ <include syntax="self" collection="comments" />
189163 <scope name="haskell.pattern.record.wildcard">
190164 <expression>\.\.</expression>
191165 </scope>
@@ -212,29 +186,12 @@
212186 <capture number="1" name="haskell.list.bracket" />
213187 </ends-with>
214188 <subscopes>
189+ <include syntax="self" collection="comments" />
215190 <include syntax="self" collection="expressions" />
216191 </subscopes>
217192 </scope>
218193 </collection>
219194
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−
238195 <collection name="view-pattern">
239196 <scope name="haskell.pattern.view">
240197 <symbol type="expression" />
@@ -251,24 +208,7 @@
251208 <scope name="haskell.pattern.view.operator.arrow">
252209 <expression>-></expression>
253210 </scope>
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" />
211+ <include syntax="self" collection="expressions" />
272212 </subscopes>
273213 </scope>
274214 </collection>
@@ -284,53 +224,11 @@
284224 <capture number="1" name="haskell.case.keyword.condition" />
285225 </ends-with>
286226 <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" />
316227 <include syntax="self" collection="expressions" />
317228 </subscopes>
318229 </scope>
319230 </collection>
320231
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−
334232 <collection name="tuple">
335233 <symbol type="expression" />
336234 <scope name="haskell.tuple">
@@ -343,136 +241,144 @@
343241 <capture number="1" name="haskell.tuple.bracket" />
344242 </ends-with>
345243 <subscopes>
244+ <include syntax="self" collection="comments" />
346245 <include syntax="self" collection="expressions" />
347246 </subscopes>
348247 </scope>
349248 </collection>
350249
351250 <collection name="typeclass">
352− <symbol type="interface" />
353− <scope name="haskell.definition.class">
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>
354255 <starts-with>
355256 <expression>^(\h*)(class)($|\h)</expression>
356257 <capture number="2" name="haskell.keyword.construct.class" />
357258 </starts-with>
358− <ends-with>
359− <template>^(?!\s+\1\S)(?!\s*$)</template>
360− </ends-with>
361− <subscopes>
362− <scope name="haskell.keyword.construct.where">
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">
363274 <expression>where</expression>
364275 </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" />
369276 </subscopes>
370277 </scope>
371278 </collection>
372279
373280 <collection name="instance">
374281 <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" />
284+ </symbol>
376285 <starts-with>
377286 <expression>^(\h*)(instance)($|\h)</expression>
378287 <capture number="2" name="haskell.keyword.construct.instance" />
379288 </starts-with>
380− <ends-with>
381− <template>^(?!\s+\1\S)(?!\s*$)</template>
382− </ends-with>
383− <subscopes>
384− <scope name="haskell.keyword.construct.where">
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">
385303 <expression>where</expression>
386304 </scope>
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" />
391305 </subscopes>
392306 </scope>
393307 </collection>
394308
395309 <collection name="type-family-definition">
396− <scope name="haskell.definition.type.type-family">
397− <symbol type="type" />
310+ <scope name="haskell.definition.type-family.type">
398311 <starts-with>
399− <expression>^(\h*)(type\h+family)\h+`?(\w(\w|')*)`?($|\h)</expression>
312+ <expression>^(\h*)(type\h+family)</expression>
400313 <capture number="2" name="haskell.keyword.construct.type-family" />
401314 </starts-with>
402315 <ends-with>
403316 <template>^(?!\s+\1\S)(?!\s*$)</template>
404317 </ends-with>
405− <subscopes>
406− <scope name="haskell.keyword.construct.where">
407− <expression>where</expression>
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>
408333 </scope>
409− <include syntax="self" collection="type" />
410− </subscopes>
411− </scope>
412− </collection>
413−
414− <collection name="definition">
415− <scope name="haskell.definition.type.function">
416− <symbol type="function">
417− <display-name>
418− <component selector="haskell.definition.type.function" />
419− </display-name>
420334
421− </symbol>
422− <starts-with>
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" />
426− </starts-with>
427− <ends-with>
428− <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
429− </ends-with>
430− <subscopes>
431− <include syntax="self" collection="type-annotation" />
432− <include syntax="self" collection="implementation" />
335+ <include syntax="self" collection="type-family-case-definition" optional="true" repeat="true" />
433336 </subscopes>
434337 </scope>
435338 </collection>
436339
437− <collection name="do-bind">
438− <scope name="do-bind">
340+ <collection name="type-family-case-definition">
341+ <scope name="haskell.definition.type-family.type.case">
439342 <starts-with>
440− <expression>^(?=((\h*)\S.+<-($|\h)))</expression>
343+ <expression>^(\h*)(?=\S)</expression>
441344 </starts-with>
442345 <ends-with>
443− <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
346+ <template>^(?!\s+\1\S)(?!\s*$)</template>
444347 </ends-with>
445348 <subscopes>
446− <include syntax="self" collection="do-pattern" />
447− <include syntax="self" collection="expressions" />
448− <!-- <scope name="bind-arrow">
449− <expression><-</expression>
450− </scope> -->
349+ <include syntax="self" collection="comments" />
350+ <include syntax="self" collection="type" optional="true" repeat="true" />
351+ <scope>
352+ <expression>=</expression>
353+ </scope>
354+ <include syntax="self" collection="type" optional="true" repeat="true" />
451355 </subscopes>
452356 </scope>
453357 </collection>
454358
455− <collection name="do-pattern">
456− <scope name="do-pattern">
359+ <collection name="definition">
360+ <scope name="haskell.definition.type.function">
361+ <symbol type="function">
362+ <context behavior="whitespace" foldable="true" />
363+ </symbol>
457364 <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" />
459368 </starts-with>
460369 <ends-with>
461− <expression><-</expression>
370+ <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
462371 </ends-with>
463372 <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" /> -->
373+ <include syntax="self" collection="comments" />
374+ <include syntax="self" collection="type-annotation" />
375+ <include syntax="self" collection="implementation" />
469376 </subscopes>
470377 </scope>
471378 </collection>
472379
473380 <collection name="implementation">
474− <scope name="haskell.definition.type.function">
475− <local scope="within-construct" />
381+ <scope name="haskell.definition.type.function.implementation">
476382 <starts-with>
477383 <expression>^(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h)</expression>
478384 <capture number="2" name="haskell.keyword.construct.default" />
@@ -482,14 +388,20 @@
482388 <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
483389 </ends-with>
484390 <subscopes>
485− <include syntax="self" collection="where-clause" />
486− <include syntax="self" collection="expressions" />
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" />
487399 </subscopes>
488400 </scope>
489401 </collection>
490402
491403 <collection name="type-annotation">
492− <scope name="haskell.definition.type.function">
404+ <scope name="haskell.definition.type.function.type-signature">
493405 <starts-with>
494406 <expression>^(\h*)`?(\w(\w|')*)`?\h*::($|\h)</expression>
495407 <capture number="2" name="haskell.identifier.function" />
@@ -498,6 +410,7 @@
498410 <template>^(?!\s+\1\S)(?!\s*$)</template>
499411 </ends-with>
500412 <subscopes>
413+ <include syntax="self" collection="comments" />
501414 <include syntax="self" collection="type" />
502415 </subscopes>
503416 </scope>
@@ -505,15 +418,19 @@
505418
506419 <collection name="type-definition">
507420 <scope name="haskell.definition.type">
421+ <symbol type="type" scope="global">
422+ <context behavior="whitespace" foldable="true" />
423+ </symbol>
508424 <starts-with>
509425 <expression>^(\h*)(type)\h+(\w(\w|')*)</expression>
510426 <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" />
512428 </starts-with>
513429 <ends-with>
514430 <template>^(?!\s+\1\S)(?!\s*$)</template>
515431 </ends-with>
516432 <subscopes>
433+ <include syntax="self" collection="comments" />
517434 <include syntax="self" collection="type" />
518435 </subscopes>
519436 </scope>
@@ -521,66 +438,72 @@
521438
522439 <collection name="GADT-definition">
523440 <scope name="haskell.definition.struct.GADT">
441+ <symbol type="struct" scope="global">
442+ <context behavior="subtree" foldable="false" />
443+ </symbol>
524444 <starts-with>
525− <expression>^(\h*)(data)\h+(\w(\w|')*)</expression>
445+ <expression>^(\h*)(data|newtype)\h+(\w(\w|')*)</expression>
526446 <capture number="2" name="haskell.keyword.construct.data.GADT" />
447+ <capture number="3" name="haskell.identifier.data.type.name" />
527448 </starts-with>
528449 <ends-with>
529450 <template>^(?!\s+\1\S)(?!\s*$)</template>
530451 </ends-with>
531452 <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" />
532460 <include syntax="self" collection="gadt-constructor" />
533461 <include syntax="self" collection="type" />
534− <include syntax="self" collection="record-definition" />
535− <include syntax="self" collection="record-definition-field-name" />
536462 </subscopes>
537463 </scope>
538464 </collection>
539465
540466 <collection name="gadt-constructor">
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">
467+ <scope name="haskell.identifier.type.struct.data.constructor">
468+ <symbol type="constructor">
469+ <context behavior="subtree" foldable="true" />
470+ </symbol>
548471 <starts-with>
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" />
472+ <expression>(^|=|\||^)\h+([A-Z](\w|')*)</expression>
473+ <capture number="2" name="haskell.identifier.data.name" />
552474 </starts-with>
553− <ends-with>
554− <template>^(?!\s+\1\S)(?!\s*$)</template>
555− </ends-with>
556− <subscopes>
475+ <ends-with />
476+ <subscopes anchored="true">
557477 <include syntax="self" collection="record-definition" />
558− <include syntax="self" collection="data-constructor" />
559− <include syntax="self" collection="type" />
560478 </subscopes>
561479 </scope>
562480 </collection>
563481
564− <collection name="data-constructor">
565− <scope name="haskell.identifier.type.struct.data.constructor">
566− <expression>=\h+[A-Z](\w|')*</expression>
482+ <collection name="deriving-clause">
483+ <scope name="haskell.record.construct.deriving.keyword">
484+ <expression>deriving(\h+(newtype|stock|anyclass))?</expression>
567485 </scope>
568− <scope name="haskell.identifier.type.struct.data.constructor">
569− <expression>\|\h+[A-Z](\w|')*</expression>
486+ <scope name="haskell.record.construct.deriving.keyword">
487+ <include syntax="self" collection="comments" />
488+ <expression>via</expression>
570489 </scope>
571490 </collection>
572491
573492 <collection name="record-definition">
574493 <scope name="haskell.record">
494+ <symbol>
495+ <context behavior="subtree" foldable="true" />
496+ </symbol>
575497 <starts-with>
576− <expression>(\{)</expression>
577− <capture number="1" name="haskell.record.bracket" />
498+ <expression>(?=\{)</expression>
499+ <capture number="0" name="haskell.record.bracket" />
578500 </starts-with>
579501 <ends-with>
580502 <expression>(\})</expression>
581503 <capture number="1" name="haskell.record.bracket" />
582504 </ends-with>
583505 <subscopes>
506+ <include syntax="self" collection="comments" />
584507 <include syntax="self" collection="record-definition-field-name" />
585508 <include syntax="self" collection="type" />
586509 </subscopes>
@@ -589,26 +512,65 @@
589512
590513 <collection name="record-definition-field-name">
591514 <scope name="haskell.record.definition.property">
592− <expression>\w(\w|')*\h*::</expression>
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" />
593519 </scope>
594520 </collection>
595521
596522 <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>
597563 <include syntax="self" collection="type-list" />
598− <scope name="haskell.identifier.type">
599− <expression>([A-Z](\w|')*\.)*[A-Z](\w|')*</expression>
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" />
600568 </scope>
601569 <scope name="haskell.keyword.construct.forall">
602570 <expression>forall</expression>
603571 </scope>
604572 <scope name="haskell.identifier.type.variable">
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>
573+ <expression>(?!where)(?!=)((?!(\(|\)|\,|\!))\S)((?!(\(|\)|\,))\w)*</expression>
612574 </scope>
613575 </collection>
614576
@@ -623,6 +585,7 @@
623585 <template>^(?!\s+\1\S)(?!\s*$)</template>
624586 </ends-with>
625587 <subscopes>
588+ <include syntax="self" collection="comments" />
626589 <scope name="haskell.keyword.construct.where">
627590 <expression>where</expression>
628591 </scope>
@@ -642,6 +605,7 @@
642605 <capture number="1" name="haskell.type-list.bracket" />
643606 </ends-with>
644607 <subscopes>
608+ <include syntax="self" collection="comments" />
645609 <include syntax="self" collection="type" />
646610 </subscopes>
647611 </scope>
@@ -658,6 +622,7 @@
658622 <capture number="1" name="haskell.keyword.construct.lambda" />
659623 </ends-with>
660624 <subscopes>
625+ <include syntax="self" collection="comments" />
661626 <include syntax="self" collection="pattern-match" />
662627 </subscopes>
663628 </scope>
@@ -671,7 +636,6 @@
671636
672637 <collection name="where-clause">
673638 <scope name="haskell.construct.where">
674− <local scope="within-parent" />
675639 <starts-with>
676640 <expression>^(\h*)(where)</expression>
677641 <capture number="2" name="haskell.construct.keyword.where" />
@@ -680,6 +644,7 @@
680644 <template>^(?!\1\s*\S)(?!s*$)</template>
681645 </ends-with>
682646 <subscopes>
647+ <include syntax="self" collection="comments" />
683648 <include syntax="self" collection="definition" />
684649 </subscopes>
685650 </scope>
@@ -688,7 +653,9 @@
688653
689654 <collection name="qvarid">
690655 <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" />
692659 </scope>
693660 </collection>
694661
@@ -717,12 +684,12 @@
717684
718685
719686 <collection name="strings">
720− <scope name="haskell.string.double-quoted">
687+ <scope name="haskell.string.double-quoted" spell-check="true">
721688 <starts-with>
722− <expression>"</expression>
689+ <expression>"</expression>
723690 </starts-with>
724691 <ends-with>
725− <expression>"</expression>
692+ <expression>"</expression>
726693 </ends-with>
727694 <subscopes>
728695 <scope name="haskell.string.escape-sequences">
@@ -759,6 +726,7 @@
759726 </ends-with>
760727 <subscopes>
761728 <scope name="identifier.haskell.type">
729+ <symbol type="expression" />
762730 <symbol type="expression" />
763731 <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
764732 <capture number="1" name="identifier.type" />
@@ -783,6 +751,7 @@
783751 </ends-with>
784752 <subscopes>
785753 <scope name="haskell.construct.qualified">
754+ <symbol type="expression" />
786755 <expression>qualified</expression>
787756 <capture number="0" name="haskell.construct.keyword.qualified" />
788757 </scope>
@@ -800,6 +769,7 @@
800769 </ends-with>
801770 <subscopes anchored="true">
802771 <include syntax="self" collection="import-list" />
772+ <symbol type="expression" />
803773 </subscopes>
804774 </scope>
805775
@@ -833,6 +803,7 @@
833803 </ends-with>
834804 <subscopes>
835805 <scope name="haskell.identifier.struct">
806+ <symbol type="expression" />
836807 <symbol type="reference" scope="local" />
837808 <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
838809 <capture number="1" name="haskell.import-list.identifier.type.name" />
@@ -846,13 +817,6 @@
846817 </scope>
847818 </collection>
848819
849− <!-- <collection name="special">
850− <scope>
851− <expression>(;|,)</expression>
852− </scope>
853− </collection> -->
854−
855−
856820 <collection name="reservedop">
857821 <scope name="keyword.operator">
858822 <expression>(\.\.|:|::|=|\\|\||<-|->|@|~|=>)</expression>
@@ -860,10 +824,11 @@
860824 </collection>
861825
862826 <collection name="keywords">
863− <scope name="haskell.keyword.modifier">
827+ <scope name="haskell.keyword.self">
864828 <symbol type="keyword" />
865829 <strings>
866830 <string>do</string>
831+ <string>mdo</string>
867832 <string>in</string>
868833 <string>infix</string>
869834 <string>infixl</string>
@@ -901,20 +866,18 @@
901866 <strings>
902867 <string>undefined</string>
903868 <string>_</string>
869+ <string>@</string>
904870 </strings>
905871 </scope>
906872 </collection>
907873
908874 <collection name="comments">
909875 <scope name="haskell.comment.single" spell-check="true">
910− <starts-with>
911− <expression>--</expression>
912− </starts-with>
913− <ends-with>
914− <expression>$</expression>
915− </ends-with>
876+ <symbol type="comment" />
877+ <expression> --.*$</expression>
916878 </scope>
917879 <scope name="haskell.comment.block" spell-check="true">
880+ <symbol type="comment" />
918881 <starts-with>
919882 <expression>{-</expression>
920883 </starts-with>
@@ -926,4 +889,4 @@
926889
927890
928891 </collections>
929−</syntax>
892+</syntax>