summaryrefslogblamecommitdiffstats
path: root/syntax/ecrystal.vim
blob: bfcb07d84279a090b8197721f7b1ae5bfb442855 (plain) (tree)
1
2
3
4
5
6
7


                                                                                                



                           




































                                                                                                                                                              
let s:base = expand("<sfile>:h:h")
let Filter = { _, v -> stridx(v, s:base) == -1 && stridx(v, $VIMRUNTIME) == -1 && v !~ "after" }
let files = filter(globpath(&rtp, 'syntax/ecrystal.vim', 1, 1), Filter)
if len(files) > 0
  exec 'source ' . files[0]
  finish
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1

if &syntax !~# '\<ecrystal\>' || get(b:, 'current_syntax') =~# '\<ecrystal\>'
  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