annotate runtime/syntax/slice.vim @ 9:6a13985590e6

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