@kerebron/tree-sitter 0.5.5 → 0.6.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.
Files changed (133) hide show
  1. package/README.md +1 -2
  2. package/esm/{deno-tree-sitter/main/extended → extended}/base_node.d.ts +9 -12
  3. package/esm/extended/base_node.d.ts.map +1 -0
  4. package/esm/{deno-tree-sitter/main/extended → extended}/base_node.js +14 -14
  5. package/esm/extended/base_node.js.map +1 -0
  6. package/esm/extended/node_extended.d.ts +243 -0
  7. package/esm/extended/node_extended.d.ts.map +1 -0
  8. package/esm/{deno-tree-sitter/main/extended → extended}/node_extended.js +196 -186
  9. package/esm/extended/node_extended.js.map +1 -0
  10. package/esm/{deno-tree-sitter/main/extended → extended}/parser.d.ts +19 -17
  11. package/esm/extended/parser.d.ts.map +1 -0
  12. package/esm/extended/parser.js +61 -0
  13. package/esm/extended/parser.js.map +1 -0
  14. package/esm/{deno-tree-sitter/main/extended → extended}/soft_node.d.ts +4 -3
  15. package/esm/extended/soft_node.d.ts.map +1 -0
  16. package/esm/{deno-tree-sitter/main/extended → extended}/soft_node.js +1 -1
  17. package/esm/extended/soft_node.js.map +1 -0
  18. package/esm/extended/soft_text_node.d.ts +9 -0
  19. package/esm/extended/soft_text_node.d.ts.map +1 -0
  20. package/esm/{deno-tree-sitter/main/extended → extended}/soft_text_node.js +2 -2
  21. package/esm/extended/soft_text_node.js.map +1 -0
  22. package/esm/extended/whitespace_node.d.ts +9 -0
  23. package/esm/extended/whitespace_node.d.ts.map +1 -0
  24. package/esm/{deno-tree-sitter/main/extended → extended}/whitespace_node.js +2 -2
  25. package/esm/extended/whitespace_node.js.map +1 -0
  26. package/esm/extras/misc.d.ts +2 -0
  27. package/esm/extras/misc.d.ts.map +1 -0
  28. package/esm/{deno-tree-sitter/main/extras → extras}/misc.js +2 -2
  29. package/esm/extras/misc.js.map +1 -0
  30. package/esm/mod.d.ts +1 -6
  31. package/esm/mod.d.ts.map +1 -1
  32. package/esm/mod.js +1 -7
  33. package/esm/mod.js.map +1 -1
  34. package/package.json +4 -1
  35. package/src/extended/base_node.ts +175 -0
  36. package/src/extended/node_extended.ts +651 -0
  37. package/src/extended/parser.ts +96 -0
  38. package/src/extended/soft_node.ts +32 -0
  39. package/src/extended/soft_text_node.ts +11 -0
  40. package/src/extended/whitespace_node.ts +11 -0
  41. package/src/extras/misc.ts +15 -0
  42. package/src/mod.ts +1 -8
  43. package/esm/deno-tree-sitter/main/extended/base_node.d.ts.map +0 -1
  44. package/esm/deno-tree-sitter/main/extended/base_node.js.map +0 -1
  45. package/esm/deno-tree-sitter/main/extended/node_extended.d.ts +0 -237
  46. package/esm/deno-tree-sitter/main/extended/node_extended.d.ts.map +0 -1
  47. package/esm/deno-tree-sitter/main/extended/node_extended.js.map +0 -1
  48. package/esm/deno-tree-sitter/main/extended/parser.d.ts.map +0 -1
  49. package/esm/deno-tree-sitter/main/extended/parser.js +0 -87
  50. package/esm/deno-tree-sitter/main/extended/parser.js.map +0 -1
  51. package/esm/deno-tree-sitter/main/extended/soft_node.d.ts.map +0 -1
  52. package/esm/deno-tree-sitter/main/extended/soft_node.js.map +0 -1
  53. package/esm/deno-tree-sitter/main/extended/soft_text_node.d.ts +0 -10
  54. package/esm/deno-tree-sitter/main/extended/soft_text_node.d.ts.map +0 -1
  55. package/esm/deno-tree-sitter/main/extended/soft_text_node.js.map +0 -1
  56. package/esm/deno-tree-sitter/main/extended/whitespace_node.d.ts +0 -10
  57. package/esm/deno-tree-sitter/main/extended/whitespace_node.d.ts.map +0 -1
  58. package/esm/deno-tree-sitter/main/extended/whitespace_node.js.map +0 -1
  59. package/esm/deno-tree-sitter/main/extras/misc.d.ts +0 -2
  60. package/esm/deno-tree-sitter/main/extras/misc.d.ts.map +0 -1
  61. package/esm/deno-tree-sitter/main/extras/misc.js.map +0 -1
  62. package/esm/deno-tree-sitter/main/tree_sitter/bindings.d.ts +0 -14
  63. package/esm/deno-tree-sitter/main/tree_sitter/bindings.d.ts.map +0 -1
  64. package/esm/deno-tree-sitter/main/tree_sitter/bindings.js +0 -22
  65. package/esm/deno-tree-sitter/main/tree_sitter/bindings.js.map +0 -1
  66. package/esm/deno-tree-sitter/main/tree_sitter/constants.d.ts +0 -60
  67. package/esm/deno-tree-sitter/main/tree_sitter/constants.d.ts.map +0 -1
  68. package/esm/deno-tree-sitter/main/tree_sitter/constants.js +0 -67
  69. package/esm/deno-tree-sitter/main/tree_sitter/constants.js.map +0 -1
  70. package/esm/deno-tree-sitter/main/tree_sitter/language.d.ts +0 -137
  71. package/esm/deno-tree-sitter/main/tree_sitter/language.d.ts.map +0 -1
  72. package/esm/deno-tree-sitter/main/tree_sitter/language.js +0 -265
  73. package/esm/deno-tree-sitter/main/tree_sitter/language.js.map +0 -1
  74. package/esm/deno-tree-sitter/main/tree_sitter/lookahead_iterator.d.ts +0 -41
  75. package/esm/deno-tree-sitter/main/tree_sitter/lookahead_iterator.d.ts.map +0 -1
  76. package/esm/deno-tree-sitter/main/tree_sitter/lookahead_iterator.js +0 -66
  77. package/esm/deno-tree-sitter/main/tree_sitter/lookahead_iterator.js.map +0 -1
  78. package/esm/deno-tree-sitter/main/tree_sitter/marshal.d.ts +0 -85
  79. package/esm/deno-tree-sitter/main/tree_sitter/marshal.d.ts.map +0 -1
  80. package/esm/deno-tree-sitter/main/tree_sitter/marshal.js +0 -174
  81. package/esm/deno-tree-sitter/main/tree_sitter/marshal.js.map +0 -1
  82. package/esm/deno-tree-sitter/main/tree_sitter/node.d.ts +0 -260
  83. package/esm/deno-tree-sitter/main/tree_sitter/node.d.ts.map +0 -1
  84. package/esm/deno-tree-sitter/main/tree_sitter/node.js +0 -558
  85. package/esm/deno-tree-sitter/main/tree_sitter/node.js.map +0 -1
  86. package/esm/deno-tree-sitter/main/tree_sitter/parser.d.ts +0 -124
  87. package/esm/deno-tree-sitter/main/tree_sitter/parser.d.ts.map +0 -1
  88. package/esm/deno-tree-sitter/main/tree_sitter/parser.js +0 -253
  89. package/esm/deno-tree-sitter/main/tree_sitter/parser.js.map +0 -1
  90. package/esm/deno-tree-sitter/main/tree_sitter/query.d.ts +0 -134
  91. package/esm/deno-tree-sitter/main/tree_sitter/query.d.ts.map +0 -1
  92. package/esm/deno-tree-sitter/main/tree_sitter/query.js +0 -621
  93. package/esm/deno-tree-sitter/main/tree_sitter/query.js.map +0 -1
  94. package/esm/deno-tree-sitter/main/tree_sitter/tree.d.ts +0 -49
  95. package/esm/deno-tree-sitter/main/tree_sitter/tree.d.ts.map +0 -1
  96. package/esm/deno-tree-sitter/main/tree_sitter/tree.js +0 -131
  97. package/esm/deno-tree-sitter/main/tree_sitter/tree.js.map +0 -1
  98. package/esm/deno-tree-sitter/main/tree_sitter/tree_cursor.d.ts +0 -165
  99. package/esm/deno-tree-sitter/main/tree_sitter/tree_cursor.d.ts.map +0 -1
  100. package/esm/deno-tree-sitter/main/tree_sitter/tree_cursor.js +0 -281
  101. package/esm/deno-tree-sitter/main/tree_sitter/tree_cursor.js.map +0 -1
  102. package/esm/deno-tree-sitter/main/tree_sitter_wasm.d.ts +0 -3
  103. package/esm/deno-tree-sitter/main/tree_sitter_wasm.d.ts.map +0 -1
  104. package/esm/deno-tree-sitter/main/tree_sitter_wasm.js +0 -0
  105. package/esm/deno-tree-sitter/main/tree_sitter_wasm.js.map +0 -1
  106. package/esm/deno-tree-sitter/main/wasm_loader.d.ts +0 -29
  107. package/esm/deno-tree-sitter/main/wasm_loader.d.ts.map +0 -1
  108. package/esm/deno-tree-sitter/main/wasm_loader.js +0 -1703
  109. package/esm/deno-tree-sitter/main/wasm_loader.js.map +0 -1
  110. package/esm/deno-tree-sitter/main/wasm_loader_with_defaults.d.ts +0 -3
  111. package/esm/deno-tree-sitter/main/wasm_loader_with_defaults.d.ts.map +0 -1
  112. package/esm/deno-tree-sitter/main/wasm_loader_with_defaults.js +0 -9
  113. package/esm/deno-tree-sitter/main/wasm_loader_with_defaults.js.map +0 -1
  114. package/src/deno-tree-sitter/main/extended/base_node.js +0 -174
  115. package/src/deno-tree-sitter/main/extended/node_extended.js +0 -588
  116. package/src/deno-tree-sitter/main/extended/parser.js +0 -87
  117. package/src/deno-tree-sitter/main/extended/soft_node.js +0 -32
  118. package/src/deno-tree-sitter/main/extended/soft_text_node.js +0 -11
  119. package/src/deno-tree-sitter/main/extended/whitespace_node.js +0 -11
  120. package/src/deno-tree-sitter/main/extras/misc.js +0 -12
  121. package/src/deno-tree-sitter/main/tree_sitter/bindings.js +0 -26
  122. package/src/deno-tree-sitter/main/tree_sitter/constants.js +0 -79
  123. package/src/deno-tree-sitter/main/tree_sitter/language.js +0 -289
  124. package/src/deno-tree-sitter/main/tree_sitter/lookahead_iterator.js +0 -74
  125. package/src/deno-tree-sitter/main/tree_sitter/marshal.js +0 -186
  126. package/src/deno-tree-sitter/main/tree_sitter/node.js +0 -616
  127. package/src/deno-tree-sitter/main/tree_sitter/parser.js +0 -273
  128. package/src/deno-tree-sitter/main/tree_sitter/query.js +0 -705
  129. package/src/deno-tree-sitter/main/tree_sitter/tree.js +0 -145
  130. package/src/deno-tree-sitter/main/tree_sitter/tree_cursor.js +0 -314
  131. package/src/deno-tree-sitter/main/tree_sitter_wasm.js +0 -0
  132. package/src/deno-tree-sitter/main/wasm_loader.js +0 -1702
  133. package/src/deno-tree-sitter/main/wasm_loader_with_defaults.js +0 -9
