@@ -87,7 +87,6 @@ purescriptGrammar =
8787 ,
8888 include : ' #type_synonym_declaration'
8989 ,
90- # data and newtype
9190 include : ' #data_type_declaration'
9291 ,
9392 include : ' #typeclass_declaration'
@@ -115,6 +114,8 @@ purescriptGrammar =
115114 include : ' #data_ctor'
116115 ,
117116 include : ' #infix_op'
117+ ,
118+ include : ' #double_colon_inlined_signature'
118119 ,
119120 include : ' #constants_numeric_decimal'
120121 ,
@@ -136,8 +137,6 @@ purescriptGrammar =
136137 include : ' #double_colon_orphan'
137138 ,
138139 include : ' #comments'
139- ,
140- include : ' #double_colon_inlined_signature'
141140 ,
142141 name : ' keyword.other.arrow'
143142 match : / \< -| -\> /
@@ -550,8 +549,44 @@ purescriptGrammar =
550549 # ]
551550
552551 double_colon_inlined_signature :
552+ patterns : [
553+ patterns : [
554+ match : ' (SomeType)\s *({doubleColon})(.*)'
555+ captures :
556+ 1 : name : ' meta.type-signature'
557+ 2 : name : ' keyword.other.double-colon'
558+ 3 : {name : ' meta.type-signature' , patterns : [include : ' #type_signature' ]}
559+
560+ ]
561+ ,
562+ patterns : [
563+ match : ' ({doubleColon})(.*)(<-)'
564+ captures :
565+ 1 : name : ' keyword.other.double-colon'
566+ 2 : {name : ' meta.type-signature' , patterns : [ include : ' #type_signature' ]}
567+ 3 : name : ' keyword.other.double-colon'
568+
569+ ]
570+ ,
571+ patterns : [
572+ match : ' ({doubleColon})(.*)'
573+ captures :
574+ 1 : name : ' keyword.other.double-colon'
575+ 2 : {
576+ name : ' meta.type-signature'
577+ patterns : [
578+ include : " #record_types"
579+ include : ' #type_signature'
580+ ]
581+ }
582+
583+ ]
584+ ]
585+
586+ _double_colon_inlined_signature :
553587 patterns : [
554588 # Note recursive regex matching nested parens
589+ # match: '\\((?<paren>(?:[^()]|\\(\\g<paren>\\))*)(::|∷)(?<paren2>(?:[^()]|\\(\\g<paren2>\\))*)\\)'
555590 match : [
556591 # '\\(',
557592 # '(?<paren>(?:[^()]|\\(\\g<paren>\\))*)',
@@ -836,8 +871,10 @@ purescriptGrammar =
836871 ]
837872 type_signature :
838873 patterns : [
839- # include: '#row_types'
840- # ,
874+ include : " #record_types"
875+ ,
876+ include : ' #row_types'
877+ ,
841878 name : ' meta.class-constraints'
842879 match : concat / \( / ,
843880 list (' classConstraints' ,/ {classConstraint}/ ,/ ,/ ),
0 commit comments