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