Release coccinelle-0.1.6
[bpt/coccinelle.git] / editors / vim / syntax / cocci.vim
1 " Vim syntax file
2 " Language: Cocci (SmPL)
3 " Author: Alexander Færøy <ahf@0x90.dk>
4 " Copyright: Copyright (c) 2009 Alexander Færøy
5 " License: You may redistribute this under the same terms as Vim itself.
6
7 if &compatible || v:version < 603 || exists("b:current_syntax")
8 finish
9 endif
10
11 " Keywords
12 syn keyword CocciKeywords identifier type parameter constant expression contained
13 syn keyword CocciKeywords statement function local list fresh position idexpression contained
14
15 syn region CocciGroup matchgroup=CocciGroupDelim start="@[^@]*@" end="@@" contains=CocciKeywords
16
17 syn match CocciLineRemoved "^-.*"
18 syn match CocciLineAdded "^+.*"
19 syn match CocciComment "//.*"
20
21 syn case ignore
22 syn match CocciOperator "\.\.\."
23 syn match CocciOperator "when"
24 syn case match
25
26 " Errors
27 syn match CocciError "^[ \t][+-].*"
28
29 " Highlight!
30 hi def link CocciLineRemoved Special
31 hi def link CocciLineAdded Identifier
32 hi def link CocciError Error
33 hi def link CocciKeywords Keyword
34 hi def link CocciGroupDelim PreProc
35 hi def link CocciComment Comment
36 hi def link CocciOperator Operator
37
38 let b:current_syntax = "cocci"
39
40 " vim: set et ts=4 :