@tenzir/codemirror-lang-tql 0.5.0 → 0.5.1

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 CHANGED
@@ -174,13 +174,18 @@ The highlight query's captures become these tags (`tqlCaptureTags`):
174
174
  | `attribute` | `tags.attributeName` |
175
175
  | `function` | `tags.function(tags.variableName)` |
176
176
  | `function.call` | `tags.function(tags.variableName)` |
177
+ | `function.operator` | `tags.function(tags.variableName)` |
177
178
  | `function.method` | `tags.function(tags.propertyName)` |
178
179
  | `string` | `tags.string` |
179
180
  | `string.escape` | `tags.escape` |
180
181
  | `string.special` | `tags.special(tags.string)` |
181
182
  | `number` | `tags.number` |
183
+ | `number.time` | `tags.number` |
184
+ | `number.duration` | `tags.number` |
182
185
  | `boolean` | `tags.bool` |
183
186
  | `constant` | `tags.constant(tags.name)` |
187
+ | `constant.ip` | `tags.constant(tags.name)` |
188
+ | `constant.subnet` | `tags.constant(tags.name)` |
184
189
  | `constant.builtin` | `tags.null` |
185
190
  | `variable` | `tags.variableName` |
186
191
  | `variable.builtin` | `tags.special(tags.variableName)` |
@@ -194,7 +199,11 @@ The highlight query's captures become these tags (`tqlCaptureTags`):
194
199
  | `punctuation.delimiter` | `tags.separator` |
195
200
 
196
201
  A capture without an entry takes the tag of the nearest capture it refines, so
197
- `function.builtin` would be a `function`. Captures starting with `_` never
202
+ `function.builtin` would be a `function`. Pipeline operators (`function.operator`),
203
+ times and durations (`number.time`, `number.duration`), and IP addresses and
204
+ subnets (`constant.ip`, `constant.subnet`) share the tags of the captures they
205
+ refine, so standard highlight styles color them as before, while
206
+ `tqlHighlighter` can color them apart by capture name. Captures starting with `_` never
198
207
  color.
199
208
 
200
209
  Captures follow tree-sitter's rules: an inner node's capture wins over the
package/dist/index.cjs CHANGED
@@ -8,7 +8,7 @@ var brackets = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-bra
8
8
 
9
9
  var folds = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-folds.mjs. DO NOT EDIT.\n\n[\n (then_block)\n (else_block)\n (pipeline_block)\n (pipeline_expression)\n (match_statement)\n (match_arm)\n (list)\n (record)\n (frontmatter)\n] @fold\n";
10
10
 
