cdl.vim 3.0 KB

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