From 0d5371a13895c295d10e91b117c6ddaf3fc7d3cd Mon Sep 17 00:00:00 2001 From: MiracleBlue Date: Sun, 24 Sep 2017 23:09:28 +1000 Subject: [PATCH] Fixed nested record type definitions in data types, as well as record types in type aliases. Fixes #39 --- grammars/purescript.cson | 59 +++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/grammars/purescript.cson b/grammars/purescript.cson index eb76044..97953aa 100644 --- a/grammars/purescript.cson +++ b/grammars/purescript.cson @@ -205,24 +205,7 @@ 'name': 'punctuation.separator.pipe.purescript' } { - 'name': 'meta.declaratyion.type.data.record.block.purescript' - 'begin': '\\{' - 'beginCaptures': - '0': - 'name': 'keyword.operator.record.begin.purescript' - 'end': '\\}' - 'endCaptures': - '0': - 'name': 'keyword.operator.record.end.purescript' - 'patterns': [ - { - 'name': 'punctuation.separator.comma.purescript' - 'match': ',' - } - { - 'include': '#record_field_declaration' - } - ] + 'include': '#record_types' } ] } @@ -242,9 +225,6 @@ } ] 'patterns': [ - { - 'include': '#comments' - } { 'match': '=' 'captures': @@ -254,6 +234,12 @@ { 'include': '#type_signature' } + { + 'include': '#record_types' + } + { + 'include': '#comments' + } ] } { @@ -437,6 +423,32 @@ ] } ] + 'record_types': + 'patterns': [ + { + 'begin': '\\{' + 'beginCaptures': + '0': + 'name': 'keyword.operator.type.record.begin.purescript' + 'end': '\\}' + 'endCaptures': + '0': + 'name': 'keyword.operator.type.record.end.purescript' + 'name': 'meta.type.record.purescript' + 'patterns': [ + { + 'name': 'punctuation.separator.comma.purescript' + 'match': ',' + } + { + 'include': '#record_field_declaration' + } + { + 'include': '#comments' + } + ] + } + ] 'comments': 'patterns': [ { @@ -582,6 +594,9 @@ { 'include': '#type_signature' } + { + 'include': '#record_types' + } ] } ] @@ -709,4 +724,4 @@ } ] } - ] \ No newline at end of file + ]