summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/kwt.vim
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 02:44:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 02:44:24 +0000
commit8baab3c8d7a6f22888bd581cd5c6098fd2e4b5a8 (patch)
tree3537e168b860f2742f6029d70501b5ed7d15d345 /runtime/syntax/kwt.vim
parentInitial commit. (diff)
downloadvim-8baab3c8d7a6f22888bd581cd5c6098fd2e4b5a8.tar.xz
vim-8baab3c8d7a6f22888bd581cd5c6098fd2e4b5a8.zip
Adding upstream version 2:8.1.0875.upstream/2%8.1.0875upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'runtime/syntax/kwt.vim')
-rw-r--r--runtime/syntax/kwt.vim70
1 files changed, 70 insertions, 0 deletions
diff --git a/runtime/syntax/kwt.vim b/runtime/syntax/kwt.vim
new file mode 100644
index 0000000..ecda5bb
--- /dev/null
+++ b/runtime/syntax/kwt.vim
@@ -0,0 +1,70 @@
+" Vim syntax file
+" Language: kimwitu++
+" Maintainer: Michael Piefel <entwurf@piefel.de>
+" Last Change: 2 May 2001
+
+" quit when a syntax file was already loaded
+if exists("b:current_syntax")
+ finish
+endif
+
+" Read the C++ syntax to start with
+runtime! syntax/cpp.vim
+unlet b:current_syntax
+
+" kimwitu++ extentions
+
+" Don't stop at eol, messes around with CPP mode, but gives line spanning
+" strings in unparse rules
+syn region cCppString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat
+syn keyword cType integer real casestring nocasestring voidptr list
+syn keyword cType uview rview uview_enum rview_enum
+
+" avoid unparsing rule sth:view being scanned as label
+syn clear cUserCont
+syn match cUserCont "^\s*\I\i*\s*:$" contains=cUserLabel contained
+syn match cUserCont ";\s*\I\i*\s*:$" contains=cUserLabel contained
+syn match cUserCont "^\s*\I\i*\s*:[^:]"me=e-1 contains=cUserLabel contained
+syn match cUserCont ";\s*\I\i*\s*:[^:]"me=e-1 contains=cUserLabel contained
+
+" highlight phylum decls
+syn match kwtPhylum "^\I\i*:$"
+syn match kwtPhylum "^\I\i*\s*{\s*\(!\|\I\)\i*\s*}\s*:$"
+
+syn keyword kwtStatement with foreach afterforeach provided
+syn match kwtDecl "%\(uviewvar\|rviewvar\)"
+syn match kwtDecl "^%\(uview\|rview\|ctor\|dtor\|base\|storageclass\|list\|attr\|member\|option\)"
+syn match kwtOption "no-csgio\|no-unparse\|no-rewrite\|no-printdot\|no-hashtables\|smart-pointer\|weak-pointer"
+syn match kwtSep "^%}$"
+syn match kwtSep "^%{\(\s\+\I\i*\)*$"
+syn match kwtCast "\<phylum_cast\s*<"me=e-1
+syn match kwtCast "\<phylum_cast\s*$"
+
+
+" match views, remove paren error in brackets
+syn clear cErrInBracket
+syn match cErrInBracket contained ")"
+syn match kwtViews "\(\[\|<\)\@<=[ [:alnum:]_]\{-}:"
+
+" match rule bodies
+syn region kwtUnpBody transparent keepend extend fold start="->\s*\[" start="^\s*\[" skip="\$\@<!{\_.\{-}\$\@<!}" end="\s]\s\=;\=$" end="^]\s\=;\=$" end="}]\s\=;\=$"
+syn region kwtRewBody transparent keepend extend fold start="->\s*<" start="^\s*<" end="\s>\s\=;\=$" end="^>\s\=;\=$"
+
+" Define the default highlighting.
+" Only when an item doesn't have highlighting yet
+
+hi def link kwtStatement cppStatement
+hi def link kwtDecl cppStatement
+hi def link kwtCast cppStatement
+hi def link kwtSep Delimiter
+hi def link kwtViews Label
+hi def link kwtPhylum Type
+hi def link kwtOption PreProc
+"hi def link cText Comment
+
+
+syn sync lines=300
+
+let b:current_syntax = "kwt"
+
+" vim: ts=8