blob: b4d023600ca5c3b498b0b0e4e86e2a401580b45e (
plain)
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
|
" Vim syntax file
" Informix Structured Query Language (SQL) and Stored Procedure Language (SPL)
" Language: SQL, SPL (Informix Dynamic Server 2000 v9.2)
" Maintainer: Dean Hill <dhill@hotmail.com>
" Last Change: 2004 Aug 30
" 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
" === Comment syntax group ===
syn region sqlComment start="{" end="}" contains=sqlTodo
syn match sqlComment "--.*$" contains=sqlTodo
syn sync ccomment sqlComment
" === Constant syntax group ===
" = Boolean subgroup =
syn keyword sqlBoolean true false
syn keyword sqlBoolean null
syn keyword sqlBoolean public user
syn keyword sqlBoolean current today
syn keyword sqlBoolean year month day hour minute second fraction
" = String subgroup =
syn region sqlString start=+"+ end=+"+
syn region sqlString start=+'+ end=+'+
" = Numbers subgroup =
syn match sqlNumber "-\=\<\d*\.\=[0-9_]\>"
" === Statement syntax group ===
" SQL
syn keyword sqlStatement allocate alter
syn keyword sqlStatement begin
syn keyword sqlStatement close commit connect create
syn keyword sqlStatement database deallocate declare delete describe disconnect drop
syn keyword sqlStatement execute fetch flush free get grant info insert
syn keyword sqlStatement load lock open output
syn keyword sqlStatement prepare put
syn keyword sqlStatement rename revoke rollback select set start stop
syn keyword sqlStatement truncate unload unlock update
syn keyword sqlStatement whenever
" SPL
syn keyword sqlStatement call continue define
syn keyword sqlStatement exit
syn keyword sqlStatement let
syn keyword sqlStatement return system trace
" = Conditional subgroup =
" SPL
syn keyword sqlConditional elif else if then
syn keyword sqlConditional case
" Highlight "end if" with one or more separating spaces
syn match sqlConditional "end \+if"
" = Repeat subgroup =
" SQL/SPL
" Handle SQL triggers' "for each row" clause and SPL "for" loop
syn match sqlRepeat "for\( \+each \+row\)\="
" SPL
syn keyword sqlRepeat foreach while
" Highlight "end for", etc. with one or more separating spaces
syn match sqlRepeat "end \+for"
syn match sqlRepeat "end \+foreach"
syn match sqlRepeat "end \+while"
" = Exception subgroup =
" SPL
syn match sqlException "on \+exception"
syn match sqlException "end \+exception"
syn match sqlException "end \+exception \+with \+resume"
syn match sqlException "raise \+exception"
" = Keyword subgroup =
" SQL
syn keyword sqlKeyword aggregate add as authorization autofree by
syn keyword sqlKeyword cache cascade check cluster collation
syn keyword sqlKeyword column connection constraint cross
syn keyword sqlKeyword dataskip debug default deferred_prepare
syn keyword sqlKeyword descriptor diagnostics
syn keyword sqlKeyword each escape explain external
syn keyword sqlKeyword file foreign fragment from function
syn keyword sqlKeyword group having
syn keyword sqlKeyword immediate index inner into isolation
syn keyword sqlKeyword join key
syn keyword sqlKeyword left level log
syn keyword sqlKeyword mode modify mounting new no
syn keyword sqlKeyword object of old optical option
syn keyword sqlKeyword optimization order outer
syn keyword sqlKeyword pdqpriority pload primary procedure
syn keyword sqlKeyword references referencing release reserve
syn keyword sqlKeyword residency right role routine row
syn keyword sqlKeyword schedule schema scratch session set
syn keyword sqlKeyword statement statistics synonym
syn keyword sqlKeyword table temp temporary timeout to transaction trigger
syn keyword sqlKeyword using values view violations
syn keyword sqlKeyword where with work
" Highlight "on" (if it's not followed by some words we've already handled)
syn match sqlKeyword "on \+\(exception\)\@!"
" SPL
" Highlight "end" (if it's not followed by some words we've already handled)
syn match sqlKeyword "end \+\(if\|for\|foreach\|while\|exception\)\@!"
syn keyword sqlKeyword resume returning
" = Operator subgroup =
" SQL
syn keyword sqlOperator not and or
syn keyword sqlOperator in is any some all between exists
syn keyword sqlOperator like matches
syn keyword sqlOperator union intersect
syn keyword sqlOperator distinct unique
" === Identifier syntax group ===
" = Function subgroup =
" SQL
syn keyword sqlFunction abs acos asin atan atan2 avg
syn keyword sqlFunction cardinality cast char_length character_length cos count
syn keyword sqlFunction exp filetoblob filetoclob hex
syn keyword sqlFunction initcap length logn log10 lower lpad
syn keyword sqlFunction min max mod octet_length pow range replace root round rpad
syn keyword sqlFunction sin sqrt stdev substr substring sum
syn keyword sqlFunction to_char tan to_date trim trunc upper variance
" === Type syntax group ===
" SQL
syn keyword sqlType blob boolean byte char character clob
syn keyword sqlType date datetime dec decimal double
syn keyword sqlType float int int8 integer interval list lvarchar
syn keyword sqlType money multiset nchar numeric nvarchar
syn keyword sqlType real serial serial8 smallfloat smallint
syn keyword sqlType text varchar varying
" === Todo syntax group ===
syn keyword sqlTodo 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_sql_syn_inits")
if version < 508
let did_sql_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
" === Comment syntax group ===
HiLink sqlComment Comment
" === Constant syntax group ===
HiLink sqlNumber Number
HiLink sqlBoolean Boolean
HiLink sqlString String
" === Statment syntax group ===
HiLink sqlStatement Statement
HiLink sqlConditional Conditional
HiLink sqlRepeat Repeat
HiLink sqlKeyword Keyword
HiLink sqlOperator Operator
HiLink sqlException Exception
" === Identifier syntax group ===
HiLink sqlFunction Function
" === Type syntax group ===
HiLink sqlType Type
" === Todo syntax group ===
HiLink sqlTodo Todo
delcommand HiLink
endif
let b:current_syntax = "sqlinformix"
|