3 " Maintainer: Michael Piefel <piefel@informatik.hu-berlin.de>
4 " Last Change: 2 May 2001
6 " For version 5.x: Clear all syntax items
7 " For version 6.x: Quit when a syntax file was already loaded
10 elseif exists("b:current_syntax")
14 " Read the C++ syntax to start with
16 source <sfile>:p:h/cpp.vim
18 runtime! syntax/cpp.vim
19 unlet b:current_syntax
22 " kimwitu++ extentions
24 " Don't stop at eol, messes around with CPP mode, but gives line spanning
25 " strings in unparse rules
26 syn region cCppString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat
27 syn keyword cType integer real casestring nocasestring voidptr list
28 syn keyword cType uview rview uview_enum rview_enum
30 " avoid unparsing rule sth:view being scanned as label
32 syn match cUserCont "^\s*\I\i*\s*:$" contains=cUserLabel contained
33 syn match cUserCont ";\s*\I\i*\s*:$" contains=cUserLabel contained
34 syn match cUserCont "^\s*\I\i*\s*:[^:]"me=e-1 contains=cUserLabel contained
35 syn match cUserCont ";\s*\I\i*\s*:[^:]"me=e-1 contains=cUserLabel contained
37 " highlight phylum decls
38 syn match kwtPhylum "^\I\i*:$"
39 syn match kwtPhylum "^\I\i*\s*{\s*\(!\|\I\)\i*\s*}\s*:$"
41 syn keyword kwtStatement with foreach afterforeach provided
42 syn match kwtDecl "%\(uviewvar\|rviewvar\)"
43 syn match kwtDecl "^%\(uview\|rview\|ctor\|dtor\|base\|storageclass\|list\|attr\|member\|option\)"
44 syn match kwtOption "no-csgio\|no-unparse\|no-rewrite\|no-printdot\|no-hashtables\|smart-pointer\|weak-pointer"
45 syn match kwtSep "^%}$"
46 syn match kwtSep "^%{\(\s\+\I\i*\)*$"
47 syn match kwtCast "\<phylum_cast\s*<"me=e-1
48 syn match kwtCast "\<phylum_cast\s*$"
51 " match views, remove paren error in brackets
52 syn clear cErrInBracket
53 syn match cErrInBracket contained ")"
54 syn match kwtViews "\(\[\|<\)\@<=[ [:alnum:]_]\{-}:"
57 syn region kwtUnpBody transparent keepend extend fold start="->\s*\[" start="^\s*\[" skip="\$\@<!{\_.\{-}\$\@<!}" end="\s]\s\=;\=$" end="^]\s\=;\=$" end="}]\s\=;\=$"
58 syn region kwtRewBody transparent keepend extend fold start="->\s*<" start="^\s*<" end="\s>\s\=;\=$" end="^>\s\=;\=$"
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_kwt_syn_inits")
65 let did_kwt_syn_inits = 1
66 command -nargs=+ HiLink hi link <args>
68 command -nargs=+ HiLink hi def link <args>
71 HiLink kwtStatement cppStatement
72 HiLink kwtDecl cppStatement
73 HiLink kwtCast cppStatement
74 HiLink kwtSep Delimiter
77 HiLink kwtOption PreProc
85 let b:current_syntax = "kwt"