-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmdx.vim
113 lines (96 loc) · 4.74 KB
/
mdx.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
" Vim syntax file
" Language: MDX (MultiDimensional eXpressions)
" Maintainer: Finlay Cannon <fin AT finlaycannon DOT com>
" URL: http://github.com/findango/mdxdotvim
" Last Change: 26 Feb 2008
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
syn case ignore
" The MDX reserved words, defined as keywords.
syn keyword mdxSpecial false null true
" Functions
syn keyword mdxKeyword absolute actionparameterset addcalculatedmembers after
syn keyword mdxKeyword aggregate all allmembers ancestor ancestors asc
syn keyword mdxKeyword ascendants average axis basc bdesc before
syn keyword mdxKeyword before_and_after bottomcount bottompercent bottomsum by
syn keyword mdxKeyword cache calculationcurrentpass calculationpassvalue
syn keyword mdxKeyword cellformulasetlist chapters children closingperiod
syn keyword mdxKeyword coalesceempty column columns correlation count cousin
syn keyword mdxKeyword covariance covariancen createpropertyset
syn keyword mdxKeyword createvirtualdimension crossjoin current currentcube
syn keyword mdxKeyword currentmember default_member defaultmember desc
syn keyword mdxKeyword descendants description dimension dimensions distinct
syn keyword mdxKeyword distinctcount drilldownlevel drilldownlevelbottom
syn keyword mdxKeyword drilldownleveltop drilldownmember drilldownmemberbottom
syn keyword mdxKeyword drilldownmembertop drilluplevel drillupmember empty
syn keyword mdxKeyword error except excludeempty extract filter firstchild
syn keyword mdxKeyword firstsibling for freeze generate group grouping head
syn keyword mdxKeyword hidden hierarchize hierarchy ignore iif includeempty
syn keyword mdxKeyword index intersect isancestor isempty isgeneration isleaf
syn keyword mdxKeyword issibling item lag lastchild lastperiods lastsibling
syn keyword mdxKeyword lead leaves level levels linkmember linregintercept
syn keyword mdxKeyword linregpoint linregr2 linregslope linregvariance
syn keyword mdxKeyword lookupcube max measure median members membertostr min
syn keyword mdxKeyword mtd name nametoset nest nextmember no_allocation
syn keyword mdxKeyword no_properties non nonemptycrossjoin not_related_to_facts
syn keyword mdxKeyword openingperiod pages parallelperiod parent pass
syn keyword mdxKeyword periodstodate post predict prevmember properties
syn keyword mdxKeyword property qtd rank recursive relative rollupchildren root
syn keyword mdxKeyword rows sections self self_and_after self_and_before
syn keyword mdxKeyword self_before_after settoarray settostr solve_order sort
syn keyword mdxKeyword stddev stddevp stdev stdevp storage
syn keyword mdxKeyword stripcalculatedmembers strtomember strtoset strtotuple
syn keyword mdxKeyword strtoval strtovalue subset sum tail this
syn keyword mdxKeyword toggledrillstate topcount toppercent topsum totals tree
syn keyword mdxKeyword tupletostr type union unique uniquename use
syn keyword mdxKeyword use_equal_allocation use_weighted_allocation
syn keyword mdxKeyword use_weighted_increment username validmeasure value var
syn keyword mdxKeyword variance variancep varp visual visualtotals wtd ytd
" Operators
syn keyword mdxOperator and is not or xor
" Statements
syn keyword mdxStatement action alter as calculate calculation calculations call
syn keyword mdxStatement case cell clear create cube drillthrough drop end
syn keyword mdxStatement existing from global if member on refresh scope select
syn keyword mdxStatement session set subcube update where with
" Strings and characters
syn region mdxString start=+"+ skip=+\\\\\|\\"+ end=+"+
syn region mdxString start=+'+ skip=+\\\\\|\\'+ end=+'+
" Member names
syn region mdxIdentifier start="\[" end="\]"
" Numbers
syn match mdxNumber "-\=\<\d*\.\=[0-9_]\>"
" Comments
syn region mdxComment start="/\*" end="\*/" contains=mdxTodo
syn match mdxComment "--.*$" contains=mdxTodo
syn match mdxComment "//.*$" contains=mdxTodo
syn sync ccomment mdxComment
" TODOs
syn keyword mdxTodo TODO FIXME XXX DEBUG NOTE
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_mdx_syn_inits")
if version < 508
let did_mdx_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink mdxComment Comment
HiLink mdxKeyword mdxSpecial
HiLink mdxNumber Number
HiLink mdxOperator mdxStatement
HiLink mdxSpecial Special
HiLink mdxStatement Statement
HiLink mdxString String
HiLink mdxTodo Todo
HiLink mdxIdentifier Normal
delcommand HiLink
endif
let b:current_syntax = "mdx"