blob: ecda5bb985935e40d6893995c08bde88a0bd74fa [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: kimwitu++
Bram Moolenaarb6b046b2011-12-30 13:11:27 +01003" Maintainer: Michael Piefel <entwurf@piefel.de>
Bram Moolenaar071d4272004-06-13 20:20:40 +00004" Last Change: 2 May 2001
5
Bram Moolenaar89bcfda2016-08-30 23:26:57 +02006" quit when a syntax file was already loaded
7if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +00008 finish
9endif
10
11" Read the C++ syntax to start with
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020012runtime! syntax/cpp.vim
13unlet b:current_syntax
Bram Moolenaar071d4272004-06-13 20:20:40 +000014
15" kimwitu++ extentions
16
17" Don't stop at eol, messes around with CPP mode, but gives line spanning
18" strings in unparse rules
19syn region cCppString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat
20syn keyword cType integer real casestring nocasestring voidptr list
21syn keyword cType uview rview uview_enum rview_enum
22
23" avoid unparsing rule sth:view being scanned as label
24syn clear cUserCont
25syn match cUserCont "^\s*\I\i*\s*:$" contains=cUserLabel contained
26syn match cUserCont ";\s*\I\i*\s*:$" contains=cUserLabel contained
27syn match cUserCont "^\s*\I\i*\s*:[^:]"me=e-1 contains=cUserLabel contained
28syn match cUserCont ";\s*\I\i*\s*:[^:]"me=e-1 contains=cUserLabel contained
29
30" highlight phylum decls
31syn match kwtPhylum "^\I\i*:$"
32syn match kwtPhylum "^\I\i*\s*{\s*\(!\|\I\)\i*\s*}\s*:$"
33
34syn keyword kwtStatement with foreach afterforeach provided
35syn match kwtDecl "%\(uviewvar\|rviewvar\)"
36syn match kwtDecl "^%\(uview\|rview\|ctor\|dtor\|base\|storageclass\|list\|attr\|member\|option\)"
37syn match kwtOption "no-csgio\|no-unparse\|no-rewrite\|no-printdot\|no-hashtables\|smart-pointer\|weak-pointer"
38syn match kwtSep "^%}$"
39syn match kwtSep "^%{\(\s\+\I\i*\)*$"
40syn match kwtCast "\<phylum_cast\s*<"me=e-1
41syn match kwtCast "\<phylum_cast\s*$"
42
43
44" match views, remove paren error in brackets
45syn clear cErrInBracket
46syn match cErrInBracket contained ")"
47syn match kwtViews "\(\[\|<\)\@<=[ [:alnum:]_]\{-}:"
48
49" match rule bodies
50syn region kwtUnpBody transparent keepend extend fold start="->\s*\[" start="^\s*\[" skip="\$\@<!{\_.\{-}\$\@<!}" end="\s]\s\=;\=$" end="^]\s\=;\=$" end="}]\s\=;\=$"
51syn region kwtRewBody transparent keepend extend fold start="->\s*<" start="^\s*<" end="\s>\s\=;\=$" end="^>\s\=;\=$"
52
53" Define the default highlighting.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020054" Only when an item doesn't have highlighting yet
Bram Moolenaar071d4272004-06-13 20:20:40 +000055
Bram Moolenaarf37506f2016-08-31 22:22:10 +020056hi def link kwtStatement cppStatement
57hi def link kwtDecl cppStatement
58hi def link kwtCast cppStatement
59hi def link kwtSep Delimiter
60hi def link kwtViews Label
61hi def link kwtPhylum Type
62hi def link kwtOption PreProc
63"hi def link cText Comment
Bram Moolenaar071d4272004-06-13 20:20:40 +000064
Bram Moolenaar071d4272004-06-13 20:20:40 +000065
66syn sync lines=300
67
68let b:current_syntax = "kwt"
69
70" vim: ts=8