dolphindb 2.0.920 → 2.0.921

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/language.js DELETED
@@ -1,832 +0,0 @@
1
- export const keywords = [
2
- 'assert',
3
- 'const',
4
- 'mutable',
5
- 'def',
6
- 'defg',
7
- 'map',
8
- 'mapr',
9
- 'timer',
10
- // 流程控制
11
- 'if',
12
- 'else',
13
- 'do',
14
- 'for',
15
- 'while',
16
- 'return',
17
- 'continue',
18
- 'break',
19
- 'try',
20
- 'catch',
21
- 'throw',
22
- 'go',
23
- // 模块
24
- 'use',
25
- 'module',
26
- // 仅 Python 有的
27
- 'and',
28
- 'async',
29
- 'await',
30
- 'class',
31
- 'del',
32
- 'elif',
33
- 'except',
34
- 'finally',
35
- 'global',
36
- 'import',
37
- 'is',
38
- 'lambda',
39
- 'nonlocal',
40
- 'not',
41
- 'or',
42
- 'pass',
43
- 'raise',
44
- 'with',
45
- 'yield',
46
- // SQL
47
- 'select',
48
- 'exec',
49
- 'update',
50
- 'insert',
51
- 'create',
52
- 'alter',
53
- 'delete',
54
- 'transaction',
55
- 'inner join',
56
- 'full join',
57
- 'left join',
58
- 'left semijoin',
59
- 'context by',
60
- 'partitioned by',
61
- 'group by',
62
- 'pivot by',
63
- 'order by',
64
- 'cgroup by',
65
- 'csort',
66
- 'limit',
67
- 'top',
68
- 'into',
69
- 'from',
70
- 'where',
71
- 'having',
72
- 'set',
73
- 'as',
74
- 'in',
75
- 'on',
76
- 'values',
77
- 'asc',
78
- 'desc',
79
- ];
80
- export const constants = [
81
- 'NULL',
82
- 'true',
83
- 'false',
84
- 'pi',
85
- 'e',
86
- // --- form
87
- 'SCALAR',
88
- 'VECTOR',
89
- 'PAIR',
90
- 'MATRIX',
91
- 'SET',
92
- 'DICT',
93
- 'TABLE',
94
- // 'CHART',
95
- // 'CHUNK',
96
- // --- type
97
- 'VOID',
98
- 'BOOL',
99
- 'CHAR',
100
- 'SHORT',
101
- 'INT', 'INDEX',
102
- 'LONG',
103
- 'DATE',
104
- 'MONTH',
105
- 'TIME',
106
- 'MINUTE',
107
- 'SECOND',
108
- 'DATETIME',
109
- 'TIMESTAMP',
110
- 'NANOTIME',
111
- 'NANOTIMESTAMP',
112
- 'FLOAT',
113
- 'DOUBLE',
114
- 'SYMBOL',
115
- 'STRING',
116
- 'UUID',
117
- 'FUNCTIONDEF',
118
- 'HANDLE',
119
- 'CODE',
120
- 'DATASOURCE',
121
- 'RESOURCE',
122
- 'ANY',
123
- // 'COMPRESS',
124
- 'DICTIONARY',
125
- 'DATEHOUR',
126
- 'IPADDR',
127
- 'INT128',
128
- 'BLOB',
129
- 'COMPLEX',
130
- 'POINT',
131
- 'DURATION',
132
- 'OBJECT',
133
- 'DECIMAL32',
134
- 'DECIMAL64',
135
- // partition type
136
- 'SEQ',
137
- 'RANGE',
138
- 'HASH',
139
- 'VALUE',
140
- 'LIST',
141
- 'COMPO',
142
- // defined
143
- // https://www.dolphindb.cn/cn/help/FunctionsandCommands/FunctionReferences/d/defined.html
144
- 'VAR',
145
- 'SHARED',
146
- 'DEF',
147
- 'GLOBAL',
148
- // 用户权限管理
149
- // https://www.dolphindb.cn/cn/help/200/FunctionsandCommands/CommandsReferences/d/deny.html
150
- 'TABLE_READ',
151
- 'TABLE_WRITE',
152
- 'DBOBJ_CREATE',
153
- 'DBOBJ_DELETE',
154
- 'DB_MANAGE',
155
- 'DB_OWNER',
156
- 'VIEW_EXEC',
157
- 'SCRIPT_EXEC',
158
- 'TEST_EXEC',
159
- // hint
160
- // https://www.dolphindb.cn/cn/help/200/FunctionsandCommands/FunctionReferences/s/sql.html
161
- 'HINT_HASH',
162
- 'HINT_SNAPSHOT',
163
- 'HINT_KEEPORDER',
164
- 'HINT_SEQ',
165
- 'HINT_EXPLAIN',
166
- 'HINT_VECTORIZED',
167
- // --- seek mode
168
- 'HEAD',
169
- 'CURRENT',
170
- 'TAIL',
171
- // --- chart type
172
- // https://www.dolphindb.cn/cn/help/200/FunctionsandCommands/FunctionReferences/p/plot.html
173
- 'LINE',
174
- 'PIE',
175
- 'COLUMN',
176
- 'BAR',
177
- 'AREA',
178
- 'SCATTER',
179
- 'HISTOGRAM',
180
- 'KLINE',
181
- // --- log level
182
- 'DEBUG',
183
- 'INFO',
184
- 'WARNING',
185
- 'ERROR',
186
- // keep duplicates
187
- // https://www.dolphindb.cn/cn/help/200/FunctionsandCommands/FunctionReferences/c/createPartitionedTable.html?highlight=first
188
- 'FIRST',
189
- 'LAST',
190
- 'ALL',
191
- // keep
192
- // https://www.dolphindb.cn/cn/help/200/FunctionsandCommands/FunctionReferences/i/isDuplicated.html?highlight=none
193
- 'NONE',
194
- 'HASH_PTN',
195
- // 仅 Python 有的
196
- 'True',
197
- 'False',
198
- 'None',
199
- ];
200
- export const tm_language = {
201
- '$schema': 'https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json',
202
- name: 'DolphinDB',
203
- scopeName: 'source.dolphindb',
204
- patterns: [
205
- {
206
- match: '\\.\\.\\.',
207
- name: 'invalid.ellipsis.dolphindb'
208
- },
209
- {
210
- include: '#keyword'
211
- },
212
- {
213
- include: '#literal'
214
- },
215
- {
216
- include: '#comment'
217
- },
218
- {
219
- include: '#decorator'
220
- },
221
- {
222
- include: '#variable'
223
- },
224
- {
225
- include: '#operator'
226
- },
227
- {
228
- include: '#method_call'
229
- },
230
- {
231
- include: '#function_call'
232
- },
233
- {
234
- include: '#property'
235
- },
236
- {
237
- match: ';',
238
- name: 'punctuation.terminator.statement.dolphindb'
239
- },
240
- {
241
- match: ',',
242
- name: 'punctuation.separator.commma.dolphindb'
243
- }
244
- ],
245
- repository: {
246
- keyword: {
247
- // \b: word boundary
248
- // (?<![.$]): boundary 不是 . 或 $
249
- // ?!\s*: 不是 label
250
- match: `\\b(?<![.$])(${keywords.join('|')})(?!(\\s*:|\\())\\b`,
251
- name: 'keyword.control.dolphindb'
252
- },
253
- literal: {
254
- patterns: [
255
- { include: '#constant' },
256
- { include: '#datetime' },
257
- { include: '#string' },
258
- { include: '#number' },
259
- ]
260
- },
261
- constant: {
262
- match: `\\b(?<![.$])(${constants.join('|')})(?!\\s*:)\\b`,
263
- name: 'constant.language.int.dolphindb'
264
- },
265
- decorator: {
266
- match: '^@testing',
267
- name: 'meta.decorator.dolphindb',
268
- },
269
- datetime: {
270
- patterns: [
271
- {
272
- match: '\\b[0-9]{4}[.][0-9]{2}[.][0-9]{2}[T ][0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{3,9})?\\b',
273
- name: 'constant.numeric.datetime.datetime.dolphindb',
274
- },
275
- {
276
- match: '\\b[0-9]{4}\\.[0-9]{2}M\\b',
277
- name: 'constant.numeric.datetime.month.dolphindb',
278
- },
279
- {
280
- match: '\\b[0-9]{4}\\.[0-9]{2}\\.[0-9]{2}\\b',
281
- name: 'constant.numeric.datetime.date.dolphindb',
282
- },
283
- {
284
- match: '\\b[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{3,9})?\\b',
285
- name: 'constant.numeric.datetime.time.dolphindb',
286
- },
287
- {
288
- match: '\\b[0-9]{2}:[0-9]{2}m\\b',
289
- name: 'constant.numeric.datetime.minute.dolphindb',
290
- },
291
- ]
292
- },
293
- string: {
294
- patterns: [
295
- {
296
- include: '#string_single_quoted'
297
- },
298
- {
299
- include: '#string_double_quoted'
300
- },
301
- {
302
- begin: "'''",
303
- beginCaptures: {
304
- 0: {
305
- name: 'punctuation.definition.string.begin.dolphindb'
306
- }
307
- },
308
- end: "'''",
309
- endCaptures: {
310
- 0: {
311
- name: 'punctuation.definition.string.end.dolphindb'
312
- }
313
- },
314
- name: 'string.quoted.single.heredoc.dolphindb',
315
- patterns: [
316
- {
317
- captures: {
318
- 1: {
319
- name: 'punctuation.definition.escape.backslash.dolphindb'
320
- }
321
- },
322
- match: '(\\\\).',
323
- name: 'constant.character.escape.backslash.dolphindb'
324
- }
325
- ]
326
- },
327
- {
328
- begin: '"""',
329
- beginCaptures: {
330
- 0: {
331
- name: 'punctuation.definition.string.begin.dolphindb'
332
- }
333
- },
334
- end: '"""',
335
- endCaptures: {
336
- 0: {
337
- name: 'punctuation.definition.string.end.dolphindb'
338
- }
339
- },
340
- name: 'string.quoted.double.heredoc.dolphindb',
341
- patterns: [
342
- {
343
- captures: {
344
- 1: {
345
- name: 'punctuation.definition.escape.backslash.dolphindb'
346
- }
347
- },
348
- match: '(\\\\).',
349
- name: 'constant.character.escape.backslash.dolphindb'
350
- },
351
- {
352
- include: '#interpolated_dolphindb'
353
- }
354
- ]
355
- },
356
- {
357
- match: '`[\\w@]+',
358
- name: 'string.quoted.other.dolphindb'
359
- },
360
- {
361
- match: '(`)(.*)(`)',
362
- name: 'string.quoted.script.dolphindb',
363
- captures: {
364
- 1: {
365
- name: 'punctuation.definition.string.begin.dolphindb'
366
- },
367
- 2: {
368
- name: 'source.js.embedded.dolphindb',
369
- patterns: [
370
- {
371
- include: 'source.js'
372
- }
373
- ]
374
- },
375
- 3: {
376
- name: 'punctuation.definition.string.end.dolphindb'
377
- }
378
- }
379
- }
380
- ]
381
- },
382
- number: {
383
- patterns: [
384
- {
385
- match: '\\b[01]+[bB]\\b',
386
- name: 'constant.numeric.binary.dolphindb'
387
- },
388
- {
389
- // 97c
390
- match: '\\b[0-9]+([clhsmyM]|ms)\\b',
391
- name: 'constant.numeric.dolphindb'
392
- },
393
- {
394
- // 1.2f, 1f
395
- match: '\\b[0-9]+(\\.[0-9]+)?f\\b',
396
- name: 'constant.numeric.dolphindb'
397
- },
398
- {
399
- match: '(?x)\n' +
400
- '(?:\n' +
401
- ' (?:\\b[0-9]+(\\.)[0-9]+[eE][+-]?[0-9]+\\b)| # 1.1E+3\n' +
402
- ' (?:\\b[0-9]+(\\.)[eE][+-]?[0-9]+\\b)| # 1.E+3\n' +
403
- ' (?:\\b(\\.)[0-9]+[eE][+-]?[0-9]+\\b)| # .1E+3\n' +
404
- ' (?:\\b[0-9]+[eE][+-]?[0-9]+\\b)| # 1E+3\n' +
405
- ' (?:\\b[0-9]+(\\.)[0-9]+\\b)| # 1.1\n' +
406
- ' (?:\\b[0-9]+(?=\\.{2,3}))| # 1 followed by a slice\n' +
407
- ' (?:\\b[0-9]+(\\.)\\b)| # 1.\n' +
408
- ' (?:\\b(\\.)[0-9]+\\b)| # .1\n' +
409
- ' (?:\\b[0-9]+\\b(?!\\.)) # 1\n' +
410
- ')\n',
411
- captures: {
412
- 0: {
413
- name: 'constant.numeric.decimal.dolphindb'
414
- },
415
- 1: {
416
- name: 'punctuation.separator.decimal.period.dolphindb'
417
- },
418
- 2: {
419
- name: 'punctuation.separator.decimal.period.dolphindb'
420
- },
421
- 3: {
422
- name: 'punctuation.separator.decimal.period.dolphindb'
423
- },
424
- 4: {
425
- name: 'punctuation.separator.decimal.period.dolphindb'
426
- },
427
- 5: {
428
- name: 'punctuation.separator.decimal.period.dolphindb'
429
- },
430
- 6: {
431
- name: 'punctuation.separator.decimal.period.dolphindb'
432
- }
433
- }
434
- },
435
- ]
436
- },
437
- string_single_quoted: {
438
- patterns: [
439
- {
440
- begin: "'",
441
- beginCaptures: {
442
- 0: {
443
- name: 'punctuation.definition.string.begin.dolphindb'
444
- }
445
- },
446
- end: "'",
447
- endCaptures: {
448
- 0: {
449
- name: 'punctuation.definition.string.end.dolphindb'
450
- }
451
- },
452
- name: 'string.quoted.single.dolphindb',
453
- patterns: [
454
- {
455
- captures: {
456
- 1: {
457
- name: 'punctuation.definition.escape.backslash.dolphindb'
458
- }
459
- },
460
- match: '(\\\\)(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)',
461
- name: 'constant.character.escape.backslash.dolphindb'
462
- }
463
- ]
464
- }
465
- ]
466
- },
467
- string_double_quoted: {
468
- patterns: [
469
- {
470
- begin: '"',
471
- beginCaptures: {
472
- 0: {
473
- name: 'punctuation.definition.string.begin.dolphindb'
474
- }
475
- },
476
- end: '"',
477
- endCaptures: {
478
- 0: {
479
- name: 'punctuation.definition.string.end.dolphindb'
480
- }
481
- },
482
- name: 'string.quoted.double.dolphindb',
483
- patterns: [
484
- {
485
- captures: {
486
- 1: {
487
- name: 'punctuation.definition.escape.backslash.dolphindb'
488
- }
489
- },
490
- match: '(\\\\)(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)',
491
- name: 'constant.character.escape.backslash.dolphindb'
492
- },
493
- {
494
- include: '#interpolated_dolphindb'
495
- }
496
- ]
497
- }
498
- ]
499
- },
500
- function_call: {
501
- patterns: [
502
- {
503
- begin: '(@)?([\\w$]+!?)\\s*(?=\\()',
504
- beginCaptures: {
505
- 1: {
506
- name: 'variable.other.readwrite.instance.dolphindb'
507
- },
508
- 2: {
509
- patterns: [
510
- {
511
- include: '#function_name'
512
- }
513
- ]
514
- }
515
- },
516
- end: '(?<=\\))',
517
- name: 'meta.function-call.dolphindb',
518
- patterns: [
519
- {
520
- include: '#arguments'
521
- }
522
- ]
523
- }
524
- ]
525
- },
526
- function_name: {
527
- patterns: [
528
- {
529
- match: '[a-zA-Z_$][\\w$]*',
530
- name: 'entity.name.function.dolphindb'
531
- },
532
- {
533
- match: '\\d[\\w$]*',
534
- name: 'invalid.illegal.identifier.dolphindb'
535
- }
536
- ]
537
- },
538
- function_params: {
539
- patterns: [
540
- {
541
- begin: '\\(',
542
- beginCaptures: {
543
- 0: {
544
- name: 'punctuation.definition.parameters.begin.bracket.round.dolphindb'
545
- }
546
- },
547
- end: '\\)',
548
- endCaptures: {
549
- 0: {
550
- name: 'punctuation.definition.parameters.end.bracket.round.dolphindb'
551
- }
552
- },
553
- name: 'meta.parameters.dolphindb',
554
- patterns: [
555
- {
556
- include: '#variable'
557
- },
558
- {
559
- match: '(@(?:[a-zA-Z_$][\\w$]*)?)(\\.\\.\\.)?',
560
- captures: {
561
- 1: {
562
- name: 'variable.parameter.function.readwrite.instance.dolphindb'
563
- },
564
- 2: {
565
- name: 'keyword.operator.splat.dolphindb'
566
- }
567
- }
568
- },
569
- {
570
- include: '$self'
571
- }
572
- ]
573
- }
574
- ]
575
- },
576
- comment: {
577
- patterns: [
578
- {
579
- begin: '/\\*',
580
- beginCaptures: {
581
- 0: {
582
- name: 'punctuation.definition.comment.dolphindb'
583
- }
584
- },
585
- end: '\\*/',
586
- endCaptures: {
587
- 0: {
588
- name: 'punctuation.definition.comment.dolphindb'
589
- }
590
- },
591
- name: 'comment.block.dolphindb'
592
- },
593
- {
594
- begin: '//',
595
- beginCaptures: {
596
- 0: {
597
- name: 'punctuation.definition.comment.dolphindb'
598
- }
599
- },
600
- end: '$',
601
- name: 'comment.line.number-sign.dolphindb'
602
- },
603
- {
604
- begin: '#',
605
- beginCaptures: {
606
- 0: {
607
- name: 'punctuation.definition.comment.dolphindb'
608
- }
609
- },
610
- end: '$',
611
- name: 'comment.line.number-sign.dolphindb'
612
- }
613
- ]
614
- },
615
- arguments: {
616
- patterns: [
617
- {
618
- begin: '\\(',
619
- beginCaptures: {
620
- 0: {
621
- name: 'punctuation.definition.arguments.begin.bracket.round.dolphindb'
622
- }
623
- },
624
- end: '\\)',
625
- endCaptures: {
626
- 0: {
627
- name: 'punctuation.definition.arguments.end.bracket.round.dolphindb'
628
- }
629
- },
630
- name: 'meta.arguments.dolphindb',
631
- patterns: [
632
- {
633
- include: '$self'
634
- },
635
- {
636
- include: '#literal'
637
- },
638
- {
639
- include: '#variable'
640
- }
641
- ]
642
- }
643
- ]
644
- },
645
- variable: {
646
- patterns: [
647
- {
648
- match: '(@)([a-zA-Z_\\$]\\w*)?',
649
- name: 'variable.other.readwrite.instance.dolphindb'
650
- }
651
- ]
652
- },
653
- interpolated_dolphindb: {
654
- patterns: [
655
- {
656
- begin: '\\#\\{',
657
- captures: {
658
- 0: {
659
- name: 'punctuation.section.embedded.dolphindb'
660
- }
661
- },
662
- end: '\\}',
663
- name: 'source.dolphindb.embedded.source',
664
- patterns: [
665
- {
666
- include: '$self'
667
- }
668
- ]
669
- }
670
- ]
671
- },
672
- method_call: {
673
- patterns: [
674
- {
675
- begin: '(?:(\\.)|(::))\\s*([\\w$]+!?)(?=\\()',
676
- beginCaptures: {
677
- 1: {
678
- name: 'punctuation.separator.method.period.dolphindb'
679
- },
680
- 2: {
681
- name: 'keyword.operator.prototype.dolphindb'
682
- },
683
- 3: {
684
- patterns: [
685
- {
686
- include: '#method_name'
687
- }
688
- ]
689
- }
690
- },
691
- end: '(?<=\\))',
692
- name: 'meta.method-call.dolphindb',
693
- patterns: [
694
- {
695
- include: '#arguments'
696
- }
697
- ]
698
- }
699
- ]
700
- },
701
- method_name: {
702
- patterns: [
703
- {
704
- match: '[a-zA-Z_$][\\w$]*',
705
- name: 'entity.name.function.dolphindb'
706
- },
707
- {
708
- match: '\\d[\\w$]*',
709
- name: 'invalid.illegal.identifier.dolphindb'
710
- }
711
- ]
712
- },
713
- operator: {
714
- patterns: [
715
- {
716
- match: '<<|>>',
717
- name: 'keyword.operator.bitwise.shift.dolphindb'
718
- },
719
- {
720
- match: '!=|<=|>=|==',
721
- name: 'keyword.operator.comparison.dolphindb'
722
- },
723
- {
724
- match: '&&|!|\\|\\|',
725
- name: 'keyword.operator.logical.dolphindb'
726
- },
727
- {
728
- match: '&|\\||\\^',
729
- name: 'keyword.operator.bitwise.dolphindb'
730
- },
731
- {
732
- match: '\\.\\.',
733
- name: 'keyword.operator.splat.dolphindb'
734
- },
735
- {
736
- match: '\\?',
737
- name: 'keyword.operator.existential.dolphindb'
738
- },
739
- {
740
- match: '/|<-|%|\\*|/|-|\\$|\\+',
741
- name: 'keyword.operator.dolphindb'
742
- },
743
- {
744
- match: '([a-zA-Z$_][\\w$]*)?\\s*(=|:(?!:))(?![>=])',
745
- captures: {
746
- 1: {
747
- name: 'variable.assignment.dolphindb'
748
- },
749
- 2: {
750
- name: 'keyword.operator.assignment.dolphindb'
751
- }
752
- }
753
- }
754
- ]
755
- },
756
- property: {
757
- patterns: [
758
- {
759
- match: '(?:(\\.)|(::))\\s*([A-Z][A-Z0-9_$]*\\b\\$*)(?=\\s*\\??(\\.\\s*[a-zA-Z_$]\\w*|::))',
760
- captures: {
761
- 1: {
762
- name: 'punctuation.separator.property.period.dolphindb'
763
- },
764
- 2: {
765
- name: 'keyword.operator.prototype.dolphindb'
766
- },
767
- 3: {
768
- name: 'constant.other.object.property.dolphindb'
769
- }
770
- }
771
- },
772
- {
773
- match: '(?:(\\.)|(::))\\s*(\\$*[a-zA-Z_$][\\w$]*)(?=\\s*\\??(\\.\\s*[a-zA-Z_$]\\w*|::))',
774
- captures: {
775
- 1: {
776
- name: 'punctuation.separator.property.period.dolphindb'
777
- },
778
- 2: {
779
- name: 'keyword.operator.prototype.dolphindb'
780
- },
781
- 3: {
782
- name: 'variable.other.object.property.dolphindb'
783
- }
784
- }
785
- },
786
- {
787
- match: '(?:(\\.)|(::))\\s*([A-Z][A-Z0-9_$]*\\b\\$*)',
788
- captures: {
789
- 1: {
790
- name: 'punctuation.separator.property.period.dolphindb'
791
- },
792
- 2: {
793
- name: 'keyword.operator.prototype.dolphindb'
794
- },
795
- 3: {
796
- name: 'constant.other.property.dolphindb'
797
- }
798
- }
799
- },
800
- {
801
- match: '(?:(\\.)|(::))\\s*(\\$*[a-zA-Z_$][\\w$]*)',
802
- captures: {
803
- 1: {
804
- name: 'punctuation.separator.property.period.dolphindb'
805
- },
806
- 2: {
807
- name: 'keyword.operator.prototype.dolphindb'
808
- },
809
- 3: {
810
- name: 'variable.other.property.dolphindb'
811
- }
812
- }
813
- },
814
- {
815
- match: '(?:(\\.)|(::))\\s*([0-9][\\w$]*)',
816
- captures: {
817
- 1: {
818
- name: 'punctuation.separator.property.period.dolphindb'
819
- },
820
- 2: {
821
- name: 'keyword.operator.prototype.dolphindb'
822
- },
823
- 3: {
824
- name: 'invalid.illegal.identifier.dolphindb'
825
- }
826
- }
827
- }
828
- ]
829
- }
830
- }
831
- };
832
- //# sourceMappingURL=language.js.map