11
- var highlights = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-highlights.mjs. DO NOT EDIT.\n\n[\n \"let\"\n \"if\"\n \"else\"\n \"match\"\n \"and\"\n \"or\"\n \"not\"\n \"move\"\n \"in\"\n \"this\"\n \"?\"\n \".\"\n \"...\"\n \"[\"\n \"]\"\n \"{\"\n \"}\"\n \":\"\n] @keyword\n\n[\n \"+\"\n \"-\"\n \"*\"\n \"/\"\n] @keyword\n\n\"_\" @variable.builtin\n\n\"null\" @constant.builtin\n\n[\n \"true\"\n \"false\"\n] @boolean\n\n(dollar_var) @variable.builtin\n(global_sigil) @keyword\n(metadata_sigil) @keyword\n(meta_selector) @attribute\n(number) @number\n(string) @string\n(format_expr) @string\n(ip) @constant\n(subnet) @constant\n(time) @number\n(duration) @number\n(frontmatter_open) @comment\n(frontmatter_close) @comment\n(comment) @comment\n\n(invocation\n operator: (entity) @function.call)\n(call_expression\n (entity) @function.call)\n(call_expression\n method: (entity) @function.method)\n((identifier) @variable.builtin (#match? @variable.builtin \"^\\$[A-Za-z_]\\w*$\"))\n\n[\n \"(\"\n \")\"\n] @punctuation.bracket\n\n[\n \",\"\n] @punctuation.delimiter\n\n[\n \"=\"\n \"=>\"\n \"|\"\n \"..\"\n \"::\"\n \"==\"\n \"!=\"\n \">\"\n \">=\"\n \"<\"\n \"<=\"\n] @operator\n";
11
+ var highlights = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-highlights.mjs. DO NOT EDIT.\n\n[\n \"let\"\n \"if\"\n \"else\"\n \"match\"\n \"and\"\n \"or\"\n \"not\"\n \"move\"\n \"in\"\n \"this\"\n \"?\"\n \".\"\n \"...\"\n \"[\"\n \"]\"\n \"{\"\n \"}\"\n \":\"\n] @keyword\n\n[\n \"+\"\n \"-\"\n \"*\"\n \"/\"\n] @keyword\n\n\"_\" @variable.builtin\n\n\"null\" @constant.builtin\n\n[\n \"true\"\n \"false\"\n] @boolean\n\n(dollar_var) @variable.builtin\n(global_sigil) @keyword\n(metadata_sigil) @keyword\n(meta_selector) @attribute\n(number) @number\n(string) @string\n(format_expr) @string\n(ip) @constant.ip\n(subnet) @constant.subnet\n(time) @number.time\n(duration) @number.duration\n(frontmatter_open) @comment\n(frontmatter_close) @comment\n(comment) @comment\n\n(invocation\n operator: (entity) @function.operator)\n(call_expression\n (entity) @function.call)\n(call_expression\n method: (entity) @function.method)\n((identifier) @variable.builtin (#match? @variable.builtin \"^\\$[A-Za-z_]\\w*$\"))\n\n[\n \"(\"\n \")\"\n] @punctuation.bracket\n\n[\n \",\"\n] @punctuation.delimiter\n\n[\n \"=\"\n \"=>\"\n \"|\"\n \"..\"\n \"::\"\n \"==\"\n \"!=\"\n \">\"\n \">=\"\n \"<\"\n \"<=\"\n] @operator\n";
12
12
 
13
13
  var indents = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-indents.mjs. DO NOT EDIT.\n\n[\n (then_block)\n (else_block)\n (pipeline_block)\n (pipeline_expression)\n (match_statement)\n (match_arm)\n (list)\n (record)\n] @indent\n\n[\n \"}\"\n \"]\"\n] @outdent\n\n[\n (string)\n (format_text)\n (comment)\n (frontmatter_body)\n] @indent.auto\n";
14
14
 
@@ -27,13 +27,18 @@ const tqlCaptureTags = {
27
27
  attribute: highlight.tags.attributeName,
28
28
  function: highlight.tags.function(highlight.tags.variableName),
29
29
  "function.call": highlight.tags.function(highlight.tags.variableName),
30
+ "function.operator": highlight.tags.function(highlight.tags.variableName),
30
31
  "function.method": highlight.tags.function(highlight.tags.propertyName),
31
32
  string: highlight.tags.string,
32
33
  "string.escape": highlight.tags.escape,
33
34
  "string.special": highlight.tags.special(highlight.tags.string),
34
35
  number: highlight.tags.number,
36
+ "number.time": highlight.tags.number,
37
+ "number.duration": highlight.tags.number,
35
38
  boolean: highlight.tags.bool,
36
39
  constant: highlight.tags.constant(highlight.tags.name),
40
+ "constant.ip": highlight.tags.constant(highlight.tags.name),
41
+ "constant.subnet": highlight.tags.constant(highlight.tags.name),
37
42
  "constant.builtin": highlight.tags.null,
38
43
  variable: highlight.tags.variableName,
39
44
  "variable.builtin": highlight.tags.special(highlight.tags.variableName),
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ var brackets = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-bra
6
6
 
7
7
  var folds = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-folds.mjs. DO NOT EDIT.\n\n[\n (then_block)\n (else_block)\n (pipeline_block)\n (pipeline_expression)\n (match_statement)\n (match_arm)\n (list)\n (record)\n (frontmatter)\n] @fold\n";
8
8
 
9
- var highlights = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-highlights.mjs. DO NOT EDIT.\n\n[\n \"let\"\n \"if\"\n \"else\"\n \"match\"\n \"and\"\n \"or\"\n \"not\"\n \"move\"\n \"in\"\n \"this\"\n \"?\"\n \".\"\n \"...\"\n \"[\"\n \"]\"\n \"{\"\n \"}\"\n \":\"\n] @keyword\n\n[\n \"+\"\n \"-\"\n \"*\"\n \"/\"\n] @keyword\n\n\"_\" @variable.builtin\n\n\"null\" @constant.builtin\n\n[\n \"true\"\n \"false\"\n] @boolean\n\n(dollar_var) @variable.builtin\n(global_sigil) @keyword\n(metadata_sigil) @keyword\n(meta_selector) @attribute\n(number) @number\n(string) @string\n(format_expr) @string\n(ip) @constant\n(subnet) @constant\n(time) @number\n(duration) @number\n(frontmatter_open) @comment\n(frontmatter_close) @comment\n(comment) @comment\n\n(invocation\n operator: (entity) @function.call)\n(call_expression\n (entity) @function.call)\n(call_expression\n method: (entity) @function.method)\n((identifier) @variable.builtin (#match? @variable.builtin \"^\\$[A-Za-z_]\\w*$\"))\n\n[\n \"(\"\n \")\"\n] @punctuation.bracket\n\n[\n \",\"\n] @punctuation.delimiter\n\n[\n \"=\"\n \"=>\"\n \"|\"\n \"..\"\n \"::\"\n \"==\"\n \"!=\"\n \">\"\n \">=\"\n \"<\"\n \"<=\"\n] @operator\n";
9
+ var highlights = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-highlights.mjs. DO NOT EDIT.\n\n[\n \"let\"\n \"if\"\n \"else\"\n \"match\"\n \"and\"\n \"or\"\n \"not\"\n \"move\"\n \"in\"\n \"this\"\n \"?\"\n \".\"\n \"...\"\n \"[\"\n \"]\"\n \"{\"\n \"}\"\n \":\"\n] @keyword\n\n[\n \"+\"\n \"-\"\n \"*\"\n \"/\"\n] @keyword\n\n\"_\" @variable.builtin\n\n\"null\" @constant.builtin\n\n[\n \"true\"\n \"false\"\n] @boolean\n\n(dollar_var) @variable.builtin\n(global_sigil) @keyword\n(metadata_sigil) @keyword\n(meta_selector) @attribute\n(number) @number\n(string) @string\n(format_expr) @string\n(ip) @constant.ip\n(subnet) @constant.subnet\n(time) @number.time\n(duration) @number.duration\n(frontmatter_open) @comment\n(frontmatter_close) @comment\n(comment) @comment\n\n(invocation\n operator: (entity) @function.operator)\n(call_expression\n (entity) @function.call)\n(call_expression\n method: (entity) @function.method)\n((identifier) @variable.builtin (#match? @variable.builtin \"^\\$[A-Za-z_]\\w*$\"))\n\n[\n \"(\"\n \")\"\n] @punctuation.bracket\n\n[\n \",\"\n] @punctuation.delimiter\n\n[\n \"=\"\n \"=>\"\n \"|\"\n \"..\"\n \"::\"\n \"==\"\n \"!=\"\n \">\"\n \">=\"\n \"<\"\n \"<=\"\n] @operator\n";
10
10
 
11
11
  var indents = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-indents.mjs. DO NOT EDIT.\n\n[\n (then_block)\n (else_block)\n (pipeline_block)\n (pipeline_expression)\n (match_statement)\n (match_arm)\n (list)\n (record)\n] @indent\n\n[\n \"}\"\n \"]\"\n] @outdent\n\n[\n (string)\n (format_text)\n (comment)\n (frontmatter_body)\n] @indent.auto\n";
12
12
 
@@ -25,13 +25,18 @@ const tqlCaptureTags = {
25
25
  attribute: tags.attributeName,
26
26
  function: tags.function(tags.variableName),
27
27
  "function.call": tags.function(tags.variableName),
28
+ "function.operator": tags.function(tags.variableName),
28
29
  "function.method": tags.function(tags.propertyName),
29
30
  string: tags.string,
30
31
  "string.escape": tags.escape,
31
32
  "string.special": tags.special(tags.string),
32
33
  number: tags.number,
34
+ "number.time": tags.number,
35
+ "number.duration": tags.number,
33
36
  boolean: tags.bool,
34
37
  constant: tags.constant(tags.name),
38
+ "constant.ip": tags.constant(tags.name),
39
+ "constant.subnet": tags.constant(tags.name),
35
40
  "constant.builtin": tags.null,
36
41
  variable: tags.variableName,
37
42
  "variable.builtin": tags.special(tags.variableName),
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
10
- "version": "0.5.0",
10
+ "version": "0.5.1",
11
11
  "description": "Tenzir Query Language (TQL) support for CodeMirror, backed by tree-sitter-tql",
12
12
  "keywords": [
13
13
  "codemirror",
@@ -49,7 +49,7 @@
49
49
  "@rollup/plugin-typescript": "^12.3.1",
50
50
  "rollup": "^4.68.2",
51
51
  "rollup-plugin-dts": "^6.5.1",
52
- "tree-sitter-tql": "1.3.0",
52
+ "tree-sitter-tql": "1.4.0",
53
53
  "tslib": "^2.9.1",
54
54
  "typescript": "^5.9.3",
55
55
  "web-tree-sitter": "^0.26.13"