source: issm/oecreview/Archive/12678-13393/ISSM-12956-12957.diff@ 13394

Last change on this file since 13394 was 13394, checked in by Mathieu Morlighem, 13 years ago

Added 12678-13393

File size: 13.7 KB
RevLine 
[13394]1Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim
2===================================================================
3--- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim (revision 12956)
4+++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim (revision 12957)
5@@ -1027,3 +1027,284 @@
6 syn keyword cConstant PatersonEnum
7 syn keyword cConstant ArrheniusEnum
8 "ISSM's Enums end
9+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
10+
11+if !exists("c_no_ansi") || exists("c_ansi_typedefs")
12+ syn keyword cType size_t ssize_t wchar_t ptrdiff_t sig_atomic_t fpos_t
13+ syn keyword cType clock_t time_t va_list jmp_buf FILE DIR div_t ldiv_t
14+ syn keyword cType mbstate_t wctrans_t wint_t wctype_t
15+ syn keyword cType lldiv_t float_t double_t fenv_t fexcept_t
16+endif
17+if !exists("c_no_c99") " ISO C99
18+ syn keyword cType bool complex imaginary
19+ syn keyword cType int8_t int16_t int32_t int64_t
20+ syn keyword cType uint8_t uint16_t uint32_t uint64_t
21+ syn keyword cType int_least8_t int_least16_t int_least32_t int_least64_t
22+ syn keyword cType uint_least8_t uint_least16_t uint_least32_t uint_least64_t
23+ syn keyword cType int_fast8_t int_fast16_t int_fast32_t int_fast64_t
24+ syn keyword cType uint_fast8_t uint_fast16_t uint_fast32_t uint_fast64_t
25+ syn keyword cType intptr_t uintptr_t
26+ syn keyword cType intmax_t uintmax_t
27+endif
28+if exists("c_gnu")
29+ syn keyword cType __label__ __complex__ __volatile__
30+endif
31+
32+syn keyword cStructure struct union enum typedef
33+syn keyword cStorageClass static register auto volatile extern const VOL
34+if exists("c_gnu")
35+ syn keyword cStorageClass inline __attribute__
36+endif
37+if !exists("c_no_c99")
38+ syn keyword cStorageClass inline restrict
39+endif
40+
41+if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
42+ if exists("c_gnu")
43+ syn keyword cConstant __GNUC__ __FUNCTION__ __PRETTY_FUNCTION__
44+ endif
45+ syn keyword cConstant __LINE__ __FILE__ __DATE__ __TIME__ __STDC__ __func__
46+ syn keyword cConstant __STDC_VERSION__
47+ syn keyword cConstant CHAR_BIT MB_LEN_MAX MB_CUR_MAX
48+ syn keyword cConstant UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX
49+ syn keyword cConstant CHAR_MIN INT_MIN LONG_MIN SHRT_MIN
50+ syn keyword cConstant CHAR_MAX INT_MAX LONG_MAX SHRT_MAX
51+ syn keyword cConstant SCHAR_MIN SINT_MIN SLONG_MIN SSHRT_MIN
52+ syn keyword cConstant SCHAR_MAX SINT_MAX SLONG_MAX SSHRT_MAX
53+ if !exists("c_no_c99")
54+ syn keyword cConstant LLONG_MIN LLONG_MAX ULLONG_MAX
55+ syn keyword cConstant INT8_MIN INT16_MIN INT32_MIN INT64_MIN
56+ syn keyword cConstant INT8_MAX INT16_MAX INT32_MAX INT64_MAX
57+ syn keyword cConstant UINT8_MAX UINT16_MAX UINT32_MAX UINT64_MAX
58+ syn keyword cConstant INT_LEAST8_MIN INT_LEAST16_MIN INT_LEAST32_MIN INT_LEAST64_MIN
59+ syn keyword cConstant INT_LEAST8_MAX INT_LEAST16_MAX INT_LEAST32_MAX INT_LEAST64_MAX
60+ syn keyword cConstant UINT_LEAST8_MAX UINT_LEAST16_MAX UINT_LEAST32_MAX UINT_LEAST64_MAX
61+ syn keyword cConstant INT_FAST8_MIN INT_FAST16_MIN INT_FAST32_MIN INT_FAST64_MIN
62+ syn keyword cConstant INT_FAST8_MAX INT_FAST16_MAX INT_FAST32_MAX INT_FAST64_MAX
63+ syn keyword cConstant UINT_FAST8_MAX UINT_FAST16_MAX UINT_FAST32_MAX UINT_FAST64_MAX
64+ syn keyword cConstant INTPTR_MIN INTPTR_MAX UINTPTR_MAX
65+ syn keyword cConstant INTMAX_MIN INTMAX_MAX UINTMAX_MAX
66+ syn keyword cConstant PTRDIFF_MIN PTRDIFF_MAX SIG_ATOMIC_MIN SIG_ATOMIC_MAX
67+ syn keyword cConstant SIZE_MAX WCHAR_MIN WCHAR_MAX WINT_MIN WINT_MAX
68+ endif
69+ syn keyword cConstant FLT_RADIX FLT_ROUNDS
70+ syn keyword cConstant FLT_DIG FLT_MANT_DIG FLT_EPSILON
71+ syn keyword cConstant DBL_DIG DBL_MANT_DIG DBL_EPSILON
72+ syn keyword cConstant LDBL_DIG LDBL_MANT_DIG LDBL_EPSILON
73+ syn keyword cConstant FLT_MIN FLT_MAX FLT_MIN_EXP FLT_MAX_EXP
74+ syn keyword cConstant FLT_MIN_10_EXP FLT_MAX_10_EXP
75+ syn keyword cConstant DBL_MIN DBL_MAX DBL_MIN_EXP DBL_MAX_EXP
76+ syn keyword cConstant DBL_MIN_10_EXP DBL_MAX_10_EXP
77+ syn keyword cConstant LDBL_MIN LDBL_MAX LDBL_MIN_EXP LDBL_MAX_EXP
78+ syn keyword cConstant LDBL_MIN_10_EXP LDBL_MAX_10_EXP
79+ syn keyword cConstant HUGE_VAL CLOCKS_PER_SEC NULL _NO_LEAP_SECONDS _LOCALTIME
80+ syn keyword cConstant LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY
81+ syn keyword cConstant LC_NUMERIC LC_TIME
82+ " syn keyword cConstant SIG_DFL SIG_ERR SIG_IGN
83+ syn keyword cAnsiFuncPtr SIG_DFL SIG_ERR SIG_IGN
84+ syn keyword cConstant SIGABRT SIGFPE SIGILL SIGHUP SIGINT SIGSEGV SIGTERM
85+ syn keyword cConstant INFINITY FP_SUBNORMAL FP_ILOGB0
86+ syn keyword cConstant NAN FP_ZERO FP_ILOGBNAN
87+ syn keyword cConstant FP_INFINITE FP_FAST_FMA
88+ syn keyword cConstant HUGE_VALF FP_NAN FP_FAST_FMAF
89+ syn keyword cConstant HUGE_VALL FP_NORMAL FP_FAST_FMAL
90+ syn keyword cConstant FE_OVERFLOW FE_TOWARDZERO
91+ syn keyword cConstant FE_UNDERFLOW FE_UPWARD
92+ syn keyword cConstant FE_DIVBYZERO FE_ALL_EXCEPT FE_DFL_ENV
93+ syn keyword cConstant FE_INEXACT FE_DOWNWARD
94+ syn keyword cConstant FE_INVALID FE_TONEAREST
95+ syn keyword cConstant _Complex_I _Imaginary_I
96+ " Add POSIX signals as well...
97+ syn keyword cConstant SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP
98+ syn keyword cConstant SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV
99+ syn keyword cConstant SIGSTOP SIGTERM SIGTRAP SIGTSTP SIGTTIN SIGTTOU
100+ syn keyword cConstant SIGUSR1 SIGUSR2
101+ syn keyword cConstant _IOFBF _IOLBF _IONBF BUFSIZ EOF WEOF
102+ syn keyword cConstant FOPEN_MAX FILENAME_MAX L_tmpnam
103+ syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET
104+ syn keyword cConstant TMP_MAX stderr stdin stdout
105+ syn keyword cConstant EXIT_FAILURE EXIT_SUCCESS RAND_MAX
106+ " Add POSIX errors as well
107+ syn keyword cConstant E2BIG EACCES EAGAIN EBADF EBADMSG EBUSY
108+ syn keyword cConstant ECANCELED ECHILD EDEADLK EDOM EEXIST EFAULT
109+ syn keyword cConstant EFBIG EILSEQ EINPROGRESS EINTR EINVAL EIO EISDIR
110+ syn keyword cConstant EMFILE EMLINK EMSGSIZE ENAMETOOLONG ENFILE ENODEV
111+ syn keyword cConstant ENOENT ENOEXEC ENOLCK ENOMEM ENOSPC ENOSYS
112+ syn keyword cConstant ENOTDIR ENOTEMPTY ENOTSUP ENOTTY ENXIO EPERM
113+ syn keyword cConstant EPIPE ERANGE EROFS ESPIPE ESRCH ETIMEDOUT EXDEV
114+ " math.h
115+ syn keyword cConstant M_E M_LOG2E M_LOG10E M_LN2 M_LN10 M_PI M_PI_2 M_PI_4
116+ syn keyword cConstant M_1_PI M_2_PI M_2_SQRTPI M_SQRT2 M_SQRT1_2
117+endif
118+if !exists("c_no_c99") " ISO C99
119+ syn keyword cConstant true false __bool_true_false_are_defined
120+endif
121+
122+" Accept %: for # (C99)
123+syn region cPreCondit start="^\s*\(%:\|#\)\s*\(ifdef\|ifndef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=cComment,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
124+syn keyword cDefined defined contained
125+"syn match cDefined display contained "\<defined(\w\+)" contains=cName,cAnsiName
126+syn region cPreConditIf start="^\s*\(%:\|#\)\s*\(if\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=cDefined,cComment,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
127+syn match cPreCondit display "^\s*\(%:\|#\)\s*\(else\|endif\)\>"
128+if !exists("c_no_if0")
129+ syn region cCppOut start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=cCppOut2
130+ syn region cCppOut2 contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cSpaceError,cCppSkip
131+ syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip
132+ endif
133+ syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
134+ syn match cIncluded display contained "<[^>]*>"
135+ syn match cInclude display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded
136+ syn match cLineSkip "\\$"
137+ syn cluster cPreProcGroup contains=cPreConditIf,cPreCondit,cIncluded,cInclude,cDefined,cDefine,cErrInParen,cErrInBracket,cUserLabel,cUserLabel2,cGotoLabel,cSpecial,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti
138+ "syn region cDefine start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@cPreProcGroup,@Spell
139+ syn region cDefine start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@cPreProcGroup,cName,cFunction,cAnsiFunction,@Spell
140+ syn region cPreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
141+
142+ " Highlight User Labels
143+ syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cUserLabel2,cGotoLabel,cBitField,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
144+ syn region cMulti transparent start='?' skip='::' end=':' contains=ALLBUT,@cMultiGroup,@Spell
145+ " Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
146+ syn cluster cLabelGroup contains=cUserLabel
147+ syn match cUserCont display "^\s*\I\i*\s*:$" contains=@cLabelGroup
148+ syn match cUserCont display ";\s*\I\i*\s*:$" contains=@cLabelGroup
149+ syn match cUserCont display "^\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
150+ syn match cUserCont display ";\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
151+
152+ syn match cUserLabel display "\I\i*" contained
153+ syn match cUserLabel2 display "\I\i*:;\+"me=e-2
154+ syn match cGotoLabel display "\<goto\s\+\I\i*;"me=e-1,hs=s+5 contains=cGoto
155+ syn keyword cGoto contained goto
156+
157+ " Avoid recognizing most bitfields as labels
158+ syn match cBitField display "^\s*\I\i*\s*:\s*[1-9]"me=e-1
159+ syn match cBitField display ";\s*\I\i*\s*:\s*[1-9]"me=e-1
160+
161+ syn match cOperator "\(<<\|>>\|[-+*/%&^|<>!=]\)="
162+ syn match cOperator "<<\|>>\|&&\|||\|++\|--\|->"
163+ syn match cOperator "[.!~*&%<>^|=+-]"
164+ syn match cOperator "/[^/*=]"me=e-1
165+ syn match cOperator "/$"
166+ syn match cOperator "[\\]"
167+ syn match cOperator "&&\|||"
168+ syn match cSpecialCharacter "[,;]"
169+ syn match cDelimiter "[][(){}]"
170+ syn keyword cType CHAR byte BYTE uchar ushort uint ulong
171+ syn keyword cType WORD DWORD QWORD INT INT2 INT4 UNS UNS2 UNS4 INT8 UNS8
172+ syn keyword cType CFG_t cfap_t cBYTE cvoid
173+ syn keyword cType _Bool _Complex _Imaginary __int64
174+ if !exists("c_no_ansi") || exists("c_ansi_typedefs")
175+ syn keyword cMC __near __far FAR __io __direct DIR
176+ endif
177+
178+ if exists("c_minlines")
179+ let b:c_minlines = c_minlines
180+ else
181+ if !exists("c_no_if0")
182+ let b:c_minlines = 50 " #if 0 constructs can be long
183+ else
184+ let b:c_minlines = 15 " mostly for () constructs
185+ endif
186+ endif
187+ exec "syn sync ccomment cComment minlines=" . b:c_minlines
188+
189+ " Define the default highlighting.
190+ " For version 5.7 and earlier: only when not done already
191+ " For version 5.8 and later: only when an item doesn't have highlighting yet
192+ if version >= 508 || !exists("did_c_syn_inits")
193+ if version < 508
194+ let did_c_syn_inits = 1
195+ command -nargs=+ HiLink hi link <args>
196+ else
197+ command -nargs=+ HiLink hi def link <args>
198+ endif
199+
200+ HiLink cFormat cSpecial
201+ HiLink cCppString cString
202+ HiLink cCommentL cComment
203+ HiLink cCommentStart cComment
204+ HiLink cLabel Label
205+ " HiLink cUserLabel Label
206+ HiLink cUserLabel UserLabel2
207+ HiLink cUserLabel2 UserLabel2
208+ HiLink cGotoLabel UserLabel2
209+ HiLink cGoto Statement
210+ HiLink cConditional Conditional
211+ HiLink cRepeat Repeat
212+ HiLink cCharacter Character
213+ HiLink cSpecialCharacter cSpecial
214+ HiLink cNumber Number
215+ HiLink cOctal Number
216+ HiLink cOctalZero PreProc " link this to Error if you want
217+ HiLink cFloat Float
218+ HiLink cOctalError cError
219+ HiLink cParenError cError
220+ HiLink cErrInParen cError
221+ HiLink cErrInBracket cError
222+ HiLink cCommentError cError
223+ HiLink cCommentStartError cError
224+ HiLink cSpaceError cError
225+ HiLink cSpecialError cError
226+ HiLink cOperator Operator
227+ HiLink cOperatorBold OperatorBold
228+ HiLink cStructure Structure
229+ HiLink cStorageClass StorageClass
230+ HiLink cInclude Include
231+ HiLink cPreProc PreProc
232+ HiLink cDefine Macro
233+ HiLink cDefined PreCondit
234+ HiLink cIncluded cString
235+ HiLink cError Error
236+ HiLink cStatement Statement
237+ HiLink cPreCondit PreCondit
238+ HiLink cPreConditIf PreCondit
239+ HiLink cType Type
240+ HiLink cConstant Constant
241+ HiLink cCommentString cString
242+ HiLink cComment2String cString
243+ HiLink cCommentSkip cComment
244+ HiLink cString String
245+ HiLink cComment Comment
246+ HiLink cDelimiter Delimiter
247+ HiLink cSpecial SpecialChar
248+ HiLink cTodo Todo
249+ HiLink cCppSkip cCppOut
250+ HiLink cCppOut2 cCppOut
251+ HiLink cCppOut Comment
252+ HiLink cMulti Operator
253+ HiLink cMultiMG Operator
254+ HiLink cFunction Function
255+ HiLink cAnsiFunction StdFunction
256+ HiLink cName Name
257+ HiLink cBitField Name
258+ HiLink cAnsiName StdName
259+ "HiLink cBlock BlockBraces
260+ HiLink cBraces BlockBraces
261+ "HiLink cBraceError Error
262+ HiLink cMC MicroController
263+ HiLink cAnsiFuncPtr AnsiFuncPtr
264+
265+ hi Function gui=NONE guifg=#e86f00
266+ "hi StdFunction gui=bold guifg=#ee0040
267+ hi StdFunction gui=bold guifg=#e86f00
268+ hi Statement gui=bold guifg=#a06129
269+ hi UserLabel2 gui=bold guifg=#c96129
270+ hi Operator gui=NONE guifg=#000000
271+ hi OperatorBold gui=bold guifg=#000000
272+ hi StdName gui=bold guifg=#5276e6
273+ hi Name gui=NONE guifg=#5276e6
274+ hi BlockBraces gui=bold guifg=#000000
275+ hi Special gui=NONE guifg=#a000a0
276+ hi Comment gui=NONE guifg=grey62
277+ hi MicroController gui=bold guifg=#d00000
278+ hi AnsiFuncPtr gui=NONE guifg=#ff0000
279+ " hi PreProc gui=NONE guifg=#6a5acd
280+ hi PreCondit gui=NONE guifg=#6a5acd
281+ " hi Macro gui=NONE guifg=#0000ff
282+
283+ delcommand HiLink
284+ endif
285+ hi Normal gui=NONE guifg=#000000 guibg=Ivory1
286+
287+ let b:current_syntax = "c"
288+
289+ " vim: ts=8
Note: See TracBrowser for help on using the repository browser.