Install vim74
[msysgit.git] / share / vim / vim74 / syntax / slice.vim
blob4e2f9a8604018c50fcfc3f7d8ea392a07012e212
1 " Vim syntax file
2 " Language:     Slice (ZeroC's Specification Language for Ice)
3 " Maintainer:   Morel Bodin <slice06@nym.hush.com>
4 " Last Change:  2005 Dec 03
6 " For version 5.x: Clear all syntax items
7 " For version 6.x: Quit when a syntax file was already loaded
8 if version < 600
9   syntax clear
10 elseif exists("b:current_syntax")
11   finish
12 endif
14 " The Slice keywords
16 syn keyword sliceType       bool byte double float int long short string void
17 syn keyword sliceQualifier  const extends idempotent implements local nonmutating out throws
18 syn keyword sliceConstruct  class enum exception dictionary interface module LocalObject Object sequence struct
19 syn keyword sliceQualifier  const extends idempotent implements local nonmutating out throws
20 syn keyword sliceBoolean    false true
22 " Include directives
23 syn region  sliceIncluded    display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
24 syn match   sliceIncluded   display contained "<[^>]*>"
25 syn match   sliceInclude    display "^\s*#\s*include\>\s*["<]" contains=sliceIncluded
27 " Double-include guards
28 syn region  sliceGuard      start="^#\(define\|ifndef\|endif\)" end="$"
30 " Strings and characters
31 syn region sliceString          start=+"+  end=+"+
33 " Numbers (shamelessly ripped from c.vim, only slightly modified)
34 "integer number, or floating point number without a dot and with "f".
35 syn case ignore
36 syn match   sliceNumbers    display transparent "\<\d\|\.\d" contains=sliceNumber,sliceFloat,sliceOctal
37 syn match   sliceNumber     display contained "\d\+"
38 "hex number
39 syn match   sliceNumber     display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
40 " Flag the first zero of an octal number as something special
41 syn match   sliceOctal      display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=sliceOctalZero
42 syn match   sliceOctalZero  display contained "\<0"
43 syn match   sliceFloat      display contained "\d\+f"
44 "floating point number, with dot, optional exponent
45 syn match   sliceFloat      display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
46 "floating point number, starting with a dot, optional exponent
47 syn match   sliceFloat      display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
48 "floating point number, without dot, with exponent
49 syn match   sliceFloat      display contained "\d\+e[-+]\=\d\+[fl]\=\>"
50 " flag an octal number with wrong digits
51 syn case match
54 " Comments
55 syn region sliceComment    start="/\*"  end="\*/"
56 syn match sliceComment  "//.*"
58 syn sync ccomment sliceComment
60 " Define the default highlighting.
61 " For version 5.7 and earlier: only when not done already
62 " For version 5.8 and later: only when an item doesn't have highlighting yet
63 if version >= 508 || !exists("did_slice_syn_inits")
64   if version < 508
65     let did_slice_syn_inits = 1
66     command -nargs=+ HiLink hi link <args>
67   else
68     command -nargs=+ HiLink hi def link <args>
69   endif
71   HiLink sliceComment   Comment
72   HiLink sliceConstruct Keyword
73   HiLink sliceType      Type
74   HiLink sliceString    String
75   HiLink sliceIncluded  String
76   HiLink sliceQualifier Keyword
77   HiLink sliceInclude   Include
78   HiLink sliceGuard     PreProc
79   HiLink sliceBoolean   Boolean
80   HiLink sliceFloat     Number
81   HiLink sliceNumber    Number
82   HiLink sliceOctal     Number
83   HiLink sliceOctalZero Special
84   HiLink sliceNumberError Special
86   delcommand HiLink
87 endif
89 let b:current_syntax = "slice"
91 " vim: ts=8