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