kwt.vim 2.4 KB

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