on master help sign in
got case matches and do binds working
979cc86Ilya
Haskell Language Server.novaextension/Syntaxes/Haskell.xml+69−10
@@ -87,9 +87,8 @@
87 <include syntax="self" collection="lambda-case" />
87 <include syntax="self" collection="lambda-case" />
88 <include syntax="self" collection="lambda-head" />
88 <include syntax="self" collection="lambda-head" />
89 <include syntax="self" collection="type-applications" />
89 <include syntax="self" collection="type-applications" />
90− <include syntax="self" collection="case-expression" />
90+ <include syntax="self" collection="outer-case-expression" />
91 <include syntax="self" collection="qvarid" />
91 <include syntax="self" collection="qvarid" />
92− <include syntax="self" collection="bind-arrow" />
93 <include syntax="self" collection="tuple" />
92 <include syntax="self" collection="tuple" />
94
93
95
94
@@ -100,13 +99,13 @@
100
99
101 <collection name="pattern-match">
100 <collection name="pattern-match">
102 <include syntax="self" collection="literal" />
101 <include syntax="self" collection="literal" />
103− <include syntax="self" collection="view-pattern" />
104 <include syntax="self" collection="tuple-match" />
102 <include syntax="self" collection="tuple-match" />
105−<!-- <include syntax="self" collection="at-pattern" /> -->
103+ <!-- <include syntax="self" collection="at-pattern" /> -->
106 <include syntax="self" collection="varid" />
104 <include syntax="self" collection="varid" />
107 <include syntax="self" collection="qconid" />
105 <include syntax="self" collection="qconid" />
108 <include syntax="self" collection="record-match" />
106 <include syntax="self" collection="record-match" />
109 <include syntax="self" collection="list-pattern" />
107 <include syntax="self" collection="list-pattern" />
108+ <include syntax="self" collection="view-pattern" />
110 </collection>
109 </collection>
111
110
112 <collection name="type-applications">
111 <collection name="type-applications">
@@ -285,8 +284,50 @@
285 <expression>(of)</expression>
284 <expression>(of)</expression>
286 <capture number="1" name="haskell.case.keyword.condition" />
285 <capture number="1" name="haskell.case.keyword.condition" />
287 </ends-with>
286 </ends-with>
287+ <subscopes anchored="true">
288+ <include syntax="self" collection="pattern-match" />
289+ </subscopes>
290+ </scope>
291+ </collection>
292+
293+ <collection name="case-match">
294+ <scope name="case-match">
295+ <starts-with>
296+ <expression>(?=((\h*)\S.*-&gt;($|\h)))</expression>
297+ </starts-with>
298+ <ends-with>
299+ <expression>-&gt;</expression>
300+ </ends-with>
301+ <subscopes anchored="true">
302+ <include syntax="self" collection="pattern-match" />
303+ </subscopes>
304+ </scope>
305+ </collection>
306+
307+ <collection name="inner-case-expressions">
308+ <scope name="inner-case-expressions">
309+ <starts-with>
310+ <expression>(?=((\h*)\S.*-&gt;($|\h)))</expression>
311+ </starts-with>
312+ <ends-with>
313+ <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
314+ </ends-with>
288 <subscopes>
315 <subscopes>
289− <include syntax="self" collection="expressions" />
316+ <include syntax="self" collection="case-match" />
317+ <include syntax="self" collection="expressions"/>
318+ </subscopes>
319+ </scope>
320+ </collection>
321+
322+ <collection name="outer-case-expression">
323+ <scope name="outer-case-expression">
324+ <starts-with>
325+ <expression>(?=case)</expression>
326+ </starts-with>
327+ <ends-with />
328+ <subscopes anchored="true" skip-whitespace="false">
329+ <include syntax="self" collection="case-expression" />
330+ <include syntax="self" collection="inner-case-expressions" repeat="true" />
290 </subscopes>
331 </subscopes>
291 </scope>
332 </scope>
292 </collection>
333 </collection>
@@ -397,17 +438,35 @@
397 <collection name="do-bind">
438 <collection name="do-bind">
398 <scope name="do-bind">
439 <scope name="do-bind">
399 <starts-with>
440 <starts-with>
400− <expression>^(?=(\h*).+&lt;-($|\h))</expression>
441+ <expression>^(?=((\h*)\S.+&lt;-($|\h)))</expression>
401 </starts-with>
442 </starts-with>
402 <ends-with>
443 <ends-with>
403− <template>^(?!\0)(?!\s+\1\S)(?!\s*$)</template>
444+ <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
404 </ends-with>
445 </ends-with>
405− <subscopes anchored="true">
446+ <subscopes>
447+ <include syntax="self" collection="do-pattern" />
448+ <include syntax="self" collection="expressions" />
449+ <!-- <scope name="bind-arrow">
450+ <expression>&lt;-</expression>
451+ </scope> -->
452+ </subscopes>
453+ </scope>
454+ </collection>
455+
456+ <collection name="do-pattern">
457+ <scope name="do-pattern">
458+ <starts-with>
459+ <expression>^(?=((\h*)\S.+&lt;-($|\h)))</expression>
460+ </starts-with>
461+ <ends-with>
462+ <expression>&lt;-</expression>
463+ </ends-with>
464+ <subscopes>
406 <include syntax="self" collection="pattern-match" />
465 <include syntax="self" collection="pattern-match" />
407− <scope name="bind-arrow">
466+ <!-- <scope name="bind-arrow">
408 <expression>&lt;-</expression>
467 <expression>&lt;-</expression>
409 </scope>
468 </scope>
410− <include syntax="self" collection="expressions" repeat="true" />
469+ <include syntax="self" collection="expressions" repeat="true" /> -->
411 </subscopes>
470 </subscopes>
412 </scope>
471 </scope>
413 </collection>
472 </collection>