-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4433ccf
commit e008ea0
Showing
17 changed files
with
555 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
Prism.languages.kusto = { | ||
'comment': { | ||
pattern: /\/\/.*/, | ||
greedy: true | ||
}, | ||
'string': { | ||
pattern: /```[\s\S]*?```|[hH]?(?:"(?:[^\r\n\\"]|\\.)*"|'(?:[^\r\n\\']|\\.)*'|@(?:"[^\r\n"]*"|'[^\r\n']*'))/, | ||
greedy: true | ||
}, | ||
|
||
'verb': { | ||
pattern: /(\|\s*)[a-z][\w-]*/i, | ||
lookbehind: true, | ||
alias: 'keyword' | ||
}, | ||
|
||
'command': { | ||
pattern: /\.[a-z][a-z\d-]*\b/, | ||
alias: 'keyword' | ||
}, | ||
|
||
'class-name': /\b(?:bool|datetime|decimal|dynamic|guid|int|long|real|string|timespan)\b/, | ||
'keyword': /\b(?:access|alias|and|anti|as|asc|auto|between|by|database|declare|desc|external|from|fullouter|has_all|in|ingestion|inline|inner|innerunique|into|let|like|local|not|of|on|or|pattern|print|query_parameters|range|restrict|schema|set|step|table|tables|to|view|where|with|(?:has(?:perfix|suffix)?|contains|(?:starts|ends)with)(?:_cs)?|(?:left|right)(?:anti(?:semi)?|inner|outer|semi)?|matches\s+regex|nulls\s+(?:first|last))(?![\w-])/, | ||
'boolean': /\b(?:true|false|null)\b/, | ||
|
||
'function': /\b[a-z_]\w*(?=\s*\()/, | ||
|
||
'datetime': [ | ||
{ | ||
// RFC 822 + RFC 850 | ||
pattern: /\b(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday)\s*,\s*)?\d{1,2}(?:\s+|-)(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)(?:\s+|-)\d{2}\s+\d{2}:\d{2}(?::\d{2})?(?:\s*(?:\b(?:(?:U|GM|[ECMT][DS])T|[A-Z])|[+-]\d{4}))?\b/, | ||
alias: 'number' | ||
}, | ||
{ | ||
// ISO 8601 | ||
pattern: /[+-]?\b(?:\d{4}-\d{2}-\d{2}(?:[ T]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)?|\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)Z?/, | ||
alias: 'number' | ||
} | ||
], | ||
'number': /\b(?:0x[0-9A-Fa-f]+|\d+(?:\.\d+)?(?:[Ee][+-]?\d+)?)(?:(?:min|sec|[mnµ]s|tick|microsecond|[dhms])\b)?|[+-]?\binf\b/, | ||
|
||
'operator': /=>|[!=]~|[!=<>]=?|[-+*/%|]|\.\./, | ||
'punctuation': /[()\[\]{},;.:]/ | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<h2>Full example</h2> | ||
<pre><code>// Source: https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/tutorial?pivots=azuredataexplorer | ||
|
||
StormEvents | ||
| where StartTime > datetime(2007-02-01) and StartTime < datetime(2007-03-01) | ||
| where EventType == 'Flood' and State == 'CALIFORNIA' | ||
| project StartTime, EndTime , State , EventType , EpisodeNarrative | ||
</code></pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
true bool(true) | ||
false bool(false) | ||
bool(null) | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["boolean", "true"], | ||
["class-name", "bool"], | ||
["punctuation", "("], | ||
["boolean", "true"], | ||
["punctuation", ")"], | ||
|
||
["boolean", "false"], | ||
["class-name", "bool"], | ||
["punctuation", "("], | ||
["boolean", "false"], | ||
["punctuation", ")"], | ||
|
||
["class-name", "bool"], | ||
["punctuation", "("], | ||
["boolean", "null"], | ||
["punctuation", ")"] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
bool | ||
datetime | ||
decimal | ||
dynamic | ||
guid | ||
int | ||
long | ||
real | ||
string | ||
timespan | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["class-name", "bool"], | ||
["class-name", "datetime"], | ||
["class-name", "decimal"], | ||
["class-name", "dynamic"], | ||
["class-name", "guid"], | ||
["class-name", "int"], | ||
["class-name", "long"], | ||
["class-name", "real"], | ||
["class-name", "string"], | ||
["class-name", "timespan"] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.show tables | ||
| count | ||
|
||
.set foo=234 | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["command", ".show"], ["keyword", "tables"], | ||
["operator", "|"], ["verb", "count"], | ||
|
||
["command", ".set"], " foo", ["operator", "="], ["number", "234"] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// comment | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["comment", "// comment"] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// ISO 8601 | ||
2014-05-25T08:20:03.123456Z | ||
2014-05-25T08:20:03.123456 | ||
2014-05-25T08:20 | ||
2014-11-08 15:55:55.123456Z | ||
2014-11-08 15:55:55 | ||
2014-11-08 15:55 | ||
2014-11-08 | ||
|
||
// RFC 822 | ||
Sat, 8 Nov 14 15:05:02 GMT | ||
Sat, 8 Nov 14 15:05:02 | ||
Sat, 8 Nov 14 15:05 | ||
Sat, 8 Nov 14 15:05 GMT | ||
8 Nov 14 15:05:02 GMT | ||
8 Nov 14 15:05:02 | ||
8 Nov 14 15:05 | ||
8 Nov 14 15:05 GMT | ||
|
||
// RFC 850 | ||
Saturday, 08-Nov-14 15:05:02 GMT | ||
Saturday, 08-Nov-14 15:05:02 | ||
Saturday, 08-Nov-14 15:05 GMT | ||
Saturday, 08-Nov-14 15:05 | ||
08-Nov-14 15:05:02 GMT | ||
08-Nov-14 15:05:02 | ||
08-Nov-14 15:05 GMT | ||
08-Nov-14 15:05 | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["comment", "// ISO 8601"], | ||
["datetime", "2014-05-25T08:20:03.123456Z"], | ||
["datetime", "2014-05-25T08:20:03.123456"], | ||
["datetime", "2014-05-25T08:20"], | ||
["datetime", "2014-11-08 15:55:55.123456Z"], | ||
["datetime", "2014-11-08 15:55:55"], | ||
["datetime", "2014-11-08 15:55"], | ||
["datetime", "2014-11-08"], | ||
|
||
["comment", "// RFC 822"], | ||
["datetime", "Sat, 8 Nov 14 15:05:02 GMT"], | ||
["datetime", "Sat, 8 Nov 14 15:05:02"], | ||
["datetime", "Sat, 8 Nov 14 15:05"], | ||
["datetime", "Sat, 8 Nov 14 15:05 GMT"], | ||
["datetime", "8 Nov 14 15:05:02 GMT"], | ||
["datetime", "8 Nov 14 15:05:02"], | ||
["datetime", "8 Nov 14 15:05"], | ||
["datetime", "8 Nov 14 15:05 GMT"], | ||
|
||
["comment", "// RFC 850"], | ||
["datetime", "Saturday, 08-Nov-14 15:05:02 GMT"], | ||
["datetime", "Saturday, 08-Nov-14 15:05:02"], | ||
["datetime", "Saturday, 08-Nov-14 15:05 GMT"], | ||
["datetime", "Saturday, 08-Nov-14 15:05"], | ||
["datetime", "08-Nov-14 15:05:02 GMT"], | ||
["datetime", "08-Nov-14 15:05:02"], | ||
["datetime", "08-Nov-14 15:05 GMT"], | ||
["datetime", "08-Nov-14 15:05"] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
min() | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["function", "min"], | ||
["punctuation", "("], | ||
["punctuation", ")"] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
access | ||
alias | ||
and | ||
anti | ||
as | ||
asc | ||
auto | ||
between | ||
by | ||
contains | ||
contains_cs | ||
database | ||
declare | ||
desc | ||
endswith | ||
endswith_cs | ||
external | ||
from | ||
fullouter | ||
has | ||
has_all | ||
has_cs | ||
hasperfix | ||
hasperfix_cs | ||
hassuffix | ||
hassuffix_cs | ||
in | ||
ingestion | ||
inline | ||
inner | ||
innerunique | ||
into | ||
left | ||
leftanti | ||
leftantisemi | ||
leftinner | ||
leftouter | ||
leftsemi | ||
let | ||
like | ||
local | ||
matches regex | ||
not | ||
nulls first | ||
nulls last | ||
of | ||
on | ||
or | ||
pattern | ||
query_parameters | ||
range | ||
restrict | ||
right | ||
rightanti | ||
rightantisemi | ||
rightinner | ||
rightouter | ||
rightsemi | ||
schema | ||
set | ||
startswith | ||
startswith_cs | ||
step | ||
table | ||
tables | ||
to | ||
view | ||
where | ||
with | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["keyword", "access"], | ||
["keyword", "alias"], | ||
["keyword", "and"], | ||
["keyword", "anti"], | ||
["keyword", "as"], | ||
["keyword", "asc"], | ||
["keyword", "auto"], | ||
["keyword", "between"], | ||
["keyword", "by"], | ||
["keyword", "contains"], | ||
["keyword", "contains_cs"], | ||
["keyword", "database"], | ||
["keyword", "declare"], | ||
["keyword", "desc"], | ||
["keyword", "endswith"], | ||
["keyword", "endswith_cs"], | ||
["keyword", "external"], | ||
["keyword", "from"], | ||
["keyword", "fullouter"], | ||
["keyword", "has"], | ||
["keyword", "has_all"], | ||
["keyword", "has_cs"], | ||
["keyword", "hasperfix"], | ||
["keyword", "hasperfix_cs"], | ||
["keyword", "hassuffix"], | ||
["keyword", "hassuffix_cs"], | ||
["keyword", "in"], | ||
["keyword", "ingestion"], | ||
["keyword", "inline"], | ||
["keyword", "inner"], | ||
["keyword", "innerunique"], | ||
["keyword", "into"], | ||
["keyword", "left"], | ||
["keyword", "leftanti"], | ||
["keyword", "leftantisemi"], | ||
["keyword", "leftinner"], | ||
["keyword", "leftouter"], | ||
["keyword", "leftsemi"], | ||
["keyword", "let"], | ||
["keyword", "like"], | ||
["keyword", "local"], | ||
["keyword", "matches regex"], | ||
["keyword", "not"], | ||
["keyword", "nulls first"], | ||
["keyword", "nulls last"], | ||
["keyword", "of"], | ||
["keyword", "on"], | ||
["keyword", "or"], | ||
["keyword", "pattern"], | ||
["keyword", "print"], | ||
["keyword", "query_parameters"], | ||
["keyword", "range"], | ||
["keyword", "restrict"], | ||
["keyword", "right"], | ||
["keyword", "rightanti"], | ||
["keyword", "rightantisemi"], | ||
["keyword", "rightinner"], | ||
["keyword", "rightouter"], | ||
["keyword", "rightsemi"], | ||
["keyword", "schema"], | ||
["keyword", "set"], | ||
["keyword", "startswith"], | ||
["keyword", "startswith_cs"], | ||
["keyword", "step"], | ||
["keyword", "table"], | ||
["keyword", "tables"], | ||
["keyword", "to"], | ||
["keyword", "view"], | ||
["keyword", "where"], | ||
["keyword", "with"] | ||
] |
Oops, something went wrong.