comparison vendor/vim-syntax/blade.vim @ 589:7fbadf8bd22e

Update vendor Change whatever available from official vim
author nanaya <me@myconan.net>
date Thu, 07 Jul 2016 15:59:06 +0900
parents a056f6920d8e
children 0e72765944d4
comparison
equal deleted inserted replaced
588:152c020d7d8e 589:7fbadf8bd22e
1 " Language: Blade 1 " Vim syntax file
2 " Language: Blade (Laravel)
2 " Maintainer: Jason Walton <jwalton512@gmail.com> 3 " Maintainer: Jason Walton <jwalton512@gmail.com>
3 " URL: https://github.com/xsbeats/vim-blade 4 " Filenames: *.blade.php
4 " License: DBAD
5 5
6 " Check if our syntax is already loaded 6 if exists('b:current_syntax')
7 if exists('b:current_syntax') && b:current_syntax == 'blade'
8 finish 7 finish
9 endif 8 endif
10 9
11 " Include PHP 10 if !exists("main_syntax")
11 let main_syntax = 'blade'
12 endif
13
14 runtime! syntax/html.vim
15 unlet! b:current_syntax
12 runtime! syntax/php.vim 16 runtime! syntax/php.vim
13 silent! unlet b:current_syntax 17 unlet! b:current_syntax
14 18
15 " Echos 19 syn case match
16 syn region bladeUnescapedEcho matchgroup=bladeEchoDelim start=/@\@<!\s*{!!/ end=/!!}\s*/ contains=@phpClTop containedin=ALLBUT,bladeComment 20 syn clear htmlError
17 syn region bladeEscapedEcho matchgroup=bladeEchoDelim start=/@\@<!\s*{{{\@!/ end=/}}\s*/ contains=@phpClTop containedin=ALLBUT,bladeComment
18 syn region bladeEscapedEcho matchgroup=bladeEchoDelim start=/@\@<!\s*{{{{\@!/ end=/}}}/ contains=@phpClTop containedin=ALLBUT,bladeComment
19 21
20 " Structures 22 if has('patch-7.4.1142')
21 syn match bladeStructure /\s*@\(else\|empty\|endfor\|endforeach\|endforelse\|endif\|endpush\|endsection\|endunless\|endwhile\|overwrite\|show\|stop\)\>/ 23 syn iskeyword @,48-57,_,192-255,@-@
22 syn match bladeStructure /\s*@\(append\|choice\|each\|elseif\|extends\|for\|foreach\|forelse\|if\|include\|lang\|push\|section\|stack\|unless\|while\|yield\|\)\>\s*/ nextgroup=bladeParens 24 else
23 syn region bladeParens matchgroup=bladeParen start=/(/ end=/)/ contained contains=@bladeAll,@phpClTop 25 setlocal iskeyword+=@-@
26 endif
24 27
25 " Comments 28 syn region bladeEcho matchgroup=bladeDelimiter start="@\@<!{{" end="}}" contains=@bladePhp,bladePhpParenBlock containedin=ALLBUT,@bladeExempt keepend
26 syn region bladeComments start=/\s*{{--/ end=/--}}/ contains=bladeComment keepend 29 syn region bladeEcho matchgroup=bladeDelimiter start="{!!" end="!!}" contains=@bladePhp,bladePhpParenBlock containedin=ALLBUT,@bladeExempt keepend
27 syn match bladeComment /.*/ contained containedin=bladeComments 30 syn region bladeComment matchgroup=bladeDelimiter start="{{--" end="--}}" contains=bladeTodo containedin=ALLBUT,@bladeExempt keepend
28 31
29 " Clusters 32 syn keyword bladeKeyword @if @elseif @foreach @forelse @for @while @can @include @each @inject @extends @section @stack @push @unless @yield @parent @hasSection nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt
30 syn cluster bladeAll contains=bladeStructure,bladeParens 33 syn keyword bladeKeyword @else @endif @endunless @endfor @endforeach @empty @endforelse @endwhile @endcan @stop @append @endsection @endpush @show containedin=ALLBUT,@bladeExempt
31 34
32 " Highlighting 35 syn region bladePhpParenBlock matchgroup=bladeDelimiter start="\s*(" end=")" contains=@bladePhp,bladePhpParenBlock skipwhite contained
36
37 syn cluster bladePhp contains=@phpClTop
38 syn cluster bladeExempt contains=bladeComment,@htmlTop
39
40 syn cluster htmlPreproc add=bladeEcho,bladeComment
41
42 syn keyword bladeTodo todo fixme xxx contained
43
44 hi def link bladeDelimiter PreProc
33 hi def link bladeComment Comment 45 hi def link bladeComment Comment
34 hi def link bladeEchoDelim Delimiter 46 hi def link bladeTodo Todo
35 hi def link bladeParen Delimiter 47 hi def link bladeKeyword Statement
36 hi def link bladeStructure Keyword
37 48
49 let b:current_syntax = 'blade'
38 50
39 if !exists('b:current_syntax') 51 if exists('main_syntax') && main_syntax == 'blade'
40 let b:current_syntax = 'blade' 52 unlet main_syntax
41 endif 53 endif