source: node_modules/refractor/lang/kusto.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.9 KB
Line 
1'use strict'
2
3module.exports = kusto
4kusto.displayName = 'kusto'
5kusto.aliases = []
6function kusto(Prism) {
7 Prism.languages.kusto = {
8 comment: {
9 pattern: /\/\/.*/,
10 greedy: true
11 },
12 string: {
13 pattern:
14 /```[\s\S]*?```|[hH]?(?:"(?:[^\r\n\\"]|\\.)*"|'(?:[^\r\n\\']|\\.)*'|@(?:"[^\r\n"]*"|'[^\r\n']*'))/,
15 greedy: true
16 },
17 verb: {
18 pattern: /(\|\s*)[a-z][\w-]*/i,
19 lookbehind: true,
20 alias: 'keyword'
21 },
22 command: {
23 pattern: /\.[a-z][a-z\d-]*\b/,
24 alias: 'keyword'
25 },
26 'class-name':
27 /\b(?:bool|datetime|decimal|dynamic|guid|int|long|real|string|timespan)\b/,
28 keyword:
29 /\b(?:access|alias|and|anti|as|asc|auto|between|by|(?:contains|(?:ends|starts)with|has(?:perfix|suffix)?)(?:_cs)?|database|declare|desc|external|from|fullouter|has_all|in|ingestion|inline|inner|innerunique|into|(?:left|right)(?:anti(?:semi)?|inner|outer|semi)?|let|like|local|not|of|on|or|pattern|print|query_parameters|range|restrict|schema|set|step|table|tables|to|view|where|with|matches\s+regex|nulls\s+(?:first|last))(?![\w-])/,
30 boolean: /\b(?:false|null|true)\b/,
31 function: /\b[a-z_]\w*(?=\s*\()/,
32 datetime: [
33 {
34 // RFC 822 + RFC 850
35 pattern:
36 /\b(?:(?:Fri|Friday|Mon|Monday|Sat|Saturday|Sun|Sunday|Thu|Thursday|Tue|Tuesday|Wed|Wednesday)\s*,\s*)?\d{1,2}(?:\s+|-)(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)(?:\s+|-)\d{2}\s+\d{2}:\d{2}(?::\d{2})?(?:\s*(?:\b(?:[A-Z]|(?:[ECMT][DS]|GM|U)T)|[+-]\d{4}))?\b/,
37 alias: 'number'
38 },
39 {
40 // ISO 8601
41 pattern:
42 /[+-]?\b(?:\d{4}-\d{2}-\d{2}(?:[ T]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)?|\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)Z?/,
43 alias: 'number'
44 }
45 ],
46 number:
47 /\b(?:0x[0-9A-Fa-f]+|\d+(?:\.\d+)?(?:[Ee][+-]?\d+)?)(?:(?:min|sec|[mnµ]s|[dhms]|microsecond|tick)\b)?|[+-]?\binf\b/,
48 operator: /=>|[!=]~|[!=<>]=?|[-+*/%|]|\.\./,
49 punctuation: /[()\[\]{},;.:]/
50 }
51}
Note: See TracBrowser for help on using the repository browser.