comparison runtime/syntax/c.vim @ 36:125e80798a85 v7.0021

updated for version 7.0021
author vimboss
date Thu, 09 Dec 2004 21:34:53 +0000
parents 3fc0f57ecb91
children 8ecb0db93e9a
comparison
equal deleted inserted replaced
35:8f3a526c2fe1 36:125e80798a85
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: 2004 Feb 04 4 " Last Change: 2004 Dec 09
5 5
6 " For version 5.x: Clear all syntax items 6 " For version 5.x: Clear all syntax items
7 " For version 6.x: Quit when a syntax file was already loaded 7 " For version 6.x: Quit when a syntax file was already loaded
8 if version < 600 8 if version < 600
9 syntax clear 9 syntax clear
122 " Unfortunately this doesn't very well work for // type of comments :-( 122 " Unfortunately this doesn't very well work for // type of comments :-(
123 syntax match cCommentSkip contained "^\s*\*\($\|\s\+\)" 123 syntax match cCommentSkip contained "^\s*\*\($\|\s\+\)"
124 syntax region cCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=cSpecial,cCommentSkip 124 syntax region cCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=cSpecial,cCommentSkip
125 syntax region cComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=cSpecial 125 syntax region cComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=cSpecial
126 syntax region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cComment2String,cCharacter,cNumbersCom,cSpaceError,@Spell 126 syntax region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cComment2String,cCharacter,cNumbersCom,cSpaceError,@Spell
127 syntax region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell 127 if exists("c_no_comment_fold")
128 syntax region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell
129 else
130 syntax region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell fold
131 endif
128 else 132 else
129 syn region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cSpaceError,@Spell 133 syn region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cSpaceError,@Spell
130 syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell 134 if exists("c_no_comment_fold")
135 syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell
136 else
137 syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell fold
138 endif
131 endif 139 endif
132 " keep a // comment separately, it terminates a preproc. conditional 140 " keep a // comment separately, it terminates a preproc. conditional
133 syntax match cCommentError display "\*/" 141 syntax match cCommentError display "\*/"
134 syntax match cCommentStartError display "/\*"me=e-1 contained 142 syntax match cCommentStartError display "/\*"me=e-1 contained
143
144 syntax region cBlock start="{" end="}" transparent fold
135 145
136 syn keyword cOperator sizeof 146 syn keyword cOperator sizeof
137 if exists("c_gnu") 147 if exists("c_gnu")
138 syn keyword cStatement __asm__ 148 syn keyword cStatement __asm__
139 syn keyword cOperator typeof __real__ __imag__ 149 syn keyword cOperator typeof __real__ __imag__