comparison runtime/syntax/c.vim @ 3513:1b584a6f446c

Updated runtime files.
author Bram Moolenaar <bram@vim.org>
date Fri, 18 May 2012 13:46:39 +0200
parents af1e8a1714c2
children e362db8b2d7b
comparison
equal deleted inserted replaced
3512:5ad05e745fda 3513:1b584a6f446c
1 " Vim syntax file 1 " Vim syntax file
2 " Language: C 2 " Language: C
3 " Maintainer: Bram Moolenaar <Bram@vim.org> 3 " Maintainer: Bram Moolenaar <Bram@vim.org>
4 " Last Change: 2012 Jan 14 4 " Last Change: 2012 May 03
5 5
6 " Quit when a (custom) syntax file was already loaded 6 " Quit when a (custom) syntax file was already loaded
7 if exists("b:current_syntax") 7 if exists("b:current_syntax")
8 finish 8 finish
9 endif 9 endif
32 syn match cSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)" 32 syn match cSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
33 if !exists("c_no_utf") 33 if !exists("c_no_utf")
34 syn match cSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)" 34 syn match cSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)"
35 endif 35 endif
36 if exists("c_no_cformat") 36 if exists("c_no_cformat")
37 syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell 37 syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend
38 " cCppString: same as cString, but ends at end of line 38 " cCppString: same as cString, but ends at end of line
39 syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,@Spell 39 syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,@Spell
40 else 40 else
41 if !exists("c_no_c99") " ISO C99 41 if !exists("c_no_c99") " ISO C99
42 syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained 42 syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
43 else 43 else
44 syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained 44 syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
45 endif 45 endif
46 syn match cFormat display "%%" contained 46 syn match cFormat display "%%" contained
47 syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell 47 syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
48 " cCppString: same as cString, but ends at end of line 48 " cCppString: same as cString, but ends at end of line
49 syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell 49 syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
50 endif 50 endif
51 51
52 syn match cCharacter "L\='[^\\]'" 52 syn match cCharacter "L\='[^\\]'"
62 syn match cSpecialCharacter display "'\\x\x\{1,2}'" 62 syn match cSpecialCharacter display "'\\x\x\{1,2}'"
63 syn match cSpecialCharacter display "L'\\x\x\+'" 63 syn match cSpecialCharacter display "L'\\x\x\+'"
64 64
65 if !exists("c_no_c11") " ISO C11 65 if !exists("c_no_c11") " ISO C11
66 if exists("c_no_cformat") 66 if exists("c_no_cformat")
67 syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell 67 syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend
68 else 68 else
69 syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell 69 syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
70 endif 70 endif
71 syn match cCharacter "[Uu]'[^\\]'" 71 syn match cCharacter "[Uu]'[^\\]'"
72 syn match cCharacter "[Uu]'[^']*'" contains=cSpecial 72 syn match cCharacter "[Uu]'[^']*'" contains=cSpecial
73 if exists("c_gnu") 73 if exists("c_gnu")
74 syn match cSpecialError "[Uu]'\\[^'\"?\\abefnrtv]'" 74 syn match cSpecialError "[Uu]'\\[^'\"?\\abefnrtv]'"
125 " cCppBracket: same as cParen but ends at end-of-line; used in cDefine 125 " cCppBracket: same as cParen but ends at end-of-line; used in cDefine
126 syn region cCppBracket transparent start='\[\|<::\@!' skip='\\$' excludenl end=']\|:>' end='$' contained contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString,@Spell 126 syn region cCppBracket transparent start='\[\|<::\@!' skip='\\$' excludenl end=']\|:>' end='$' contained contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString,@Spell
127 syn match cErrInBracket display contained "[);{}]\|<%\|%>" 127 syn match cErrInBracket display contained "[);{}]\|<%\|%>"
128 endif 128 endif
129 129
130 syntax region cBadBlock keepend extend start="{" end="}" contained containedin=cParen,cBracket,cBadBlock transparent fold 130 syntax region cBadBlock keepend start="{" end="}" contained containedin=cParen,cBracket,cBadBlock transparent fold
131 131
132 "integer number, or floating point number without a dot and with "f". 132 "integer number, or floating point number without a dot and with "f".
133 syn case ignore 133 syn case ignore
134 syn match cNumbers display transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctalError,cOctal 134 syn match cNumbers display transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctalError,cOctal
135 " Same, but without octal error (for comments) 135 " Same, but without octal error (for comments)
329 endif 329 endif
330 syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ 330 syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
331 syn match cIncluded display contained "<[^>]*>" 331 syn match cIncluded display contained "<[^>]*>"
332 syn match cInclude display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded 332 syn match cInclude display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded
333 "syn match cLineSkip "\\$" 333 "syn match cLineSkip "\\$"
334 syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti 334 syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti,cBadBlock
335 syn region cDefine start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell 335 syn region cDefine start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
336 syn region cPreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell 336 syn region cPreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
337 337
338 " Highlight User Labels 338 " Highlight User Labels
339 syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString 339 syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString