From 14dc82fc4e6c0c08078f97a24a6c1639c1cc5113 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 14 Apr 2020 13:17:26 +0200 Subject: Update --- syntax/ecrystal.vim | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 syntax/ecrystal.vim (limited to 'syntax/ecrystal.vim') diff --git a/syntax/ecrystal.vim b/syntax/ecrystal.vim new file mode 100644 index 00000000..096990ff --- /dev/null +++ b/syntax/ecrystal.vim @@ -0,0 +1,37 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1 + +if &syntax !~# '\' || get(b:, 'current_syntax') =~# '\' + finish +endif + +if !exists('main_syntax') + let main_syntax = 'ecrystal' +endif + +call ecrystal#SetSubtype() + +if b:ecrystal_subtype !=# '' + exec 'runtime! syntax/'.b:ecrystal_subtype.'.vim' + unlet! b:current_syntax +endif + +syn include @crystalTop syntax/crystal.vim + +syn cluster ecrystalRegions contains=ecrystalControl,ecrystalRender,ecrystalComment + +syn region ecrystalControl matchgroup=ecrystalDelimiter start="<%%\@!-\=" end="-\=%>" display contains=@crystalTop containedin=ALLBUT,@ecrystalRegions +syn region ecrystalRender matchgroup=ecrystalDelimiter start="<%%\@!-\==" end="-\=%>" display contains=@crystalTop containedin=ALLBUT,@ecrystalRegions +syn region ecrystalComment matchgroup=ecrystalDelimiter start="<%%\@!-\=#" end="-\=%>" display contains=crystalTodo,@Spell containedin=ALLBUT,@ecrystalRegions + +" Define the default highlighting. + +hi def link ecrystalDelimiter PreProc +hi def link ecrystalComment crystalComment + +let b:current_syntax = 'ecrystal' + +if exists('main_syntax') && main_syntax ==# 'ecrystal' + unlet main_syntax +endif + +endif -- cgit v1.2.3