12254
|
1 " Vim syntax file
|
|
2 " Language: N1QL / Couchbase Server
|
|
3 " Maintainer: Eugene Ciurana <n1ql AT cime.net>
|
|
4 " Version: 1.0
|
|
5 " Source: https://github.com/pr3d4t0r/n1ql-vim-syntax
|
|
6 "
|
|
7 " License: Vim is Charityware. n1ql.vim syntax is Charityware.
|
|
8 " (c) Copyright 2017 by Eugene Ciurana / pr3d4t0r. Licensed
|
|
9 " under the standard VIM LICENSE - Vim command :help uganda.txt
|
|
10 " for details.
|
|
11 "
|
|
12 " Questions, comments: <n1ql AT cime.net>
|
|
13 " https://ciurana.eu/pgp, https://keybase.io/pr3d4t0r
|
|
14 "
|
|
15 " vim: set fileencoding=utf-8:
|
|
16
|
|
17
|
|
18 if exists("b:current_syntax")
|
|
19 finish
|
|
20 endif
|
|
21
|
|
22
|
|
23 syn case ignore
|
|
24
|
|
25 syn keyword n1qlSpecial DATASTORES
|
|
26 syn keyword n1qlSpecial DUAL
|
|
27 syn keyword n1qlSpecial FALSE
|
|
28 syn keyword n1qlSpecial INDEXES
|
|
29 syn keyword n1qlSpecial KEYSPACES
|
|
30 syn keyword n1qlSpecial MISSING
|
|
31 syn keyword n1qlSpecial NAMESPACES
|
|
32 syn keyword n1qlSpecial NULL
|
|
33 syn keyword n1qlSpecial TRUE
|
|
34
|
|
35
|
|
36 "
|
|
37 " *** keywords ***
|
|
38 "
|
|
39 syn keyword n1qlKeyword ALL
|
|
40 syn keyword n1qlKeyword ANY
|
|
41 syn keyword n1qlKeyword ASC
|
|
42 syn keyword n1qlKeyword BEGIN
|
|
43 syn keyword n1qlKeyword BETWEEN
|
|
44 syn keyword n1qlKeyword BREAK
|
|
45 syn keyword n1qlKeyword BUCKET
|
|
46 syn keyword n1qlKeyword CALL
|
|
47 syn keyword n1qlKeyword CASE
|
|
48 syn keyword n1qlKeyword CAST
|
|
49 syn keyword n1qlKeyword CLUSTER
|
|
50 syn keyword n1qlKeyword COLLATE
|
|
51 syn keyword n1qlKeyword COLLECTION
|
|
52 syn keyword n1qlKeyword CONNECT
|
|
53 syn keyword n1qlKeyword CONTINUE
|
|
54 syn keyword n1qlKeyword CORRELATE
|
|
55 syn keyword n1qlKeyword COVER
|
|
56 syn keyword n1qlKeyword DATABASE
|
|
57 syn keyword n1qlKeyword DATASET
|
|
58 syn keyword n1qlKeyword DATASTORE
|
|
59 syn keyword n1qlKeyword DECLARE
|
|
60 syn keyword n1qlKeyword DECREMENT
|
|
61 syn keyword n1qlKeyword DERIVED
|
|
62 syn keyword n1qlKeyword DESC
|
|
63 syn keyword n1qlKeyword DESCRIBE
|
|
64 syn keyword n1qlKeyword DO
|
|
65 syn keyword n1qlKeyword EACH
|
|
66 syn keyword n1qlKeyword ELEMENT
|
|
67 syn keyword n1qlKeyword ELSE
|
|
68 syn keyword n1qlKeyword END
|
|
69 syn keyword n1qlKeyword EVERY
|
|
70 syn keyword n1qlKeyword EXCLUDE
|
|
71 syn keyword n1qlKeyword EXISTS
|
|
72 syn keyword n1qlKeyword FETCH
|
|
73 syn keyword n1qlKeyword FIRST
|
|
74 syn keyword n1qlKeyword FLATTEN
|
|
75 syn keyword n1qlKeyword FOR
|
|
76 syn keyword n1qlKeyword FORCE
|
|
77 syn keyword n1qlKeyword FROM
|
|
78 syn keyword n1qlKeyword FUNCTION
|
|
79 syn keyword n1qlKeyword GROUP
|
|
80 syn keyword n1qlKeyword GSI
|
|
81 syn keyword n1qlKeyword HAVING
|
|
82 syn keyword n1qlKeyword IF
|
|
83 syn keyword n1qlKeyword IGNORE
|
|
84 syn keyword n1qlKeyword INCLUDE
|
|
85 syn keyword n1qlKeyword INCREMENT
|
|
86 syn keyword n1qlKeyword INDEX
|
|
87 syn keyword n1qlKeyword INITIAL
|
|
88 syn keyword n1qlKeyword INLINE
|
|
89 syn keyword n1qlKeyword INNER
|
|
90 syn keyword n1qlKeyword INTO
|
|
91 syn keyword n1qlKeyword KEY
|
|
92 syn keyword n1qlKeyword KEYS
|
|
93 syn keyword n1qlKeyword KEYSPACE
|
|
94 syn keyword n1qlKeyword KNOWN
|
|
95 syn keyword n1qlKeyword LAST
|
|
96 syn keyword n1qlKeyword LET
|
|
97 syn keyword n1qlKeyword LETTING
|
|
98 syn keyword n1qlKeyword LIMIT
|
|
99 syn keyword n1qlKeyword LOOP
|
|
100 syn keyword n1qlKeyword LSM
|
|
101 syn keyword n1qlKeyword MAP
|
|
102 syn keyword n1qlKeyword MAPPING
|
|
103 syn keyword n1qlKeyword MATCHED
|
|
104 syn keyword n1qlKeyword MATERIALIZED
|
|
105 syn keyword n1qlKeyword MERGE
|
|
106 syn keyword n1qlKeyword NAMESPACE
|
|
107 syn keyword n1qlKeyword NEST
|
|
108 syn keyword n1qlKeyword OPTION
|
|
109 syn keyword n1qlKeyword ORDER
|
|
110 syn keyword n1qlKeyword OUTER
|
|
111 syn keyword n1qlKeyword OVER
|
|
112 syn keyword n1qlKeyword PARSE
|
|
113 syn keyword n1qlKeyword PARTITION
|
|
114 syn keyword n1qlKeyword PASSWORD
|
|
115 syn keyword n1qlKeyword PATH
|
|
116 syn keyword n1qlKeyword POOL
|
|
117 syn keyword n1qlKeyword PRIMARY
|
|
118 syn keyword n1qlKeyword PRIVATE
|
|
119 syn keyword n1qlKeyword PRIVILEGE
|
|
120 syn keyword n1qlKeyword PROCEDURE
|
|
121 syn keyword n1qlKeyword PUBLIC
|
|
122 syn keyword n1qlKeyword REALM
|
|
123 syn keyword n1qlKeyword REDUCE
|
|
124 syn keyword n1qlKeyword RETURN
|
|
125 syn keyword n1qlKeyword RETURNING
|
|
126 syn keyword n1qlKeyword ROLE
|
|
127 syn keyword n1qlKeyword SATISFIES
|
|
128 syn keyword n1qlKeyword SCHEMA
|
|
129 syn keyword n1qlKeyword SELF
|
|
130 syn keyword n1qlKeyword SEMI
|
|
131 syn keyword n1qlKeyword SHOW
|
|
132 syn keyword n1qlKeyword START
|
|
133 syn keyword n1qlKeyword STATISTICS
|
|
134 syn keyword n1qlKeyword SYSTEM
|
|
135 syn keyword n1qlKeyword THEN
|
|
136 syn keyword n1qlKeyword TRANSACTION
|
|
137 syn keyword n1qlKeyword TRIGGER
|
|
138 syn keyword n1qlKeyword UNDER
|
|
139 syn keyword n1qlKeyword UNKNOWN
|
|
140 syn keyword n1qlKeyword UNSET
|
|
141 syn keyword n1qlKeyword USE
|
|
142 syn keyword n1qlKeyword USER
|
|
143 syn keyword n1qlKeyword USING
|
|
144 syn keyword n1qlKeyword VALIDATE
|
|
145 syn keyword n1qlKeyword VALUE
|
|
146 syn keyword n1qlKeyword VALUED
|
|
147 syn keyword n1qlKeyword VALUES
|
|
148 syn keyword n1qlKeyword VIEW
|
|
149 syn keyword n1qlKeyword WHEN
|
|
150 syn keyword n1qlKeyword WHERE
|
|
151 syn keyword n1qlKeyword WHILE
|
|
152 syn keyword n1qlKeyword WITHIN
|
|
153 syn keyword n1qlKeyword WORK
|
|
154
|
|
155
|
|
156 "
|
|
157 " *** functions ***
|
|
158 "
|
|
159 syn keyword n1qlOperator ABS
|
|
160 syn keyword n1qlOperator ACOS
|
|
161 syn keyword n1qlOperator ARRAY_AGG
|
|
162 syn keyword n1qlOperator ARRAY_APPEND
|
|
163 syn keyword n1qlOperator ARRAY_AVG
|
|
164 syn keyword n1qlOperator ARRAY_CONCAT
|
|
165 syn keyword n1qlOperator ARRAY_CONTAINS
|
|
166 syn keyword n1qlOperator ARRAY_COUNT
|
|
167 syn keyword n1qlOperator ARRAY_DISTINCT
|
|
168 syn keyword n1qlOperator ARRAY_FLATTEN
|
|
169 syn keyword n1qlOperator ARRAY_IFNULL
|
|
170 syn keyword n1qlOperator ARRAY_INSERT
|
|
171 syn keyword n1qlOperator ARRAY_INTERSECT
|
|
172 syn keyword n1qlOperator ARRAY_LENGTH
|
|
173 syn keyword n1qlOperator ARRAY_MAX
|
|
174 syn keyword n1qlOperator ARRAY_MIN
|
|
175 syn keyword n1qlOperator ARRAY_POSITION
|
|
176 syn keyword n1qlOperator ARRAY_PREPEND
|
|
177 syn keyword n1qlOperator ARRAY_PUT
|
|
178 syn keyword n1qlOperator ARRAY_RANGE
|
|
179 syn keyword n1qlOperator ARRAY_REMOVE
|
|
180 syn keyword n1qlOperator ARRAY_REPEAT
|
|
181 syn keyword n1qlOperator ARRAY_REPLACE
|
|
182 syn keyword n1qlOperator ARRAY_REVERSE
|
|
183 syn keyword n1qlOperator ARRAY_SORT
|
|
184 syn keyword n1qlOperator ARRAY_START
|
|
185 syn keyword n1qlOperator ARRAY_SUM
|
|
186 syn keyword n1qlOperator ARRAY_SYMDIFF
|
|
187 syn keyword n1qlOperator ARRAY_UNION
|
|
188 syn keyword n1qlOperator ASIN
|
|
189 syn keyword n1qlOperator ATAN
|
|
190 syn keyword n1qlOperator ATAN2
|
|
191 syn keyword n1qlOperator AVG
|
|
192 syn keyword n1qlOperator BASE64
|
|
193 syn keyword n1qlOperator BASE64_DECODE
|
|
194 syn keyword n1qlOperator BASE64_ENCODE
|
|
195 syn keyword n1qlOperator CEIL
|
|
196 syn keyword n1qlOperator CLOCK_LOCAL
|
|
197 syn keyword n1qlOperator CLOCK_STR
|
|
198 syn keyword n1qlOperator CLOCK_TZ
|
|
199 syn keyword n1qlOperator CLOCK_UTC
|
|
200 syn keyword n1qlOperator CLOCL_MILLIS
|
|
201 syn keyword n1qlOperator CONTAINS
|
|
202 syn keyword n1qlOperator COS
|
|
203 syn keyword n1qlOperator COUNT
|
|
204 syn keyword n1qlOperator DATE_ADD_MILLIS
|
|
205 syn keyword n1qlOperator DATE_ADD_STR
|
|
206 syn keyword n1qlOperator DATE_DIFF_MILLIS
|
|
207 syn keyword n1qlOperator DATE_DIFF_STR
|
|
208 syn keyword n1qlOperator DATE_FORMAT_STR
|
|
209 syn keyword n1qlOperator DATE_PART_MILLIS
|
|
210 syn keyword n1qlOperator DATE_PART_STR
|
|
211 syn keyword n1qlOperator DATE_RANGE_MILLIS
|
|
212 syn keyword n1qlOperator DATE_RANGE_STR
|
|
213 syn keyword n1qlOperator DATE_TRUC_STR
|
|
214 syn keyword n1qlOperator DATE_TRUNC_MILLIS
|
|
215 syn keyword n1qlOperator DECODE_JSON
|
|
216 syn keyword n1qlOperator DEGREES
|
|
217 syn keyword n1qlOperator DURATION_TO_STR
|
|
218 syn keyword n1qlOperator E
|
|
219 syn keyword n1qlOperator ENCODED_SIZE
|
|
220 syn keyword n1qlOperator ENCODE_JSON
|
|
221 syn keyword n1qlOperator EXP
|
|
222 syn keyword n1qlOperator FLOOR
|
|
223 syn keyword n1qlOperator GREATEST
|
|
224 syn keyword n1qlOperator IFINF
|
|
225 syn keyword n1qlOperator IFMISSING
|
|
226 syn keyword n1qlOperator IFMISSINGORNULL
|
|
227 syn keyword n1qlOperator IFNAN
|
|
228 syn keyword n1qlOperator IFNANORINF
|
|
229 syn keyword n1qlOperator IFNULL
|
|
230 syn keyword n1qlOperator INITCAP
|
|
231 syn keyword n1qlOperator ISARRAY
|
|
232 syn keyword n1qlOperator ISATOM
|
|
233 syn keyword n1qlOperator ISBOOLEAN
|
|
234 syn keyword n1qlOperator ISNUMBER
|
|
235 syn keyword n1qlOperator ISOBJECT
|
|
236 syn keyword n1qlOperator ISSTRING
|
|
237 syn keyword n1qlOperator LEAST
|
|
238 syn keyword n1qlOperator LENGTH
|
|
239 syn keyword n1qlOperator LN
|
|
240 syn keyword n1qlOperator LOG
|
|
241 syn keyword n1qlOperator LOWER
|
|
242 syn keyword n1qlOperator LTRIM
|
|
243 syn keyword n1qlOperator MAX
|
|
244 syn keyword n1qlOperator META
|
|
245 syn keyword n1qlOperator MILLIS
|
|
246 syn keyword n1qlOperator MILLIS_TO_LOCAL
|
|
247 syn keyword n1qlOperator MILLIS_TO_STR
|
|
248 syn keyword n1qlOperator MILLIS_TO_TZ
|
|
249 syn keyword n1qlOperator MILLIS_TO_UTC
|
|
250 syn keyword n1qlOperator MILLIS_TO_ZONE_NAME
|
|
251 syn keyword n1qlOperator MIN
|
|
252 syn keyword n1qlOperator MISSINGIF
|
|
253 syn keyword n1qlOperator NANIF
|
|
254 syn keyword n1qlOperator NEGINFIF
|
|
255 syn keyword n1qlOperator NOW_LOCAL
|
|
256 syn keyword n1qlOperator NOW_MILLIS
|
|
257 syn keyword n1qlOperator NOW_STR
|
|
258 syn keyword n1qlOperator NOW_TZ
|
|
259 syn keyword n1qlOperator NOW_UTC
|
|
260 syn keyword n1qlOperator NULLIF
|
|
261 syn keyword n1qlOperator OBJECT_ADD
|
|
262 syn keyword n1qlOperator OBJECT_CONCAT
|
|
263 syn keyword n1qlOperator OBJECT_INNER_PAIRS
|
|
264 syn keyword n1qlOperator OBJECT_INNER_VALUES
|
|
265 syn keyword n1qlOperator OBJECT_LENGTH
|
|
266 syn keyword n1qlOperator OBJECT_NAMES
|
|
267 syn keyword n1qlOperator OBJECT_PAIRS
|
|
268 syn keyword n1qlOperator OBJECT_PUT
|
|
269 syn keyword n1qlOperator OBJECT_REMOVE
|
|
270 syn keyword n1qlOperator OBJECT_RENAME
|
|
271 syn keyword n1qlOperator OBJECT_REPLACE
|
|
272 syn keyword n1qlOperator OBJECT_UNWRAP
|
|
273 syn keyword n1qlOperator OBJECT_VALUES
|
|
274 syn keyword n1qlOperator PI
|
|
275 syn keyword n1qlOperator POLY_LENGTH
|
|
276 syn keyword n1qlOperator POSINIF
|
|
277 syn keyword n1qlOperator POSITION
|
|
278 syn keyword n1qlOperator POWER
|
|
279 syn keyword n1qlOperator RADIANS
|
|
280 syn keyword n1qlOperator RANDOM
|
|
281 syn keyword n1qlOperator REGEXP_CONTAINS
|
|
282 syn keyword n1qlOperator REGEXP_LIKE
|
|
283 syn keyword n1qlOperator REGEXP_POSITION
|
|
284 syn keyword n1qlOperator REGEXP_REPLACE
|
|
285 syn keyword n1qlOperator REPEAT
|
|
286 syn keyword n1qlOperator REPLACE
|
|
287 syn keyword n1qlOperator REVERSE
|
|
288 syn keyword n1qlOperator ROUND
|
|
289 syn keyword n1qlOperator RTRIM
|
|
290 syn keyword n1qlOperator SIGN
|
|
291 syn keyword n1qlOperator SIN
|
|
292 syn keyword n1qlOperator SPLIT
|
|
293 syn keyword n1qlOperator SQRT
|
|
294 syn keyword n1qlOperator STR_TO_DURATION
|
|
295 syn keyword n1qlOperator STR_TO_MILLIS
|
|
296 syn keyword n1qlOperator STR_TO_TZ
|
|
297 syn keyword n1qlOperator STR_TO_UTC
|
|
298 syn keyword n1qlOperator STR_TO_ZONE_NAME
|
|
299 syn keyword n1qlOperator SUBSTR
|
|
300 syn keyword n1qlOperator SUFFIXES
|
|
301 syn keyword n1qlOperator SUM
|
|
302 syn keyword n1qlOperator TAN
|
|
303 syn keyword n1qlOperator TITLE
|
|
304 syn keyword n1qlOperator TOARRAY
|
|
305 syn keyword n1qlOperator TOATOM
|
|
306 syn keyword n1qlOperator TOBOOLEAN
|
|
307 syn keyword n1qlOperator TOKENS
|
|
308 syn keyword n1qlOperator TONUMBER
|
|
309 syn keyword n1qlOperator TOOBJECT
|
|
310 syn keyword n1qlOperator TOSTRING
|
|
311 syn keyword n1qlOperator TRIM
|
|
312 syn keyword n1qlOperator TRUNC
|
|
313 syn keyword n1qlOperator TYPE
|
|
314 syn keyword n1qlOperator UPPER
|
|
315 syn keyword n1qlOperator UUID
|
|
316 syn keyword n1qlOperator WEEKDAY_MILLIS
|
|
317 syn keyword n1qlOperator WEEKDAY_STR
|
|
318
|
|
319
|
|
320 "
|
|
321 " *** operators ***
|
|
322 "
|
|
323 syn keyword n1qlOperator AND
|
|
324 syn keyword n1qlOperator AS
|
|
325 syn keyword n1qlOperator BY
|
|
326 syn keyword n1qlOperator DISTINCT
|
|
327 syn keyword n1qlOperator EXCEPT
|
|
328 syn keyword n1qlOperator ILIKE
|
|
329 syn keyword n1qlOperator IN
|
|
330 syn keyword n1qlOperator INTERSECT
|
|
331 syn keyword n1qlOperator IS
|
|
332 syn keyword n1qlOperator JOIN
|
|
333 syn keyword n1qlOperator LEFT
|
|
334 syn keyword n1qlOperator LIKE
|
|
335 syn keyword n1qlOperator MINUS
|
|
336 syn keyword n1qlOperator NEST
|
|
337 syn keyword n1qlOperator NESTING
|
|
338 syn keyword n1qlOperator NOT
|
|
339 syn keyword n1qlOperator OFFSET
|
|
340 syn keyword n1qlOperator ON
|
|
341 syn keyword n1qlOperator OR
|
|
342 syn keyword n1qlOperator OUT
|
|
343 syn keyword n1qlOperator RIGHT
|
|
344 syn keyword n1qlOperator SOME
|
|
345 syn keyword n1qlOperator TO
|
|
346 syn keyword n1qlOperator UNION
|
|
347 syn keyword n1qlOperator UNIQUE
|
|
348 syn keyword n1qlOperator UNNEST
|
|
349 syn keyword n1qlOperator VIA
|
|
350 syn keyword n1qlOperator WITH
|
|
351 syn keyword n1qlOperator XOR
|
|
352
|
|
353
|
|
354 "
|
|
355 " *** statements ***
|
|
356 "
|
|
357 syn keyword n1qlStatement ALTER
|
|
358 syn keyword n1qlStatement ANALYZE
|
|
359 syn keyword n1qlStatement BUILD
|
|
360 syn keyword n1qlStatement COMMIT
|
|
361 syn keyword n1qlStatement CREATE
|
|
362 syn keyword n1qlStatement DELETE
|
|
363 syn keyword n1qlStatement DROP
|
|
364 syn keyword n1qlStatement EXECUTE
|
|
365 syn keyword n1qlStatement EXPLAIN
|
|
366 syn keyword n1qlStatement GRANT
|
|
367 syn keyword n1qlStatement INFER
|
|
368 syn keyword n1qlStatement INSERT
|
|
369 syn keyword n1qlStatement MERGE
|
|
370 syn keyword n1qlStatement PREPARE
|
|
371 syn keyword n1qlStatement RENAME
|
|
372 syn keyword n1qlStatement REVOKE
|
|
373 syn keyword n1qlStatement ROLLBACK
|
|
374 syn keyword n1qlStatement SELECT
|
|
375 syn keyword n1qlStatement SET
|
|
376 syn keyword n1qlStatement TRUNCATE
|
|
377 syn keyword n1qlStatement UPDATE
|
|
378 syn keyword n1qlStatement UPSERT
|
|
379
|
|
380
|
|
381 "
|
|
382 " *** types ***
|
|
383 "
|
|
384 syn keyword n1qlType ARRAY
|
|
385 syn keyword n1qlType BINARY
|
|
386 syn keyword n1qlType BOOLEAN
|
|
387 syn keyword n1qlType NUMBER
|
|
388 syn keyword n1qlType OBJECT
|
|
389 syn keyword n1qlType RAW
|
|
390 syn keyword n1qlType STRING
|
|
391
|
|
392
|
|
393 "
|
|
394 " *** strings and characters ***
|
|
395 "
|
|
396 syn region n1qlString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
|
397 syn region n1qlString start=+'+ skip=+\\\\\|\\'+ end=+'+
|
|
398 syn region n1qlBucketSpec start=+`+ skip=+\\\\\|\\'+ end=+`+
|
|
399
|
|
400
|
|
401 "
|
|
402 " *** numbers ***
|
|
403 "
|
|
404 syn match n1qlNumber "-\=\<\d*\.\=[0-9_]\>"
|
|
405
|
|
406
|
|
407 "
|
|
408 " *** comments ***
|
|
409 "
|
|
410 syn region n1qlComment start="/\*" end="\*/" contains=n1qlTODO
|
|
411 syn match n1qlComment "--.*$" contains=n1qlTODO
|
|
412 syn sync ccomment n1qlComment
|
|
413
|
|
414
|
|
415 "
|
|
416 " *** TODO ***
|
|
417 "
|
|
418 syn keyword n1qlTODO contained TODO FIXME XXX DEBUG NOTE
|
|
419
|
|
420
|
|
421 "
|
|
422 " *** enable ***
|
|
423 "
|
|
424 hi def link n1qlBucketSpec Underlined
|
|
425 hi def link n1qlComment Comment
|
|
426 hi def link n1qlKeyword Macro
|
|
427 hi def link n1qlOperator Function
|
|
428 hi def link n1qlSpecial Special
|
|
429 hi def link n1qlStatement Statement
|
|
430 hi def link n1qlString String
|
|
431 hi def link n1qlTODO Todo
|
|
432 hi def link n1qlType Type
|
|
433
|
|
434 let b:current_syntax = "n1ql"
|