cdl.vim 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. " Vim syntax file
  2. " Language: Comshare Dimension Definition Language
  3. " Maintainer: Raul Segura Acevedo <raulseguraaceved@netscape.net>
  4. " Last change: 2001 Jul 31
  5. if version < 600
  6. syntax clear
  7. elseif exists("b:current_syntax")
  8. finish
  9. endif
  10. sy case ignore
  11. sy sync fromstart
  12. sy keyword cdlStatement dimension hierarchy group grouphierarchy schedule class
  13. sy keyword cdlType add update file category main altername removeall required notrequired
  14. sy keyword cdlConditional if then elseif else endif and or not cons rpt xlt
  15. sy keyword cdlFunction ChildOf IChildOf LeafChildOf DescendantOf IDescendantOf LeafDescendantOf MemberIs CountOf
  16. sy keyword cdlIdentifier contained id name desc description xlttype precision symbol curr_ name group_name rate_name
  17. sy keyword cdlIdentifier contained xcheck endbal accounttype natsign consolidate formula pctown usage periodicity
  18. sy match cdlIdentifier contained 'child\s*name'
  19. sy match cdlIdentifier contained 'parent\s*name'
  20. sy match cdlIdentifier contained 'grp\s*description'
  21. sy match cdlIdentifier contained 'grpchild\s*name'
  22. sy match cdlIdentifier contained 'grpparent\s*name'
  23. sy match cdlIdentifier contained 'preceding\s*member'
  24. sy match cdlIdentifier contained 'unit\s*name'
  25. sy match cdlIdentifier contained 'unit\s*id'
  26. sy match cdlIdentifier contained 'schedule\s*name'
  27. sy match cdlIdentifier contained 'schedule\s*id'
  28. sy match cdlString /\[[^]]*]/ contains=cdlRestricted,cdlNotSupported
  29. sy match cdlRestricted contained /[&*,_]/
  30. " not supported , [, ]
  31. sy match cdlNotSupported contained /[:"!']/
  32. sy keyword cdlTodo contained TODO FIXME XXX
  33. sy cluster cdlCommentGroup contains=cdlTodo
  34. sy match cdlComment '//.*' contains=@cdlCommentGroup
  35. sy region cdlComment start="/\*" end="\*/" contains=@cdlCommentGroup fold
  36. sy match cdlCommentE "\*/"
  37. sy region cdlParen transparent start='(' end=')' contains=ALLBUT,cdlParenE,cdlRestricted,cdlNotSupported
  38. "sy region cdlParen transparent start='(' end=')' contains=cdlIdentifier,cdlComment,cdlParenWordE
  39. sy match cdlParenE ")"
  40. "sy match cdlParenWordE contained "\k\+"
  41. sy keyword cdlFxType allocation downfoot expr xltgain
  42. "sy keyword cdlFxType contained allocation downfoot expr xltgain
  43. "sy region cdlFx transparent start='\k\+(' end=')' contains=cdlConditional,cdlFunction,cdlString,cdlComment,cdlFxType
  44. set foldmethod=expr
  45. set foldexpr=(getline(v:lnum+1)=~'{'\|\|getline(v:lnum)=~'//\\s\\*\\{5}.*table')?'>1':1
  46. %foldo!
  47. set foldmethod=manual
  48. let b:match_words='\<if\>:\<then\>:\<elseif\>:\<else\>:\<endif\>'
  49. " Define the default highlighting.
  50. " For version 5.7 and earlier: only when not done already
  51. " For version 5.8 and later: only when an item doesn't have highlighting yet
  52. if version >= 508 || !exists("did_csc_syntax_inits")
  53. if version < 508
  54. let did_csc_syntax_inits = 1
  55. command -nargs=+ HiLink hi link <args>
  56. else
  57. command -nargs=+ HiLink hi def link <args>
  58. endif
  59. HiLink cdlStatement Statement
  60. HiLink cdlType Type
  61. HiLink cdlFxType Type
  62. HiLink cdlIdentifier Identifier
  63. HiLink cdlString String
  64. HiLink cdlRestricted WarningMsg
  65. HiLink cdlNotSupported ErrorMsg
  66. HiLink cdlTodo Todo
  67. HiLink cdlComment Comment
  68. HiLink cdlCommentE ErrorMsg
  69. HiLink cdlParenE ErrorMsg
  70. HiLink cdlParenWordE ErrorMsg
  71. HiLink cdlFunction Function
  72. HiLink cdlConditional Conditional
  73. delcommand HiLink
  74. endif
  75. let b:current_syntax = "cdl"
  76. " vim: ts=8