@elastic/monaco-esql 3.1.4 → 3.1.6
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/README.md +1 -0
- package/lib/monarch.js +5 -2
- package/package.json +1 -1
package/README.md
CHANGED
package/lib/monarch.js
CHANGED
|
@@ -25,6 +25,7 @@ const create = (deps = {}) => {
|
|
|
25
25
|
escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
|
|
26
26
|
digits: /\d+(_+\d+)*/,
|
|
27
27
|
symbols: /[=><!~:&|+\-*\/\^%\.,]+/,
|
|
28
|
+
columnIdentifier: /[a-zA-Z0-9_\*\-]+/,
|
|
28
29
|
brackets: [
|
|
29
30
|
{ open: "[", close: "]", token: "delimiter.square" },
|
|
30
31
|
{ open: "(", close: ")", token: "delimiter.parenthesis" },
|
|
@@ -36,7 +37,7 @@ const create = (deps = {}) => {
|
|
|
36
37
|
{ include: "@whitespace" },
|
|
37
38
|
// Keywords
|
|
38
39
|
[
|
|
39
|
-
/@?[a-zA-Z_$][\w$]*(
|
|
40
|
+
/@?[a-zA-Z_$][\w$]*(?![\.\-:])/,
|
|
40
41
|
{
|
|
41
42
|
cases: {
|
|
42
43
|
"@sourceCommands": { token: "keyword.command.source.$0" },
|
|
@@ -115,6 +116,8 @@ const create = (deps = {}) => {
|
|
|
115
116
|
expression: [
|
|
116
117
|
{ include: "@whitespace" },
|
|
117
118
|
{ include: "@literal" },
|
|
119
|
+
// Basic ES|QL columns (fields), e.g.: "field", "nested.field", etc.
|
|
120
|
+
[/(@columnIdentifier)(\.(@columnIdentifier))*/, "identifier.column"],
|
|
118
121
|
// Inline casts: 1.3::INTEGER
|
|
119
122
|
[/::\w+\b/, "type"],
|
|
120
123
|
// strings
|
|
@@ -143,7 +146,7 @@ const create = (deps = {}) => {
|
|
|
143
146
|
timeInterval: [[`(@digits)\\s*(${timeUnits.join("|")})`, "number.time"]],
|
|
144
147
|
number: [
|
|
145
148
|
[/(@digits)[eE]([\-+]?(@digits))?/, "number.float"],
|
|
146
|
-
[/(@digits)
|
|
149
|
+
[/(@digits)?\.(@digits)([eE][\-+]?(@digits))?/, "number.float"],
|
|
147
150
|
[/(@digits)/, "number"],
|
|
148
151
|
],
|
|
149
152
|
// Single double-quote strings: "str"
|