@@ -0,0 +1,96 @@
1
+ // import { Tree } from "../web-tree-sitter/src/tree.ts"
2
+ // import { ParseOptions, Parser } from "../web-tree-sitter/src/parser.ts"
3
+ // import { Language } from "../web-tree-sitter/src/language.ts"
4
+ // import { ParseCallback } from "../web-tree-sitter/src/index.ts";
5
+ // import { setModule } from '../web-tree-sitter/src/constants.ts';
6
+ // import { MainModule } from '../web-tree-sitter/lib/web-tree-sitter.d.ts';
7
+ import './node_extended.js';
8
+ import {
9
+ Language,
10
+ ParseCallback,
11
+ ParseOptions,
12
+ Parser,
13
+ Tree,
14
+ } from 'web-tree-sitter';
15
+
16
+ // this only exists to help with type hints
17
+ class ExtendedParser extends Parser {
18
+ disableSoftNodes = false;
19
+
20
+ /**
21
+ * Parse a slice of UTF8 text.
22
+ *
23
+ * @param {string | ParseCallback} callback - Source code to parse
24
+ *
25
+ * @param {Tree | null} [oldTree] - A previous syntax tree parsed from the same document. If the text of the
26
+ * document has changed since `oldTree` was created, then you must edit `oldTree` to match
27
+ * the new text using {@link Tree#edit}.
28
+ *
29
+ * @param {ParseOptions} [options] - Options for parsing the text.
30
+ * This can be used to set the included ranges, or a progress callback.
31
+ *
32
+ * @returns {ExtendedTree | null} A {@link Tree} if parsing succeeded, or `null` if:
33
+ * - The parser has not yet had a language assigned with {@link Parser#setLanguage}.
34
+ * - The progress callback returned true.
35
+ */
36
+ override parse(
37
+ code: string | ParseCallback,
38
+ oldTree: Tree | null,
39
+ options: ParseOptions,
40
+ ) {
41
+ if (typeof code == 'function') {
42
+ console.warn(
43
+ "When calling .parse() the source code was a function instead of a string. The original tree sitter supports giving a function as a means of supporting edits (see: https://github.com/tree-sitter/tree-sitter/discussions/2553 ).\nHowever, this library supports edits directly (use node.replaceInnards(``))\nThe downside of making edits easy is that .parse() doesn't really accept a function argument. I'm just going to evaluate that function to grab the string once at the beginning. Use tree.codeString if you want to get the full string after a .replaceInnards() call.",
44
+ );
45
+ code = code(0, { row: 0, column: 0 }) || '';
46
+ }
47
+ // if (!checkModule()) {
48
+ // throw new Error("cannot construct a Parser before calling `init()`");
49
+ // }
50
+
51
+ let tree: Tree | null = null;
52
+ tree = super.parse.apply(this, [
53
+ (index: number) => (tree?.codeString ?? code).slice(index),
54
+ oldTree,
55
+ options,
56
+ ]);
57
+
58
+ tree.codeString = code;
59
+ tree._enableSoftNodes = !this.disableSoftNodes;
60
+ return tree;
61
+ }
62
+ }
63
+
64
+ const langCache = new Map();
65
+ let hasBeenLoaded = false;
66
+ /**
67
+ * Creates and returns a new parser instance, loading a language from a WebAssembly binary or file path.
68
+ * Optionally, the parser can be configured to disable soft nodes.
69
+ *
70
+ * @async
71
+ * @param {Uint8Array|string} wasmUint8ArrayOrFilePath - The WebAssembly binary as a `Uint8Array` or a file path to load the language.
72
+ * @param {Object} [options] - Optional configuration options.
73
+ * @param {boolean} [options.disableSoftNodes=false] - Whether to disable soft nodes in the parser (default is `false`).
74
+ * @returns {Promise<ExtendedParser>} A promise that resolves to the created parser instance.
75
+ */
76
+ interface Options {
77
+ disableSoftNodes?: boolean;
78
+ moduleOptions?: Object;
79
+ }
80
+
81
+ export async function createParser(
82
+ wasmUint8Array: Uint8Array,
83
+ { disableSoftNodes = false, moduleOptions }: Options = {},
84
+ ) {
85
+ await Parser.init();
86
+
87
+ if (!hasBeenLoaded) {
88
+ hasBeenLoaded = true;
89
+ await Parser.init(moduleOptions);
90
+ }
91
+ const parser = new ExtendedParser();
92
+ const language = await Language.load(wasmUint8Array);
93
+ parser.setLanguage(language);
94
+ parser.disableSoftNodes = disableSoftNodes;
95
+ return parser;
96
+ }
@@ -0,0 +1,32 @@
1
+ import { BaseNode } from './base_node.js';
2
+
3
+ // HardNode extends BaseNode as well (indirectly)
4
+ export class SoftNode extends BaseNode {
5
+ children = [];
6
+ constructor(data) {
7
+ super(data);
8
+ }
9
+
10
+ // these are getters because when calling .replaceInnards() on a node the indices of hardNodes shift, these getters piggyback on that shift (otherwise they'd be wrong)
11
+ get startIndex() {
12
+ return this._startIndexOffset + this.getReferencePoint().index;
13
+ }
14
+
15
+ get startPosition() {
16
+ return {
17
+ row: this._startRowOffset + this.getReferencePoint().position.row,
18
+ column: this._startColOffset + this.getReferencePoint().position.column,
19
+ };
20
+ }
21
+
22
+ get endIndex() {
23
+ return this._endIndexOffset + this.getReferencePoint().index;
24
+ }
25
+
26
+ get endPosition() {
27
+ return {
28
+ row: this._endRowOffset + this.getReferencePoint().position.row,
29
+ column: this._endColOffset + this.getReferencePoint().position.column,
30
+ };
31
+ }
32
+ }
@@ -0,0 +1,11 @@
1
+ import { SoftNode } from './soft_node.js';
2
+
3
+ export class SoftTextNode extends SoftNode {
4
+ constructor({ parent, ...data }) {
5
+ super({ ...data, type: 'text', typeId: -2 });
6
+ this._parent = parent;
7
+ }
8
+ get parent() {
9
+ return this._parent;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { SoftNode } from './soft_node.js';
2
+
3
+ export class WhitespaceNode extends SoftNode {
4
+ constructor({ parent, ...data }) {
5
+ super({ ...data, type: 'whitespace', typeId: -1 });
6
+ this._parent = parent;
7
+ }
8
+ get parent() {
9
+ return this._parent;
10
+ }
11
+ }
@@ -0,0 +1,15 @@
1
+ export function _getQueryCaptureTargets(queryString) {
2
+ if (!queryString.includes('@')) {
3
+ return [];
4
+ } else { // need a rigorous check
5
+ // remove all strings from within the query (the only place a false capture target could appear)
6
+ // NOTE: this is based exactly on the language spec, its not a hack: https://github.com/tree-sitter-grammars/tree-sitter-query/blob/3a9808b22742d5bd906ef5d1a562f2f1ae57406d/src/grammar.json#L140
7
+ const safeSearchableQuery = queryString.replace(
8
+ /"(?:\\(?:[^xu0-7]|[0-7]{1,3}|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]+})|[^\"\\])*"/g,
9
+ '',
10
+ );
11
+ // now check if there is a capture target
12
+ // NOTE: also based on the language spec: https://github.com/tree-sitter-grammars/tree-sitter-query/blob/3a9808b22742d5bd906ef5d1a562f2f1ae57406d/src/grammar.json#L204
13
+ return safeSearchableQuery.match(/(?<=@)([a-zA-Z0-9.\-_\$]+)/g);
14
+ }
15
+ }
package/src/mod.ts CHANGED
@@ -1,8 +1 @@
1
- // JS files exported because of sloppy-imports
2
-
3
- export { createParser } from './deno-tree-sitter/main/extended/parser.js';
4
- export { Parser } from './deno-tree-sitter/main/tree_sitter/parser.js';
5
- export { Language } from './deno-tree-sitter/main/tree_sitter/language.js';
6
- export { Query } from './deno-tree-sitter/main/tree_sitter/query.js';
7
- export { Node } from './deno-tree-sitter/main/tree_sitter/node.js';
8
- export { Tree } from './deno-tree-sitter/main/tree_sitter/tree.js';
1
+ export { createParser } from './extended/parser.js';
@@ -1 +0,0 @@
1
- {"version":3,"file":"base_node.d.ts","sourceRoot":"","sources":["../../../../src/deno-tree-sitter/main/extended/base_node.js"],"names":[],"mappings":"AAEA,0BAA0B;AAC1B;IAUI,uBAEC;IAED,qBAAqB;IACrB,aADW,MAAM,CAUhB;IANW,YAAe;IAQ3B,qBAAqB;IACrB,cADW,MAAM,CAGhB;IAMD,2BAEC;IAED,wBAEC;IAED,iBAEC;IAED,0BAEC;IAED,qBAAqB;IACrB,cADW,MAAM,CAKhB;IAED,qBAAqB;IACrB;;;;;;;;;;;;;;;;;;;;;MAgCC;IAgCD,iDAEC;IACD,qBAEC;IAED;;;;OAIG;IACH,4BAFW,MAAM,QAoChB;IA1ID,+CAEC;CAyIJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"base_node.js","sourceRoot":"","sources":["../../../../src/deno-tree-sitter/main/extended/base_node.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAE7C,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAA;AAC1B,MAAM,OAAO,QAAQ;IACjB,YAAY;IACZ,aAAa;IACb,oBAAoB;IACpB,iBAAiB;IACjB,kBAAkB;IAClB,iBAAiB;IACjB,eAAe;IACf,cAAc;IAEd,YAAY,IAAI;QACZ,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAC7B,CAAC;IAED,qBAAqB;IACrB,IAAI,KAAK;QACL,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;YACtB,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;gBACtB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAA;YACnB,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAA;YACvC,CAAC;QACL,CAAC;QACD,OAAO,IA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QAC9D,IAAI,SAAS,GAAG,aAAa,CAAC,MAAM,CAAC;QACrC,IAAI,gBAAgB,IAAI,CAAC,EAAE,CAAC;YACxB,SAAS,GAAG,aAAa,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAA;QACzD,CAAC;aAAM,CAAC;YACJ,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;QAC3D,CAAC;QACD,2CAA2C;QAC3C,IAAI,CAAC,IAAI,CAAC;YACN,UAAU,EAAE,kBAAkB;YAC9B,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EAAE,kBAAkB,GAAG,WAAW,CAAC,MAAM;YACpD,aAAa,EAAE,aAAa;YAC5B,cAAc,EAAE,WAAW;YAC3B,cAAc,EAAE,EAAE,GAAG,EAAE,aAAa,CAAC,GAAG,GAAG,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE;SACnF,CAAC,CAAA;QAEF,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,CAAC,GAAG,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;IACrH,CAAC;CACJ"}
@@ -1,237 +0,0 @@
1
- export class ExtendedTree extends Tree {
2
- /** @type {HardNode} */
3
- rootNode: HardNode;
4
- }
5
- export class HardNode extends BaseNode {
6
- /** @internal */
7
- _children: any;
8
- /** @internal */
9
- _fields: any;
10
- /** @type {number} */
11
- id: number;
12
- /** @type {number} */
13
- startIndex: number;
14
- /** @type {Position} */
15
- startPosition: Position;
16
- /** @type {ExtendedTree} */
17
- tree: ExtendedTree;
18
- /** @type {string} */
19
- type: string;
20
- /** @type {Boolean} */
21
- isExtra: boolean;
22
- /** @type {Boolean} */
23
- isError: boolean;
24
- /** @type {Boolean} */
25
- isMissing: boolean;
26
- /** @type {Boolean} */
27
- hasChanges: boolean;
28
- /** @type {Boolean} */
29
- hasError: boolean;
30
- /**
31
- * @param {HardNode} other -
32
- * @returns {Boolean} output -
33
- */
34
- equals: ((other: any) => boolean) | undefined;
35
- /** @type {HardNode} */
36
- get parent(): HardNode;
37
- /** @type {string} */
38
- get text(): string;
39
- /** @type {Number} */
40
- get endIndex(): number;
41
- /** @type {Position} */
42
- get endPosition(): Position;
43
- set children(value: Array<HardNode | SoftNode>);
44
- /** @type {Array<HardNode|SoftNode>} */
45
- get children(): Array<HardNode | SoftNode>;
46
- /**
47
- * Yields each child
48
- *
49
- * @generator
50
- * @yields {HardNode} The current child or grandchild in the structure.
51
- */
52
- traverse(arg?: {
53
- _parentNodes: never[];
54
- }): Generator<any, void, unknown>;
55
- /**
56
- * A generator function that flattens the hierarchical structure of `children` and their descendants.
57
- * It yields each child and their flattened descendants recursively.
58
- *
59
- * @param {Function} opts.filter - A function to filter the flattened elements.
60
- * @param {Boolean} opts.includeSelf -
61
- * @generator
62
- * @yields {HardNode} The current child or grandchild in the structure.
63
- */
64
- iterFlattened({ filter, includeSelf }?: Function): Generator<any, void, unknown>;
65
- /** @internal */
66
- iterFlatten(): void;
67
- /**
68
- * Flattens the structure of `children` using the provided filter function.
69
- * This method returns an array containing the flattened elements.
70
- *
71
- * @param {Function} opts.filter - A function to filter the flattened elements.
72
- * @param {Boolean} opts.includeSelf -
73
- * @returns {Array} An array containing the flattened elements that pass the filter.
74
- */
75
- flattened({ filter, includeSelf }?: Function): any[];
76
- /** @internal */
77
- flatten(): void;
78
- /**
79
- * Query
80
- *
81
- * @example
82
- * ```js
83
- * import { createParser } from "https://deno.land/x/deno_tree_sitter/main/main.js"
84
- * import javascript from "https://github.com/jeff-hykin/common_tree_sitter_languages/raw/4d8a6d34d7f6263ff570f333cdcf5ded6be89e3d/main/javascript.js"
85
- * const parser = await createParser(javascript) // path or Uint8Array
86
- * const tree = parser.parse('let a = 1;let b = 1;let c = 1;')
87
- *
88
- * tree.rootNode.query(`(identifier) @blahBlahBlah`, {matchLimit: 2})
89
- * // returns:
90
- * [
91
- * {
92
- * pattern: 0,
93
- * captures: [
94
- * {
95
- * name: "blahBlahBlah",
96
- * node: {
97
- * type: "identifier",
98
- * typeId: 1,
99
- * startPosition: { row: 0, column: 4 },
100
- * startIndex: 4,
101
- * endPosition: { row: 0, column: 5 },
102
- * endIndex: 5,
103
- * indent: undefined,
104
- * hasChildren: false,
105
- * children: []
106
- * }
107
- * }
108
- * ]
109
- * },
110
- * {
111
- * pattern: 0,
112
- * captures: [
113
- * {
114
- * name: "blahBlahBlah",
115
- * node: {
116
- * type: "identifier",
117
- * typeId: 1,
118
- * startPosition: { row: 0, column: 14 },
119
- * startIndex: 14,
120
- * endPosition: { row: 0, column: 15 },
121
- * endIndex: 15,
122
- * indent: undefined,
123
- * hasChildren: false,
124
- * children: []
125
- * }
126
- * }
127
- * ]
128
- * },
129
- * {
130
- * pattern: 0,
131
- * captures: [
132
- * {
133
- * name: "blahBlahBlah",
134
- * node: {
135
- * type: "identifier",
136
- * typeId: 1,
137
- * startPosition: { row: 0, column: 24 },
138
- * startIndex: 24,
139
- * endPosition: { row: 0, column: 25 },
140
- * endIndex: 25,
141
- * indent: undefined,
142
- * hasChildren: false,
143
- * children: []
144
- * }
145
- * }
146
- * ]
147
- * }
148
- * ]
149
- * ```
150
- *
151
- * @param {String} queryString - see https://tree-sitter.github.io/tree-sitter/using-parsers#query-syntax
152
- * @param options.matchLimit - max number of results
153
- * @param options.startPosition - {row: Number, column: number}
154
- * @param options.endPosition - {row: Number, column: number}
155
- * @param options.maxResultDepth - depth relative to the current node (1 = direct children, 2 = grandchildren, etc)
156
- * @returns {[Object]} output
157
- *
158
- */
159
- query(queryString: string, options: any): [Object];
160
- /**
161
- * quickQuery
162
- *
163
- * @example
164
- * ```js
165
- * import { createParser } from "https://deno.land/x/deno_tree_sitter/main/main.js"
166
- * import javascript from "https://github.com/jeff-hykin/common_tree_sitter_languages/raw/676ffa3b93768b8ac628fd5c61656f7dc41ba413/main/javascript.js"
167
- * const parser = await createParser(javascript) // path or Uint8Array
168
- * const tree = parser.parse('let a = 1;let b = 1;let c = 1;')
169
- * // ex1: no capture names
170
- * const nodes = tree.rootNode.quickQuery(
171
- * `(identifier)`, {matchLimit: 2}
172
- * )
173
- * // ex2: with capture names
174
- * const groups = tree.rootNode.quickQuery(
175
- * `'(binding (attrpath) @myKey (list_expression) @myList ("\\"")? @optionalThing )`
176
- * )
177
- * groups[0].myKey // node
178
- * groups[0].myList // node
179
- * groups[0].optionalThing // node or null
180
- * groups[0][0] // node (the whole match)
181
- * ```
182
- *
183
- * @param {String} queryString - see https://tree-sitter.github.io/tree-sitter/using-parsers#query-syntax
184
- * @param options.matchLimit - max number of results
185
- * @param options.startPosition - {row: Number, column: number}
186
- * @param options.endPosition - {row: Number, column: number}
187
- * @param options.maxResultDepth - depth relative to the current node (1 = direct children, 2 = grandchildren, etc)
188
- * @returns {Array<HardNode|Record<any, HardNode>>} nodesOrObjsOfNodes
189
- */
190
- quickQuery(queryString: string, options: any): Array<HardNode | Record<any, HardNode>>;
191
- /**
192
- * quickQueryFirst
193
- *
194
- * @example
195
- * ```js
196
- * import { createParser } from "https://deno.land/x/deno_tree_sitter/main/main.js"
197
- * import javascript from "https://github.com/jeff-hykin/common_tree_sitter_languages/raw/4d8a6d34d7f6263ff570f333cdcf5ded6be89e3d/main/javascript.js"
198
- * const parser = await createParser(javascript) // path or Uint8Array
199
- * const tree = parser.parse('let a = 1;let b = 1;let c = 1;')
200
- *
201
- * // ex1: no capture names
202
- * const node = tree.rootNode.quickQueryFirst(`(identifier)`)
203
- *
204
- * // ex2: with capture names
205
- * const { myKey, myList, optionalThing } = tree.rootNode.quickQueryFirst(
206
- * `'(binding (attrpath) @myKey (list_expression) @myList ("\\"")? @optionalThing )`
207
- * )
208
- * myKey // node
209
- * myList // node
210
- * optionalThing // node or null
211
- * ```
212
- *
213
- * @param {String} queryString - see https://tree-sitter.github.io/tree-sitter/using-parsers#query-syntax
214
- * @param options.startPosition - {row: Number, column: number}
215
- * @param options.endPosition - {row: Number, column: number}
216
- * @param options.maxResultDepth - depth relative to the current node (1 = direct children, 2 = grandchildren, etc)
217
- * @returns {HardNode|Record<any,HardNode>|null} nodeOrObjOfNodes
218
- */
219
- quickQueryFirst(queryString: string, options: any): HardNode | Record<any, HardNode> | null;
220
- get fields(): any;
221
- get fieldNames(): string[];
222
- getQueryForSelf(): string;
223
- /** @returns {string} */
224
- asLispString(): string;
225
- }
226
- export { Node };
227
- export function _childrenWithSoftNodes(node: any, children: any, string: any): any[] | undefined;
228
- import { Tree } from "../tree_sitter/tree.js";
229
- import { BaseNode } from "./base_node.js";
230
- declare class Position {
231
- /** @type {number} */
232
- row: number;
233
- /** @type {number} */
234
- column: number;
235
- }
236
- import { Node } from "../tree_sitter/node.js";
237
- //# sourceMappingURL=node_extended.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node_extended.d.ts","sourceRoot":"","sources":["../../../../src/deno-tree-sitter/main/extended/node_extended.js"],"names":[],"mappings":"AA2DA;IACI,uBAAuB;IACvB,UADW,QAAQ,CACX;CACX;AAmBD;IACI,gBAAgB;IAChB,eAAS;IACT,gBAAgB;IAChB,aAAO;IAIP,qBAAqB;IACrB,IADW,MAAM,CACf;IACF,qBAAqB;IACrB,YADW,MAAM,CACP;IACV,uBAAuB;IACvB,eADW,QAAQ,CACN;IACb,2BAA2B;IAC3B,MADW,YAAY,CACnB;IACJ,qBAAqB;IACrB,MADW,MAAM,CACb;IACJ,sBAAsB;IACtB,iBAAO;IACP,sBAAsB;IACtB,iBAAO;IACP,sBAAsB;IACtB,mBAAS;IACT,sBAAsB;IACtB,oBAAU;IACV,sBAAsB;IACtB,kBAAQ;IACR;;;OAGG;IACH,8CAAuB;IAEvB,uBAAuB;IACvB,cADW,QAAQ,CAIlB;IAED,qBAAqB;IACrB,YADW,MAAM,CAGhB;IAED,qBAAqB;IACrB,uBAKC;IAED,uBAAuB;IACvB,mBADW,QAAQ,CAQlB;IAeD,oBAbW,KAAK,CAAC,QAAQ,GAAC,QAAQ,CAAC,EAelC;IAfD,uCAAuC;IACvC,gBADW,KAAK,CAAC,QAAQ,GAAC,QAAQ,CAAC,CAWlC;IAMD;;;;;MAKE;IACF;;sCAkBC;IAED;;;;;;;;MAQE;IACF,iFAqBC;IAED,gBAAgB;IAChB,oBAEC;IAED;;;;;;;MAOE;IACF,qDAEC;IACD,gBAAgB;IAChB,gBAEC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgFE;IACF,0CAHY,CAAC,MAAM,CAAC,CAyBnB;IACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6BE;IACF,+CAFY,KAAK,CAAC,QAAQ,GAAC,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CA6BhD;IACD;;;;;;;;;;;;;;;;;;;;;;;;;;;MA2BE;IACF,oDAFY,QAAQ,GAAC,MAAM,CAAC,GAAG,EAAC,QAAQ,CAAC,GAAC,IAAI,CAI7C;IACD,kBAiBC;IACD,2BAEC;IAED,0BAmBC;IAED,wBAAwB;IACxB,gBADc,MAAM,CAGnB;CACJ;;AAcM,iGA6FN;qBApkBoB,wBAAwB;yBALV,gBAAgB;AA+DnD;IACI,qBAAqB;IACrB,KADW,MAAM,CACd;IACH,qBAAqB;IACrB,QADW,MAAM,CACX;CACT;qBAtEoB,wBAAwB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"node_extended.js","sourceRoot":"","sources":["../../../../src/deno-tree-sitter/main/extended/node_extended.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,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ACnC,SAAS,GAAG,iBAAiB,CAAA;QACjC,CAAC;QAED,oCAAoC;QACpC,IAAI,SAAS,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACtC,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YAC/D,MAAM,SAAS,GAAG,SAAS,CAAA;YAC3B,UAAU,CAAC,OAAO,EAAE,GAAE,EAAE,CAAA,CAAC,EAAC,KAAK,EAAE,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,WAAW,EAAC,CAAC,EAAE,IAAI,CAAC,CAAA;QACjG,CAAC;QAED,OAAO,WAAW,CAAA;IACtB,CAAC;AACL,CAAC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/deno-tree-sitter/main/extended/parser.js"],"names":[],"mappings":"AAiDA;;;;;;;;;GASG;AACH,uDALW,UAAU,GAAC,MAAM,wCAEzB;IAA0B,gBAAgB;CAC1C,GAAU,OAAO,CAAC,cAAc,CAAC,CA6BnC;AA5DD;IACI;;;;;;;;;;;;;;;OAeG;IACH,kCAXW,IAAI,GAAG,IAAI,YAIX,YAAY,GAGV,YAAY,GAAG,IAAI,CAK/B;CACJ;uBA3CsB,0BAA0B;qBAD5B,wBAAwB;6BAIkB,oBAAoB"}
@@ -1,87 +0,0 @@
1
- import { Node } from "../tree_sitter/node.js";
2
- import { Tree } from "../tree_sitter/tree.js";
3
- import { Parser } from "../tree_sitter/parser.js";
4
- import { Language } from "../tree_sitter/language.js";
5
- import "./node_extended.js"; // note: redundant but might not be redundant in the future
6
- import { HardNode, ExtendedTree, _childrenWithSoftNodes } from "./node_extended.js";
7
- const realParseFunction = Parser.prototype.parse;
8
- Parser.prototype.parse = function (code, oldTree, options) {
9
- if (typeof code == "function") {
10
- console.warn("When calling .parse() the source code was a function instead of a string. The original tree sitter supports giving a function as a means of supporting edits (see: https://github.com/tree-sitter/tree-sitter/discussions/2553 ).\nHowever, this library supports edits directly (use node.replaceInnards(``))\nThe downside of making edits easy is that .parse() doesn't really accept a function argument. I'm just going to evaluate that function to grab the string once at the beginning. Use tree.codeString if you want to get the full string after a .replaceInnards() call.");
11
- code = code(0);
12
- }
13
- let tree;
14
- tree = realParseFunction.apply(this, [
15
- (index) => (tree?.codeString ?? code).slice(index),
16
- oldTree,
17
- options
18
- ]);
19
- tree.codeString = code;
20
- code = null;
21
- tree._enableSoftNodes = !this.disableSoftNodes;
22
- return tree;
23
- };
24
- // this only exists to help with type hints
25
- class ExtendedParser extends Parser {
26
- /**
27
- * Parse a slice of UTF8 text.
28
- *
29
- * @param {string | ParseCallback} callback - Source code to parse
30
- *
31
- * @param {Tree | null} [oldTree] - A previous syntax tree parsed from the same document. If the text of the
32
- * document has changed since `oldTree` was created, then you must edit `oldTree` to match
33
- * the new text using {@link Tree#edit}.
34
- *
35
- * @param {ParseOptions} [options] - Options for parsing the text.
36
- * This can be used to set the included ranges, or a progress callback.
37
- *
38
- * @returns {ExtendedTree | null} A {@link Tree} if parsing succeeded, or `null` if:
39
- * - The parser has not yet had a language assigned with {@link Parser#setLanguage}.
40
- * - The progress callback returned true.
41
- */
42
- parse(inputString, oldTree, options) {
43
- }
44
- }
45
- const langCache = new Map();
46
- let hasBeenLoaded = false;
47
- /**
48
- * Creates and returns a new parser instance, loading a language from a WebAssembly binary or file path.
49
- * Optionally, the parser can be configured to disable soft nodes.
50
- *
51
- * @async
52
- * @param {Uint8Array|string} wasmUint8ArrayOrFilePath - The WebAssembly binary as a `Uint8Array` or a file path to load the language.
53
- * @param {Object} [options] - Optional configuration options.
54
- * @param {boolean} [options.disableSoftNodes=false] - Whether to disable soft nodes in the parser (default is `false`).
55
- * @returns {Promise<ExtendedParser>} A promise that resolves to the created parser instance.
56
- */
57
- export async function createParser(wasmUint8ArrayOrFilePath, { disableSoftNodes = false, moduleOptions } = {}) {
58
- // download if given a url
59
- if (typeof wasmUint8ArrayOrFilePath == "string" && wasmUint8ArrayOrFilePath.match(/^https?:\/\//)) {
60
- wasmUint8ArrayOrFilePath = await fetch(wasmUint8ArrayOrFilePath).then(async (r) => new Uint8Array(await r.arrayBuffer()));
61
- }
62
- if (!hasBeenLoaded) {
63
- hasBeenLoaded = true;
64
- await Parser.init(moduleOptions);
65
- }
66
- // this is a workaround for the a bug in the loader where loading the same language twice causes a freeze
67
- // see: "WebAssembly.instantiate(binary, info).then" inside wasm_loader.js
68
- let language;
69
- if (wasmUint8ArrayOrFilePath instanceof Uint8Array) {
70
- const hashString = Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256", wasmUint8ArrayOrFilePath))).map((b) => b.toString(16).padStart(2, "0")).join("");
71
- if (langCache.has(hashString)) {
72
- language = langCache.get(hashString);
73
- }
74
- else {
75
- language = await Language.load(wasmUint8ArrayOrFilePath);
76
- langCache.set(hashString, language);
77
- }
78
- }
79
- else {
80
- language = await Language.load(wasmUint8ArrayOrFilePath);
81
- }
82
- const parser = new Parser();
83
- parser.setLanguage(language);
84
- parser.disableSoftNodes = disableSoftNodes;
85
- return parser;
86
- }
87
- //# sourceMappingURL=parser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../src/deno-tree-sitter/main/extended/parser.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACrD,OAAO,oBAAoB,CAAA,CAAC,2DAA2D;AACvF,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAEnF,MAAM,iBAAiB,GAAG,MAAM,CAAC,SAAS,CAAC,KAA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":3,"file":"soft_node.d.ts","sourceRoot":"","sources":["../../../../src/deno-tree-sitter/main/extended/soft_node.js"],"names":[],"mappings":"AAGA;IACI,gBAAa;IAMb,sBAEC;IAED;;;MAKC;IAED,oBAEC;IAED;;;MAKC;CACJ;yBA/BwB,gBAAgB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"soft_node.js","sourceRoot":"","sources":["../../../../src/deno-tree-sitter/main/extended/soft_node.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,iDAAiD;AACjD,MAAM,OAAO,QAAS,SAAQ,QAAQ;IAClC,QAAQ,GAAG,EAAE,CAAA;IACb,YAAY,IAAI;QACZ,KAAK,CAAC,IAAI,CAAC,CAAA;IACf,CAAC;IAED,uKAAuK;IACvK,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC,KAAK,CAAA;IAClE,CAAC;IAED,IAAI,aAAa;QACb,OAAO;YACH,GAAG,EAAE,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC,QAAQ,CAAC,GAAG;YACjE,MAAM,EAAE,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC,QAAQ,CAAC,MAAM;SAC1E,CAAA;IACL,CAAC;IAED,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC,KAAK,CAAA;IAChE,CAAC;IAED,IAAI,WAAW;QACX,OAAO;YACH,GAAG,EAAE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC,QAAQ,CAAC,GAAG;YAC/D,MAAM,EAAE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC,QAAQ,CAAC,MAAM;SACxE,CAAA;IACL,CAAC;CACJ"}
@@ -1,10 +0,0 @@
1
- export class SoftTextNode extends SoftNode {
2
- constructor({ parent, ...data }: {
3
- [x: string]: any;
4
- parent: any;
5
- });
6
- _parent: any;
7
- get parent(): any;
8
- }
9
- import { SoftNode } from "./soft_node.js";
10
- //# sourceMappingURL=soft_text_node.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"soft_text_node.d.ts","sourceRoot":"","sources":["../../../../src/deno-tree-sitter/main/extended/soft_text_node.js"],"names":[],"mappings":"AAEA;IACI;;;OAGC;IADG,aAAqB;IAEzB,kBAEC;CACJ;yBAVwB,gBAAgB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"soft_text_node.js","sourceRoot":"","sources":["../../../../src/deno-tree-sitter/main/extended/soft_text_node.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,MAAM,OAAO,YAAa,SAAQ,QAAQ;IACtC,YAAY,EAAC,MAAM,EAAE,GAAG,IAAI,EAAC;QACzB,KAAK,CAAC,EAAC,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,EAAC,CAAC,CAAA;QAC1C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;IACzB,CAAC;IACD,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,OAAO,CAAA;IACvB,CAAC;CACJ"}
@@ -1,10 +0,0 @@
1
- export class WhitespaceNode extends SoftNode {
2
- constructor({ parent, ...data }: {
3
- [x: string]: any;
4
- parent: any;
5
- });
6
- _parent: any;
7
- get parent(): any;
8
- }
9
- import { SoftNode } from "./soft_node.js";
10
- //# sourceMappingURL=whitespace_node.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"whitespace_node.d.ts","sourceRoot":"","sources":["../../../../src/deno-tree-sitter/main/extended/whitespace_node.js"],"names":[],"mappings":"AAEA;IACI;;;OAGC;IADG,aAAqB;IAEzB,kBAEC;CACJ;yBAVwB,gBAAgB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"whitespace_node.js","sourceRoot":"","sources":["../../../../src/deno-tree-sitter/main/extended/whitespace_node.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,MAAM,OAAO,cAAe,SAAQ,QAAQ;IACxC,YAAY,EAAC,MAAM,EAAE,GAAG,IAAI,EAAC;QACzB,KAAK,CAAC,EAAC,GAAG,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC,EAAC,CAAC,CAAA;QAChD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;IACzB,CAAC;IACD,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,OAAO,CAAA;IACvB,CAAC;CACJ"}
@@ -1,2 +0,0 @@
1
- export function _getQueryCaptureTargets(queryString: any): any;
2
- //# sourceMappingURL=misc.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../../src/deno-tree-sitter/main/extras/misc.js"],"names":[],"mappings":"AAAA,+DAWC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"misc.js","sourceRoot":"","sources":["../../../../src/deno-tree-sitter/main/extras/misc.js"],"names":[],"mappings":"AAAA,MAAM,UAAU,uBAAuB,CAAC,WAAW;IAC/C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,CAAA;IACb,CAAC;SAAM,CAAC,CAAE,wBAAwB;QAC9B,gGAAgG;QAChG,kMAAkM;QAClM,MAAM,mBAAmB,GAAG,WAAW,CAAC,OAAO,CAAC,2FAA2F,EAAE,EAAE,CAAC,CAAA;QAChJ,yCAAyC;QACzC,uKAAuK;QACvK,OAAO,mBAAmB,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAA;IACnE,CAAC;AACL,CAAC"}
@@ -1,14 +0,0 @@
1
- /**
2
- * @internal
3
- *
4
- * Initialize the Tree-sitter Wasm module. This should only be called by the {@link Parser} class via {@link Parser.init}.
5
- */
6
- export function initializeBinding(moduleOptions: any): Promise<null>;
7
- /**
8
- * @internal
9
- *
10
- * Checks if the Tree-sitter Wasm module has been initialized.
11
- */
12
- export function checkModule(): boolean;
13
- export let Module: null;
14
- //# sourceMappingURL=bindings.d.ts.map