rustfava 0.1.0__py3-none-any.whl

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 (187) hide show
  1. rustfava/__init__.py +30 -0
  2. rustfava/_ctx_globals_class.py +55 -0
  3. rustfava/api_models.py +36 -0
  4. rustfava/application.py +534 -0
  5. rustfava/beans/__init__.py +6 -0
  6. rustfava/beans/abc.py +327 -0
  7. rustfava/beans/account.py +79 -0
  8. rustfava/beans/create.py +377 -0
  9. rustfava/beans/flags.py +20 -0
  10. rustfava/beans/funcs.py +38 -0
  11. rustfava/beans/helpers.py +52 -0
  12. rustfava/beans/ingest.py +75 -0
  13. rustfava/beans/load.py +31 -0
  14. rustfava/beans/prices.py +151 -0
  15. rustfava/beans/protocols.py +82 -0
  16. rustfava/beans/str.py +454 -0
  17. rustfava/beans/types.py +63 -0
  18. rustfava/cli.py +187 -0
  19. rustfava/context.py +13 -0
  20. rustfava/core/__init__.py +729 -0
  21. rustfava/core/accounts.py +161 -0
  22. rustfava/core/attributes.py +145 -0
  23. rustfava/core/budgets.py +207 -0
  24. rustfava/core/charts.py +301 -0
  25. rustfava/core/commodities.py +37 -0
  26. rustfava/core/conversion.py +229 -0
  27. rustfava/core/documents.py +87 -0
  28. rustfava/core/extensions.py +132 -0
  29. rustfava/core/fava_options.py +255 -0
  30. rustfava/core/file.py +542 -0
  31. rustfava/core/filters.py +484 -0
  32. rustfava/core/group_entries.py +97 -0
  33. rustfava/core/ingest.py +509 -0
  34. rustfava/core/inventory.py +167 -0
  35. rustfava/core/misc.py +105 -0
  36. rustfava/core/module_base.py +18 -0
  37. rustfava/core/number.py +106 -0
  38. rustfava/core/query.py +180 -0
  39. rustfava/core/query_shell.py +301 -0
  40. rustfava/core/tree.py +265 -0
  41. rustfava/core/watcher.py +219 -0
  42. rustfava/ext/__init__.py +232 -0
  43. rustfava/ext/auto_commit.py +61 -0
  44. rustfava/ext/portfolio_list/PortfolioList.js +34 -0
  45. rustfava/ext/portfolio_list/__init__.py +29 -0
  46. rustfava/ext/portfolio_list/templates/PortfolioList.html +15 -0
  47. rustfava/ext/rustfava_ext_test/RustfavaExtTest.js +42 -0
  48. rustfava/ext/rustfava_ext_test/__init__.py +207 -0
  49. rustfava/ext/rustfava_ext_test/templates/RustfavaExtTest.html +45 -0
  50. rustfava/ext/rustfava_ext_test/templates/RustfavaExtTestInclude.html +1 -0
  51. rustfava/help/__init__.py +15 -0
  52. rustfava/help/_index.md +29 -0
  53. rustfava/help/beancount_syntax.md +156 -0
  54. rustfava/help/budgets.md +31 -0
  55. rustfava/help/conversion.md +29 -0
  56. rustfava/help/extensions.md +111 -0
  57. rustfava/help/features.md +179 -0
  58. rustfava/help/filters.md +103 -0
  59. rustfava/help/import.md +27 -0
  60. rustfava/help/options.md +289 -0
  61. rustfava/helpers.py +30 -0
  62. rustfava/internal_api.py +221 -0
  63. rustfava/json_api.py +952 -0
  64. rustfava/plugins/__init__.py +3 -0
  65. rustfava/plugins/link_documents.py +107 -0
  66. rustfava/plugins/tag_discovered_documents.py +44 -0
  67. rustfava/py.typed +0 -0
  68. rustfava/rustledger/__init__.py +31 -0
  69. rustfava/rustledger/constants.py +76 -0
  70. rustfava/rustledger/engine.py +485 -0
  71. rustfava/rustledger/loader.py +273 -0
  72. rustfava/rustledger/options.py +202 -0
  73. rustfava/rustledger/query.py +331 -0
  74. rustfava/rustledger/types.py +830 -0
  75. rustfava/serialisation.py +220 -0
  76. rustfava/static/app.css +2988 -0
  77. rustfava/static/app.css.map +7 -0
  78. rustfava/static/app.js +12854 -0
  79. rustfava/static/app.js.map +7 -0
  80. rustfava/static/beancount-JFV44ZVZ.css +5 -0
  81. rustfava/static/beancount-JFV44ZVZ.css.map +7 -0
  82. rustfava/static/beancount-VTTKRGSK.js +4642 -0
  83. rustfava/static/beancount-VTTKRGSK.js.map +7 -0
  84. rustfava/static/bql-MGFRUMBP.js +333 -0
  85. rustfava/static/bql-MGFRUMBP.js.map +7 -0
  86. rustfava/static/chunk-E7ZF4ASL.js +23061 -0
  87. rustfava/static/chunk-E7ZF4ASL.js.map +7 -0
  88. rustfava/static/chunk-V24TLQHT.js +12673 -0
  89. rustfava/static/chunk-V24TLQHT.js.map +7 -0
  90. rustfava/static/favicon.ico +0 -0
  91. rustfava/static/fira-mono-cyrillic-400-normal-BLAGXRCE.woff2 +0 -0
  92. rustfava/static/fira-mono-cyrillic-500-normal-EN7JUAAW.woff2 +0 -0
  93. rustfava/static/fira-mono-cyrillic-ext-400-normal-EX7VARTS.woff2 +0 -0
  94. rustfava/static/fira-mono-cyrillic-ext-500-normal-ZDPTUPRR.woff2 +0 -0
  95. rustfava/static/fira-mono-greek-400-normal-COGHKMOA.woff2 +0 -0
  96. rustfava/static/fira-mono-greek-500-normal-4EN2PKZT.woff2 +0 -0
  97. rustfava/static/fira-mono-greek-ext-400-normal-DYEQIJH7.woff2 +0 -0
  98. rustfava/static/fira-mono-greek-ext-500-normal-SG73CVKQ.woff2 +0 -0
  99. rustfava/static/fira-mono-latin-400-normal-NA3VLV7E.woff2 +0 -0
  100. rustfava/static/fira-mono-latin-500-normal-YC77GFWD.woff2 +0 -0
  101. rustfava/static/fira-mono-latin-ext-400-normal-DIKTZ5PW.woff2 +0 -0
  102. rustfava/static/fira-mono-latin-ext-500-normal-ZWY4UO4V.woff2 +0 -0
  103. rustfava/static/fira-mono-symbols2-400-normal-UITXT77Q.woff2 +0 -0
  104. rustfava/static/fira-mono-symbols2-500-normal-VWPC2EFN.woff2 +0 -0
  105. rustfava/static/fira-sans-cyrillic-400-normal-KLQMBCA6.woff2 +0 -0
  106. rustfava/static/fira-sans-cyrillic-500-normal-NFG7UD6J.woff2 +0 -0
  107. rustfava/static/fira-sans-cyrillic-ext-400-normal-GWO44OPC.woff2 +0 -0
  108. rustfava/static/fira-sans-cyrillic-ext-500-normal-SP47E5SC.woff2 +0 -0
  109. rustfava/static/fira-sans-greek-400-normal-UMQBTLC3.woff2 +0 -0
  110. rustfava/static/fira-sans-greek-500-normal-4ZKHN4FQ.woff2 +0 -0
  111. rustfava/static/fira-sans-greek-ext-400-normal-O2DVJAJZ.woff2 +0 -0
  112. rustfava/static/fira-sans-greek-ext-500-normal-SK6GNWGO.woff2 +0 -0
  113. rustfava/static/fira-sans-latin-400-normal-OYYTPMAV.woff2 +0 -0
  114. rustfava/static/fira-sans-latin-500-normal-SMQPZW5A.woff2 +0 -0
  115. rustfava/static/fira-sans-latin-ext-400-normal-OAUP3WK5.woff2 +0 -0
  116. rustfava/static/fira-sans-latin-ext-500-normal-LY3YDR5Y.woff2 +0 -0
  117. rustfava/static/fira-sans-vietnamese-400-normal-OBMQ72MR.woff2 +0 -0
  118. rustfava/static/fira-sans-vietnamese-500-normal-Y4NZR5EU.woff2 +0 -0
  119. rustfava/static/source-code-pro-cyrillic-400-normal-TO22V6M3.woff2 +0 -0
  120. rustfava/static/source-code-pro-cyrillic-500-normal-OGBWWWYW.woff2 +0 -0
  121. rustfava/static/source-code-pro-cyrillic-ext-400-normal-XH44UCIA.woff2 +0 -0
  122. rustfava/static/source-code-pro-cyrillic-ext-500-normal-3Z6MMVM6.woff2 +0 -0
  123. rustfava/static/source-code-pro-greek-400-normal-OUXXUQWK.woff2 +0 -0
  124. rustfava/static/source-code-pro-greek-500-normal-JA2Z5UXO.woff2 +0 -0
  125. rustfava/static/source-code-pro-greek-ext-400-normal-WCDKMX7U.woff2 +0 -0
  126. rustfava/static/source-code-pro-greek-ext-500-normal-ZHVI4VKW.woff2 +0 -0
  127. rustfava/static/source-code-pro-latin-400-normal-QOGTXED5.woff2 +0 -0
  128. rustfava/static/source-code-pro-latin-500-normal-X57QEOLQ.woff2 +0 -0
  129. rustfava/static/source-code-pro-latin-ext-400-normal-QXC74NBF.woff2 +0 -0
  130. rustfava/static/source-code-pro-latin-ext-500-normal-QGOY7MTT.woff2 +0 -0
  131. rustfava/static/source-code-pro-vietnamese-400-normal-NPDCDTBA.woff2 +0 -0
  132. rustfava/static/source-code-pro-vietnamese-500-normal-M6PJKTR5.woff2 +0 -0
  133. rustfava/static/tree-sitter-beancount-MLXFQBZ5.wasm +0 -0
  134. rustfava/static/web-tree-sitter-RNOQ6E74.wasm +0 -0
  135. rustfava/template_filters.py +64 -0
  136. rustfava/templates/_journal_table.html +156 -0
  137. rustfava/templates/_layout.html +26 -0
  138. rustfava/templates/_query_table.html +88 -0
  139. rustfava/templates/beancount_file +18 -0
  140. rustfava/templates/help.html +23 -0
  141. rustfava/templates/macros/_account_macros.html +5 -0
  142. rustfava/templates/macros/_commodity_macros.html +13 -0
  143. rustfava/translations/bg/LC_MESSAGES/messages.mo +0 -0
  144. rustfava/translations/bg/LC_MESSAGES/messages.po +618 -0
  145. rustfava/translations/ca/LC_MESSAGES/messages.mo +0 -0
  146. rustfava/translations/ca/LC_MESSAGES/messages.po +618 -0
  147. rustfava/translations/de/LC_MESSAGES/messages.mo +0 -0
  148. rustfava/translations/de/LC_MESSAGES/messages.po +618 -0
  149. rustfava/translations/es/LC_MESSAGES/messages.mo +0 -0
  150. rustfava/translations/es/LC_MESSAGES/messages.po +619 -0
  151. rustfava/translations/fa/LC_MESSAGES/messages.mo +0 -0
  152. rustfava/translations/fa/LC_MESSAGES/messages.po +618 -0
  153. rustfava/translations/fr/LC_MESSAGES/messages.mo +0 -0
  154. rustfava/translations/fr/LC_MESSAGES/messages.po +618 -0
  155. rustfava/translations/ja/LC_MESSAGES/messages.mo +0 -0
  156. rustfava/translations/ja/LC_MESSAGES/messages.po +618 -0
  157. rustfava/translations/nl/LC_MESSAGES/messages.mo +0 -0
  158. rustfava/translations/nl/LC_MESSAGES/messages.po +617 -0
  159. rustfava/translations/pt/LC_MESSAGES/messages.mo +0 -0
  160. rustfava/translations/pt/LC_MESSAGES/messages.po +617 -0
  161. rustfava/translations/pt_BR/LC_MESSAGES/messages.mo +0 -0
  162. rustfava/translations/pt_BR/LC_MESSAGES/messages.po +618 -0
  163. rustfava/translations/ru/LC_MESSAGES/messages.mo +0 -0
  164. rustfava/translations/ru/LC_MESSAGES/messages.po +617 -0
  165. rustfava/translations/sk/LC_MESSAGES/messages.mo +0 -0
  166. rustfava/translations/sk/LC_MESSAGES/messages.po +623 -0
  167. rustfava/translations/sv/LC_MESSAGES/messages.mo +0 -0
  168. rustfava/translations/sv/LC_MESSAGES/messages.po +618 -0
  169. rustfava/translations/uk/LC_MESSAGES/messages.mo +0 -0
  170. rustfava/translations/uk/LC_MESSAGES/messages.po +618 -0
  171. rustfava/translations/zh/LC_MESSAGES/messages.mo +0 -0
  172. rustfava/translations/zh/LC_MESSAGES/messages.po +618 -0
  173. rustfava/translations/zh_Hant_TW/LC_MESSAGES/messages.mo +0 -0
  174. rustfava/translations/zh_Hant_TW/LC_MESSAGES/messages.po +618 -0
  175. rustfava/util/__init__.py +157 -0
  176. rustfava/util/date.py +576 -0
  177. rustfava/util/excel.py +118 -0
  178. rustfava/util/ranking.py +79 -0
  179. rustfava/util/sets.py +18 -0
  180. rustfava/util/unreachable.py +20 -0
  181. rustfava-0.1.0.dist-info/METADATA +102 -0
  182. rustfava-0.1.0.dist-info/RECORD +187 -0
  183. rustfava-0.1.0.dist-info/WHEEL +5 -0
  184. rustfava-0.1.0.dist-info/entry_points.txt +2 -0
  185. rustfava-0.1.0.dist-info/licenses/AUTHORS +11 -0
  186. rustfava-0.1.0.dist-info/licenses/LICENSE +21 -0
  187. rustfava-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../frontend/src/codemirror/beancount-highlight.ts", "../../../frontend/node_modules/web-tree-sitter/src/edit.ts", "../../../frontend/node_modules/web-tree-sitter/src/constants.ts", "../../../frontend/node_modules/web-tree-sitter/src/lookahead_iterator.ts", "../../../frontend/node_modules/web-tree-sitter/src/tree.ts", "../../../frontend/node_modules/web-tree-sitter/src/tree_cursor.ts", "../../../frontend/node_modules/web-tree-sitter/src/node.ts", "../../../frontend/node_modules/web-tree-sitter/src/marshal.ts", "../../../frontend/node_modules/web-tree-sitter/src/language.ts", "../../../frontend/node_modules/web-tree-sitter/lib/web-tree-sitter.mjs", "../../../frontend/node_modules/web-tree-sitter/src/bindings.ts", "../../../frontend/node_modules/web-tree-sitter/src/parser.ts", "../../../frontend/node_modules/web-tree-sitter/src/query.ts", "../../../frontend/src/codemirror/beancount-snippets.ts", "../../../frontend/src/codemirror/beancount-autocomplete.ts", "../../../frontend/src/codemirror/beancount-fold.ts", "../../../frontend/src/codemirror/beancount-format.ts", "../../../frontend/src/codemirror/beancount-indent.ts", "../../../frontend/src/codemirror/tree-sitter-parser.ts", "../../../frontend/src/codemirror/beancount-language.ts", "../../../frontend/src/codemirror/ruler.ts", "../../../frontend/src/codemirror/beancount.ts"],
4
+ "sourcesContent": ["import { HighlightStyle } from \"@codemirror/language\";\nimport { tags } from \"@lezer/highlight\";\n\nexport const beancount_highlight = HighlightStyle.define([\n {\n // Dates\n tag: tags.special(tags.number),\n color: \"var(--editor-date)\",\n },\n {\n // Accounts\n tag: tags.className,\n color: \"var(--editor-account)\",\n },\n {\n // Plain comments\n tag: tags.comment,\n color: \"var(--editor-comment)\",\n },\n {\n // Sections\n tag: tags.special(tags.lineComment),\n color: \"var(--editor-comment)\",\n border: \"solid 1px var(--editor-comment)\",\n borderRadius: \"2px\",\n paddingRight: \"10px\",\n fontWeight: \"500\",\n },\n {\n // Currencies\n tag: tags.unit,\n color: \"var(--editor-currencies)\",\n },\n {\n // Directives\n tag: tags.keyword,\n fontWeight: \"500\",\n color: \"var(--editor-directive)\",\n },\n {\n // Option name\n tag: tags.standard(tags.string),\n color: \"var(--editor-class)\",\n },\n {\n // Tag, link\n tag: tags.labelName,\n color: \"var(--editor-label-name)\",\n },\n {\n // Currency value\n tag: tags.number,\n color: \"var(--editor-number)\",\n },\n {\n // Payee, Narration\n tag: tags.string,\n color: \"var(--editor-string)\",\n },\n {\n // Invalid token\n tag: tags.invalid,\n color: \"var(--editor-invalid)\",\n backgroundColor: \"var(--editor-invalid-background)\",\n },\n]);\n", "import { Point, Range } from \"./constants\";\n\nexport class Edit {\n /** The start position of the change. */\n startPosition: Point;\n\n /** The end position of the change before the edit. */\n oldEndPosition: Point;\n\n /** The end position of the change after the edit. */\n newEndPosition: Point;\n\n /** The start index of the change. */\n startIndex: number;\n\n /** The end index of the change before the edit. */\n oldEndIndex: number;\n\n /** The end index of the change after the edit. */\n newEndIndex: number;\n\n constructor({\n startIndex,\n oldEndIndex,\n newEndIndex,\n startPosition,\n oldEndPosition,\n newEndPosition,\n }: {\n startIndex: number;\n oldEndIndex: number;\n newEndIndex: number;\n startPosition: Point;\n oldEndPosition: Point;\n newEndPosition: Point;\n }) {\n this.startIndex = startIndex >>> 0;\n this.oldEndIndex = oldEndIndex >>> 0;\n this.newEndIndex = newEndIndex >>> 0;\n this.startPosition = startPosition;\n this.oldEndPosition = oldEndPosition;\n this.newEndPosition = newEndPosition;\n }\n\n /**\n * Edit a point and index to keep it in-sync with source code that has been edited.\n *\n * This function updates a single point's byte offset and row/column position\n * based on an edit operation. This is useful for editing points without\n * requiring a tree or node instance.\n */\n editPoint(point: Point, index: number): { point: Point; index: number } {\n let newIndex = index;\n const newPoint = { ...point };\n\n if (index >= this.oldEndIndex) {\n newIndex = this.newEndIndex + (index - this.oldEndIndex);\n const originalRow = point.row;\n newPoint.row = this.newEndPosition.row + (point.row - this.oldEndPosition.row);\n newPoint.column = originalRow === this.oldEndPosition.row\n ? this.newEndPosition.column + (point.column - this.oldEndPosition.column)\n : point.column;\n } else if (index > this.startIndex) {\n newIndex = this.newEndIndex;\n newPoint.row = this.newEndPosition.row;\n newPoint.column = this.newEndPosition.column;\n }\n\n return { point: newPoint, index: newIndex };\n }\n\n /**\n * Edit a range to keep it in-sync with source code that has been edited.\n *\n * This function updates a range's start and end positions based on an edit\n * operation. This is useful for editing ranges without requiring a tree\n * or node instance.\n */\n editRange(range: Range): Range {\n const newRange: Range = {\n startIndex: range.startIndex,\n startPosition: { ...range.startPosition },\n endIndex: range.endIndex,\n endPosition: { ...range.endPosition }\n };\n\n if (range.endIndex >= this.oldEndIndex) {\n if (range.endIndex !== Number.MAX_SAFE_INTEGER) {\n newRange.endIndex = this.newEndIndex + (range.endIndex - this.oldEndIndex);\n newRange.endPosition = {\n row: this.newEndPosition.row + (range.endPosition.row - this.oldEndPosition.row),\n column: range.endPosition.row === this.oldEndPosition.row\n ? this.newEndPosition.column + (range.endPosition.column - this.oldEndPosition.column)\n : range.endPosition.column,\n };\n if (newRange.endIndex < this.newEndIndex) {\n newRange.endIndex = Number.MAX_SAFE_INTEGER;\n newRange.endPosition = { row: Number.MAX_SAFE_INTEGER, column: Number.MAX_SAFE_INTEGER };\n }\n }\n } else if (range.endIndex > this.startIndex) {\n newRange.endIndex = this.startIndex;\n newRange.endPosition = { ...this.startPosition };\n }\n\n if (range.startIndex >= this.oldEndIndex) {\n newRange.startIndex = this.newEndIndex + (range.startIndex - this.oldEndIndex);\n newRange.startPosition = {\n row: this.newEndPosition.row + (range.startPosition.row - this.oldEndPosition.row),\n column: range.startPosition.row === this.oldEndPosition.row\n ? this.newEndPosition.column + (range.startPosition.column - this.oldEndPosition.column)\n : range.startPosition.column,\n };\n if (newRange.startIndex < this.newEndIndex) {\n newRange.startIndex = Number.MAX_SAFE_INTEGER;\n newRange.startPosition = { row: Number.MAX_SAFE_INTEGER, column: Number.MAX_SAFE_INTEGER };\n }\n } else if (range.startIndex > this.startIndex) {\n newRange.startIndex = this.startIndex;\n newRange.startPosition = { ...this.startPosition };\n }\n\n return newRange;\n }\n}\n", "import { type MainModule } from '../lib/web-tree-sitter';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { ParseState, type Parser } from './parser';\n\n/**\n * A position in a multi-line text document, in terms of rows and columns.\n *\n * Rows and columns are zero-based.\n */\nexport interface Point {\n /** The zero-based row number. */\n row: number;\n\n /** The zero-based column number. */\n column: number;\n}\n\n/**\n * A range of positions in a multi-line text document, both in terms of bytes\n * and of rows and columns.\n */\nexport interface Range {\n /** The start position of the range. */\n startPosition: Point;\n\n /** The end position of the range. */\n endPosition: Point;\n\n /** The start index of the range. */\n startIndex: number;\n\n /** The end index of the range. */\n endIndex: number;\n}\n\n/** @internal */\nexport const SIZE_OF_SHORT = 2;\n\n/** @internal */\nexport const SIZE_OF_INT = 4;\n\n/** @internal */\nexport const SIZE_OF_CURSOR = 4 * SIZE_OF_INT;\n\n/** @internal */\nexport const SIZE_OF_NODE = 5 * SIZE_OF_INT;\n\n/** @internal */\nexport const SIZE_OF_POINT = 2 * SIZE_OF_INT;\n\n/** @internal */\nexport const SIZE_OF_RANGE = 2 * SIZE_OF_INT + 2 * SIZE_OF_POINT;\n\n/** @internal */\nexport const ZERO_POINT: Point = { row: 0, column: 0 };\n\n/**\n * A callback for parsing that takes an index and point, and should return a string.\n */\nexport type ParseCallback = (index: number, position: Point) => string | undefined;\n\n/**\n * A callback that receives the parse state during parsing.\n */\nexport type ProgressCallback = (progress: ParseState) => boolean;\n\n/**\n * A callback for logging messages.\n *\n * If `isLex` is `true`, the message is from the lexer, otherwise it's from the parser.\n */\nexport type LogCallback = (message: string, isLex: boolean) => void;\n\n// Helper type for internal use\n/** @internal */\nexport const INTERNAL = Symbol('INTERNAL');\n/** @internal */\nexport type Internal = typeof INTERNAL;\n\n// Helper functions for type checking\n/** @internal */\nexport function assertInternal(x: unknown): asserts x is Internal {\n if (x !== INTERNAL) throw new Error('Illegal constructor');\n}\n\n/** @internal */\nexport function isPoint(point?: Point): point is Point {\n return (\n !!point &&\n typeof (point).row === 'number' &&\n typeof (point).column === 'number'\n );\n}\n\n/**\n * @internal\n *\n * Sets the Tree-sitter Wasm module. This should only be called by the {@link Parser} class via {@link Parser.init}.\n */\nexport function setModule(module: MainModule) {\n C = module;\n}\n\n/**\n * @internal\n *\n * `C` is a convenient shorthand for the Tree-sitter Wasm module,\n * which allows us to call all of the exported functions.\n */\nexport let C: MainModule;\n", "import { C, Internal, assertInternal } from './constants';\nimport { Language } from './language';\n\nexport class LookaheadIterator implements Iterable<string> {\n /** @internal */\n private [0] = 0; // Internal handle for Wasm\n\n /** @internal */\n private language: Language;\n\n /** @internal */\n constructor(internal: Internal, address: number, language: Language) {\n assertInternal(internal);\n this[0] = address;\n this.language = language;\n }\n\n /** Get the current symbol of the lookahead iterator. */\n get currentTypeId(): number {\n return C._ts_lookahead_iterator_current_symbol(this[0]);\n }\n\n /** Get the current symbol name of the lookahead iterator. */\n get currentType(): string {\n return this.language.types[this.currentTypeId] || 'ERROR';\n }\n\n /** Delete the lookahead iterator, freeing its resources. */\n delete(): void {\n C._ts_lookahead_iterator_delete(this[0]);\n this[0] = 0;\n }\n\n\n /**\n * Reset the lookahead iterator.\n *\n * This returns `true` if the language was set successfully and `false`\n * otherwise.\n */\n reset(language: Language, stateId: number): boolean {\n if (C._ts_lookahead_iterator_reset(this[0], language[0], stateId)) {\n this.language = language;\n return true;\n }\n return false;\n }\n\n /**\n * Reset the lookahead iterator to another state.\n *\n * This returns `true` if the iterator was reset to the given state and\n * `false` otherwise.\n */\n resetState(stateId: number): boolean {\n return Boolean(C._ts_lookahead_iterator_reset_state(this[0], stateId));\n }\n\n /**\n * Returns an iterator that iterates over the symbols of the lookahead iterator.\n *\n * The iterator will yield the current symbol name as a string for each step\n * until there are no more symbols to iterate over.\n */\n [Symbol.iterator](): Iterator<string> {\n return {\n next: (): IteratorResult<string> => {\n if (C._ts_lookahead_iterator_next(this[0])) {\n return { done: false, value: this.currentType };\n }\n return { done: true, value: '' };\n }\n };\n }\n}\n", "import { INTERNAL, Internal, assertInternal, ParseCallback, Point, Range, SIZE_OF_NODE, SIZE_OF_INT, SIZE_OF_RANGE, C } from './constants';\nimport { Language } from './language';\nimport { Node } from './node';\nimport { TreeCursor } from './tree_cursor';\nimport { marshalEdit, marshalPoint, unmarshalNode, unmarshalRange } from './marshal';\nimport { TRANSFER_BUFFER } from './parser';\nimport { Edit } from './edit';\n\n/** @internal */\nexport function getText(tree: Tree, startIndex: number, endIndex: number, startPosition: Point): string {\n const length = endIndex - startIndex;\n let result = tree.textCallback(startIndex, startPosition);\n if (result) {\n startIndex += result.length;\n while (startIndex < endIndex) {\n const string = tree.textCallback(startIndex, startPosition);\n if (string && string.length > 0) {\n startIndex += string.length;\n result += string;\n } else {\n break;\n }\n }\n if (startIndex > endIndex) {\n result = result.slice(0, length);\n }\n }\n return result ?? '';\n}\n\n/** A tree that represents the syntactic structure of a source code file. */\nexport class Tree {\n /** @internal */\n private [0] = 0; // Internal handle for Wasm\n\n /** @internal */\n textCallback: ParseCallback;\n\n /** The language that was used to parse the syntax tree. */\n language: Language;\n\n /** @internal */\n constructor(internal: Internal, address: number, language: Language, textCallback: ParseCallback) {\n assertInternal(internal);\n this[0] = address;\n this.language = language;\n this.textCallback = textCallback;\n }\n\n /** Create a shallow copy of the syntax tree. This is very fast. */\n copy(): Tree {\n const address = C._ts_tree_copy(this[0]);\n return new Tree(INTERNAL, address, this.language, this.textCallback);\n }\n\n /** Delete the syntax tree, freeing its resources. */\n delete(): void {\n C._ts_tree_delete(this[0]);\n this[0] = 0;\n }\n\n /** Get the root node of the syntax tree. */\n get rootNode(): Node {\n C._ts_tree_root_node_wasm(this[0]);\n return unmarshalNode(this)!;\n }\n\n /**\n * Get the root node of the syntax tree, but with its position shifted\n * forward by the given offset.\n */\n rootNodeWithOffset(offsetBytes: number, offsetExtent: Point): Node {\n const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n C.setValue(address, offsetBytes, 'i32');\n marshalPoint(address + SIZE_OF_INT, offsetExtent);\n C._ts_tree_root_node_with_offset_wasm(this[0]);\n return unmarshalNode(this)!;\n }\n\n /**\n * Edit the syntax tree to keep it in sync with source code that has been\n * edited.\n *\n * You must describe the edit both in terms of byte offsets and in terms of\n * row/column coordinates.\n */\n edit(edit: Edit): void {\n marshalEdit(edit);\n C._ts_tree_edit_wasm(this[0]);\n }\n\n /** Create a new {@link TreeCursor} starting from the root of the tree. */\n walk(): TreeCursor {\n return this.rootNode.walk();\n }\n\n /**\n * Compare this old edited syntax tree to a new syntax tree representing\n * the same document, returning a sequence of ranges whose syntactic\n * structure has changed.\n *\n * For this to work correctly, this syntax tree must have been edited such\n * that its ranges match up to the new tree. Generally, you'll want to\n * call this method right after calling one of the [`Parser::parse`]\n * functions. Call it on the old tree that was passed to parse, and\n * pass the new tree that was returned from `parse`.\n */\n getChangedRanges(other: Tree): Range[] {\n if (!(other instanceof Tree)) {\n throw new TypeError('Argument must be a Tree');\n }\n\n C._ts_tree_get_changed_ranges_wasm(this[0], other[0]);\n const count = C.getValue(TRANSFER_BUFFER, 'i32');\n const buffer = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, 'i32');\n const result = new Array<Range>(count);\n\n if (count > 0) {\n let address = buffer;\n for (let i = 0; i < count; i++) {\n result[i] = unmarshalRange(address);\n address += SIZE_OF_RANGE;\n }\n C._free(buffer);\n }\n return result;\n }\n\n /** Get the included ranges that were used to parse the syntax tree. */\n getIncludedRanges(): Range[] {\n C._ts_tree_included_ranges_wasm(this[0]);\n const count = C.getValue(TRANSFER_BUFFER, 'i32');\n const buffer = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, 'i32');\n const result = new Array<Range>(count);\n\n if (count > 0) {\n let address = buffer;\n for (let i = 0; i < count; i++) {\n result[i] = unmarshalRange(address);\n address += SIZE_OF_RANGE;\n }\n C._free(buffer);\n }\n return result;\n }\n}\n", "import { INTERNAL, Internal, assertInternal, Point, SIZE_OF_NODE, SIZE_OF_CURSOR, C } from './constants';\nimport { marshalNode, marshalPoint, marshalTreeCursor, unmarshalNode, unmarshalPoint, unmarshalTreeCursor } from './marshal';\nimport { Node } from './node';\nimport { TRANSFER_BUFFER } from './parser';\nimport { getText, Tree } from './tree';\n\n/** A stateful object for walking a syntax {@link Tree} efficiently. */\nexport class TreeCursor {\n /** @internal */\n // @ts-expect-error: never read\n private [0] = 0; // Internal handle for Wasm\n\n /** @internal */\n // @ts-expect-error: never read\n private [1] = 0; // Internal handle for Wasm\n\n /** @internal */\n // @ts-expect-error: never read\n private [2] = 0; // Internal handle for Wasm\n\n /** @internal */\n // @ts-expect-error: never read\n private [3] = 0; // Internal handle for Wasm\n\n /** @internal */\n private tree: Tree;\n\n /** @internal */\n constructor(internal: Internal, tree: Tree) {\n assertInternal(internal);\n this.tree = tree;\n unmarshalTreeCursor(this);\n }\n\n /** Creates a deep copy of the tree cursor. This allocates new memory. */\n copy(): TreeCursor {\n const copy = new TreeCursor(INTERNAL, this.tree);\n C._ts_tree_cursor_copy_wasm(this.tree[0]);\n unmarshalTreeCursor(copy);\n return copy;\n }\n\n /** Delete the tree cursor, freeing its resources. */\n delete(): void {\n marshalTreeCursor(this);\n C._ts_tree_cursor_delete_wasm(this.tree[0]);\n this[0] = this[1] = this[2] = 0;\n }\n\n /** Get the tree cursor's current {@link Node}. */\n get currentNode(): Node {\n marshalTreeCursor(this);\n C._ts_tree_cursor_current_node_wasm(this.tree[0]);\n return unmarshalNode(this.tree)!;\n }\n\n /**\n * Get the numerical field id of this tree cursor's current node.\n *\n * See also {@link TreeCursor#currentFieldName}.\n */\n get currentFieldId(): number {\n marshalTreeCursor(this);\n return C._ts_tree_cursor_current_field_id_wasm(this.tree[0]);\n }\n\n /** Get the field name of this tree cursor's current node. */\n get currentFieldName(): string | null {\n return this.tree.language.fields[this.currentFieldId];\n }\n\n /**\n * Get the depth of the cursor's current node relative to the original\n * node that the cursor was constructed with.\n */\n get currentDepth(): number {\n marshalTreeCursor(this);\n return C._ts_tree_cursor_current_depth_wasm(this.tree[0]);\n }\n\n /**\n * Get the index of the cursor's current node out of all of the\n * descendants of the original node that the cursor was constructed with.\n */\n get currentDescendantIndex(): number {\n marshalTreeCursor(this);\n return C._ts_tree_cursor_current_descendant_index_wasm(this.tree[0]);\n }\n\n /** Get the type of the cursor's current node. */\n get nodeType(): string {\n return this.tree.language.types[this.nodeTypeId] || 'ERROR';\n }\n\n /** Get the type id of the cursor's current node. */\n get nodeTypeId(): number {\n marshalTreeCursor(this);\n return C._ts_tree_cursor_current_node_type_id_wasm(this.tree[0]);\n }\n\n /** Get the state id of the cursor's current node. */\n get nodeStateId(): number {\n marshalTreeCursor(this);\n return C._ts_tree_cursor_current_node_state_id_wasm(this.tree[0]);\n }\n\n /** Get the id of the cursor's current node. */\n get nodeId(): number {\n marshalTreeCursor(this);\n return C._ts_tree_cursor_current_node_id_wasm(this.tree[0]);\n }\n\n /**\n * Check if the cursor's current node is *named*.\n *\n * Named nodes correspond to named rules in the grammar, whereas\n * *anonymous* nodes correspond to string literals in the grammar.\n */\n get nodeIsNamed(): boolean {\n marshalTreeCursor(this);\n return C._ts_tree_cursor_current_node_is_named_wasm(this.tree[0]) === 1;\n }\n\n /**\n * Check if the cursor's current node is *missing*.\n *\n * Missing nodes are inserted by the parser in order to recover from\n * certain kinds of syntax errors.\n */\n get nodeIsMissing(): boolean {\n marshalTreeCursor(this);\n return C._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0]) === 1;\n }\n\n /** Get the string content of the cursor's current node. */\n get nodeText(): string {\n marshalTreeCursor(this);\n const startIndex = C._ts_tree_cursor_start_index_wasm(this.tree[0]);\n const endIndex = C._ts_tree_cursor_end_index_wasm(this.tree[0]);\n C._ts_tree_cursor_start_position_wasm(this.tree[0]);\n const startPosition = unmarshalPoint(TRANSFER_BUFFER);\n return getText(this.tree, startIndex, endIndex, startPosition);\n }\n\n /** Get the start position of the cursor's current node. */\n get startPosition(): Point {\n marshalTreeCursor(this);\n C._ts_tree_cursor_start_position_wasm(this.tree[0]);\n return unmarshalPoint(TRANSFER_BUFFER);\n }\n\n /** Get the end position of the cursor's current node. */\n get endPosition(): Point {\n marshalTreeCursor(this);\n C._ts_tree_cursor_end_position_wasm(this.tree[0]);\n return unmarshalPoint(TRANSFER_BUFFER);\n }\n\n /** Get the start index of the cursor's current node. */\n get startIndex(): number {\n marshalTreeCursor(this);\n return C._ts_tree_cursor_start_index_wasm(this.tree[0]);\n }\n\n /** Get the end index of the cursor's current node. */\n get endIndex(): number {\n marshalTreeCursor(this);\n return C._ts_tree_cursor_end_index_wasm(this.tree[0]);\n }\n\n /**\n * Move this cursor to the first child of its current node.\n *\n * This returns `true` if the cursor successfully moved, and returns\n * `false` if there were no children.\n */\n gotoFirstChild(): boolean {\n marshalTreeCursor(this);\n const result = C._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);\n unmarshalTreeCursor(this);\n return result === 1;\n }\n\n /**\n * Move this cursor to the last child of its current node.\n *\n * This returns `true` if the cursor successfully moved, and returns\n * `false` if there were no children.\n *\n * Note that this function may be slower than\n * {@link TreeCursor#gotoFirstChild} because it needs to\n * iterate through all the children to compute the child's position.\n */\n gotoLastChild(): boolean {\n marshalTreeCursor(this);\n const result = C._ts_tree_cursor_goto_last_child_wasm(this.tree[0]);\n unmarshalTreeCursor(this);\n return result === 1;\n }\n\n /**\n * Move this cursor to the parent of its current node.\n *\n * This returns `true` if the cursor successfully moved, and returns\n * `false` if there was no parent node (the cursor was already on the\n * root node).\n *\n * Note that the node the cursor was constructed with is considered the root\n * of the cursor, and the cursor cannot walk outside this node.\n */\n gotoParent(): boolean {\n marshalTreeCursor(this);\n const result = C._ts_tree_cursor_goto_parent_wasm(this.tree[0]);\n unmarshalTreeCursor(this);\n return result === 1;\n }\n\n /**\n * Move this cursor to the next sibling of its current node.\n *\n * This returns `true` if the cursor successfully moved, and returns\n * `false` if there was no next sibling node.\n *\n * Note that the node the cursor was constructed with is considered the root\n * of the cursor, and the cursor cannot walk outside this node.\n */\n gotoNextSibling(): boolean {\n marshalTreeCursor(this);\n const result = C._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);\n unmarshalTreeCursor(this);\n return result === 1;\n }\n\n /**\n * Move this cursor to the previous sibling of its current node.\n *\n * This returns `true` if the cursor successfully moved, and returns\n * `false` if there was no previous sibling node.\n *\n * Note that this function may be slower than\n * {@link TreeCursor#gotoNextSibling} due to how node\n * positions are stored. In the worst case, this will need to iterate\n * through all the children up to the previous sibling node to recalculate\n * its position. Also note that the node the cursor was constructed with is\n * considered the root of the cursor, and the cursor cannot walk outside this node.\n */\n gotoPreviousSibling(): boolean {\n marshalTreeCursor(this);\n const result = C._ts_tree_cursor_goto_previous_sibling_wasm(this.tree[0]);\n unmarshalTreeCursor(this);\n return result === 1;\n }\n\n /**\n * Move the cursor to the node that is the nth descendant of\n * the original node that the cursor was constructed with, where\n * zero represents the original node itself.\n */\n gotoDescendant(goalDescendantIndex: number): void {\n marshalTreeCursor(this);\n C._ts_tree_cursor_goto_descendant_wasm(this.tree[0], goalDescendantIndex);\n unmarshalTreeCursor(this);\n }\n\n /**\n * Move this cursor to the first child of its current node that contains or\n * starts after the given byte offset.\n *\n * This returns `true` if the cursor successfully moved to a child node, and returns\n * `false` if no such child was found.\n */\n gotoFirstChildForIndex(goalIndex: number): boolean {\n marshalTreeCursor(this);\n C.setValue(TRANSFER_BUFFER + SIZE_OF_CURSOR, goalIndex, 'i32');\n const result = C._ts_tree_cursor_goto_first_child_for_index_wasm(this.tree[0]);\n unmarshalTreeCursor(this);\n return result === 1;\n }\n\n /**\n * Move this cursor to the first child of its current node that contains or\n * starts after the given byte offset.\n *\n * This returns the index of the child node if one was found, and returns\n * `null` if no such child was found.\n */\n gotoFirstChildForPosition(goalPosition: Point): boolean {\n marshalTreeCursor(this);\n marshalPoint(TRANSFER_BUFFER + SIZE_OF_CURSOR, goalPosition);\n const result = C._ts_tree_cursor_goto_first_child_for_position_wasm(this.tree[0]);\n unmarshalTreeCursor(this);\n return result === 1;\n }\n\n /**\n * Re-initialize this tree cursor to start at the original node that the\n * cursor was constructed with.\n */\n reset(node: Node): void {\n marshalNode(node);\n marshalTreeCursor(this, TRANSFER_BUFFER + SIZE_OF_NODE);\n C._ts_tree_cursor_reset_wasm(this.tree[0]);\n unmarshalTreeCursor(this);\n }\n\n /**\n * Re-initialize a tree cursor to the same position as another cursor.\n *\n * Unlike {@link TreeCursor#reset}, this will not lose parent\n * information and allows reusing already created cursors.\n */\n resetTo(cursor: TreeCursor): void {\n marshalTreeCursor(this, TRANSFER_BUFFER);\n marshalTreeCursor(cursor, TRANSFER_BUFFER + SIZE_OF_CURSOR);\n C._ts_tree_cursor_reset_to_wasm(this.tree[0], cursor.tree[0]);\n unmarshalTreeCursor(this);\n }\n}\n", "import { INTERNAL, Internal, assertInternal, SIZE_OF_INT, SIZE_OF_NODE, SIZE_OF_POINT, ZERO_POINT, isPoint, C, Point } from './constants';\nimport { getText, Tree } from './tree';\nimport { TreeCursor } from './tree_cursor';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { Language } from './language';\nimport { marshalNode, marshalPoint, unmarshalNode, unmarshalPoint } from './marshal';\nimport { TRANSFER_BUFFER } from './parser';\nimport { Edit } from './edit';\n\n/** A single node within a syntax {@link Tree}. */\nexport class Node {\n /** @internal */\n // @ts-expect-error: never read\n private [0] = 0; // Internal handle for Wasm\n\n /** @internal */\n private _children?: Node[];\n\n /** @internal */\n private _namedChildren?: Node[];\n\n /** @internal */\n constructor(\n internal: Internal,\n {\n id,\n tree,\n startIndex,\n startPosition,\n other,\n }: {\n id: number;\n tree: Tree;\n startIndex: number;\n startPosition: Point;\n other: number;\n }\n ) {\n assertInternal(internal);\n this[0] = other;\n this.id = id;\n this.tree = tree;\n this.startIndex = startIndex;\n this.startPosition = startPosition;\n }\n\n /**\n * The numeric id for this node that is unique.\n *\n * Within a given syntax tree, no two nodes have the same id. However:\n *\n * * If a new tree is created based on an older tree, and a node from the old tree is reused in\n * the process, then that node will have the same id in both trees.\n *\n * * A node not marked as having changes does not guarantee it was reused.\n *\n * * If a node is marked as having changed in the old tree, it will not be reused.\n */\n id: number;\n\n /** The byte index where this node starts. */\n startIndex: number;\n\n /** The position where this node starts. */\n startPosition: Point;\n\n /** The tree that this node belongs to. */\n tree: Tree;\n\n /** Get this node's type as a numerical id. */\n get typeId(): number {\n marshalNode(this);\n return C._ts_node_symbol_wasm(this.tree[0]);\n }\n\n /**\n * Get the node's type as a numerical id as it appears in the grammar,\n * ignoring aliases.\n */\n get grammarId(): number {\n marshalNode(this);\n return C._ts_node_grammar_symbol_wasm(this.tree[0]);\n }\n\n /** Get this node's type as a string. */\n get type(): string {\n return this.tree.language.types[this.typeId] || 'ERROR';\n }\n\n /**\n * Get this node's symbol name as it appears in the grammar, ignoring\n * aliases as a string.\n */\n get grammarType(): string {\n return this.tree.language.types[this.grammarId] || 'ERROR';\n }\n\n /**\n * Check if this node is *named*.\n *\n * Named nodes correspond to named rules in the grammar, whereas\n * *anonymous* nodes correspond to string literals in the grammar.\n */\n get isNamed(): boolean {\n marshalNode(this);\n return C._ts_node_is_named_wasm(this.tree[0]) === 1;\n }\n\n /**\n * Check if this node is *extra*.\n *\n * Extra nodes represent things like comments, which are not required\n * by the grammar, but can appear anywhere.\n */\n get isExtra(): boolean {\n marshalNode(this);\n return C._ts_node_is_extra_wasm(this.tree[0]) === 1;\n }\n\n /**\n * Check if this node represents a syntax error.\n *\n * Syntax errors represent parts of the code that could not be incorporated\n * into a valid syntax tree.\n */\n get isError(): boolean {\n marshalNode(this);\n return C._ts_node_is_error_wasm(this.tree[0]) === 1;\n }\n\n /**\n * Check if this node is *missing*.\n *\n * Missing nodes are inserted by the parser in order to recover from\n * certain kinds of syntax errors.\n */\n get isMissing(): boolean {\n marshalNode(this);\n return C._ts_node_is_missing_wasm(this.tree[0]) === 1;\n }\n\n /** Check if this node has been edited. */\n get hasChanges(): boolean {\n marshalNode(this);\n return C._ts_node_has_changes_wasm(this.tree[0]) === 1;\n }\n\n /**\n * Check if this node represents a syntax error or contains any syntax\n * errors anywhere within it.\n */\n get hasError(): boolean {\n marshalNode(this);\n return C._ts_node_has_error_wasm(this.tree[0]) === 1;\n }\n\n /** Get the byte index where this node ends. */\n get endIndex(): number {\n marshalNode(this);\n return C._ts_node_end_index_wasm(this.tree[0]);\n }\n\n /** Get the position where this node ends. */\n get endPosition(): Point {\n marshalNode(this);\n C._ts_node_end_point_wasm(this.tree[0]);\n return unmarshalPoint(TRANSFER_BUFFER);\n }\n\n /** Get the string content of this node. */\n get text(): string {\n return getText(this.tree, this.startIndex, this.endIndex, this.startPosition);\n }\n\n /** Get this node's parse state. */\n get parseState(): number {\n marshalNode(this);\n return C._ts_node_parse_state_wasm(this.tree[0]);\n }\n\n /** Get the parse state after this node. */\n get nextParseState(): number {\n marshalNode(this);\n return C._ts_node_next_parse_state_wasm(this.tree[0]);\n }\n\n /** Check if this node is equal to another node. */\n equals(other: Node): boolean {\n return this.tree === other.tree && this.id === other.id;\n }\n\n /**\n * Get the node's child at the given index, where zero represents the first child.\n *\n * This method is fairly fast, but its cost is technically log(n), so if\n * you might be iterating over a long list of children, you should use\n * {@link Node#children} instead.\n */\n child(index: number): Node | null {\n marshalNode(this);\n C._ts_node_child_wasm(this.tree[0], index);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Get this node's *named* child at the given index.\n *\n * See also {@link Node#isNamed}.\n * This method is fairly fast, but its cost is technically log(n), so if\n * you might be iterating over a long list of children, you should use\n * {@link Node#namedChildren} instead.\n */\n namedChild(index: number): Node | null {\n marshalNode(this);\n C._ts_node_named_child_wasm(this.tree[0], index);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Get this node's child with the given numerical field id.\n *\n * See also {@link Node#childForFieldName}. You can\n * convert a field name to an id using {@link Language#fieldIdForName}.\n */\n childForFieldId(fieldId: number): Node | null {\n marshalNode(this);\n C._ts_node_child_by_field_id_wasm(this.tree[0], fieldId);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Get the first child with the given field name.\n *\n * If multiple children may have the same field name, access them using\n * {@link Node#childrenForFieldName}.\n */\n childForFieldName(fieldName: string): Node | null {\n const fieldId = this.tree.language.fields.indexOf(fieldName);\n if (fieldId !== -1) return this.childForFieldId(fieldId);\n return null;\n }\n\n /** Get the field name of this node's child at the given index. */\n fieldNameForChild(index: number): string | null {\n marshalNode(this);\n const address = C._ts_node_field_name_for_child_wasm(this.tree[0], index);\n if (!address) return null;\n return C.AsciiToString(address);\n }\n\n /** Get the field name of this node's named child at the given index. */\n fieldNameForNamedChild(index: number): string | null {\n marshalNode(this);\n const address = C._ts_node_field_name_for_named_child_wasm(this.tree[0], index);\n if (!address) return null;\n return C.AsciiToString(address);\n }\n /**\n * Get an array of this node's children with a given field name.\n *\n * See also {@link Node#children}.\n */\n childrenForFieldName(fieldName: string): Node[] {\n const fieldId = this.tree.language.fields.indexOf(fieldName);\n if (fieldId !== -1 && fieldId !== 0) return this.childrenForFieldId(fieldId);\n return [];\n }\n\n /**\n * Get an array of this node's children with a given field id.\n *\n * See also {@link Node#childrenForFieldName}.\n */\n childrenForFieldId(fieldId: number): Node[] {\n marshalNode(this);\n C._ts_node_children_by_field_id_wasm(this.tree[0], fieldId);\n const count = C.getValue(TRANSFER_BUFFER, 'i32');\n const buffer = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, 'i32');\n const result = new Array<Node>(count);\n\n if (count > 0) {\n let address = buffer;\n for (let i = 0; i < count; i++) {\n result[i] = unmarshalNode(this.tree, address)!;\n address += SIZE_OF_NODE;\n }\n C._free(buffer);\n }\n return result;\n }\n\n /** Get the node's first child that contains or starts after the given byte offset. */\n firstChildForIndex(index: number): Node | null {\n marshalNode(this);\n const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n C.setValue(address, index, 'i32');\n C._ts_node_first_child_for_byte_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get the node's first named child that contains or starts after the given byte offset. */\n firstNamedChildForIndex(index: number): Node | null {\n marshalNode(this);\n const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n C.setValue(address, index, 'i32');\n C._ts_node_first_named_child_for_byte_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get this node's number of children. */\n get childCount(): number {\n marshalNode(this);\n return C._ts_node_child_count_wasm(this.tree[0]);\n }\n\n\n /**\n * Get this node's number of *named* children.\n *\n * See also {@link Node#isNamed}.\n */\n get namedChildCount(): number {\n marshalNode(this);\n return C._ts_node_named_child_count_wasm(this.tree[0]);\n }\n\n /** Get this node's first child. */\n get firstChild(): Node | null {\n return this.child(0);\n }\n\n /**\n * Get this node's first named child.\n *\n * See also {@link Node#isNamed}.\n */\n get firstNamedChild(): Node | null {\n return this.namedChild(0);\n }\n\n /** Get this node's last child. */\n get lastChild(): Node | null {\n return this.child(this.childCount - 1);\n }\n\n /**\n * Get this node's last named child.\n *\n * See also {@link Node#isNamed}.\n */\n get lastNamedChild(): Node | null {\n return this.namedChild(this.namedChildCount - 1);\n }\n\n /**\n * Iterate over this node's children.\n *\n * If you're walking the tree recursively, you may want to use the\n * {@link TreeCursor} APIs directly instead.\n */\n get children(): Node[] {\n if (!this._children) {\n marshalNode(this);\n C._ts_node_children_wasm(this.tree[0]);\n const count = C.getValue(TRANSFER_BUFFER, 'i32');\n const buffer = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, 'i32');\n this._children = new Array<Node>(count);\n if (count > 0) {\n let address = buffer;\n for (let i = 0; i < count; i++) {\n this._children[i] = unmarshalNode(this.tree, address)!;\n address += SIZE_OF_NODE;\n }\n C._free(buffer);\n }\n }\n return this._children;\n }\n\n /**\n * Iterate over this node's named children.\n *\n * See also {@link Node#children}.\n */\n get namedChildren(): Node[] {\n if (!this._namedChildren) {\n marshalNode(this);\n C._ts_node_named_children_wasm(this.tree[0]);\n const count = C.getValue(TRANSFER_BUFFER, 'i32');\n const buffer = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, 'i32');\n this._namedChildren = new Array<Node>(count);\n if (count > 0) {\n let address = buffer;\n for (let i = 0; i < count; i++) {\n this._namedChildren[i] = unmarshalNode(this.tree, address)!;\n address += SIZE_OF_NODE;\n }\n C._free(buffer);\n }\n }\n return this._namedChildren;\n }\n\n /**\n * Get the descendants of this node that are the given type, or in the given types array.\n *\n * The types array should contain node type strings, which can be retrieved from {@link Language#types}.\n *\n * Additionally, a `startPosition` and `endPosition` can be passed in to restrict the search to a byte range.\n */\n descendantsOfType(\n types: string | string[],\n startPosition: Point = ZERO_POINT,\n endPosition: Point = ZERO_POINT\n ): Node[] {\n if (!Array.isArray(types)) types = [types];\n\n // Convert the type strings to numeric type symbols\n const symbols: number[] = [];\n const typesBySymbol = this.tree.language.types;\n for (const node_type of types) {\n if (node_type == \"ERROR\") {\n symbols.push(65535); // Internally, ts_builtin_sym_error is -1, which is UINT_16MAX\n }\n }\n for (let i = 0, n = typesBySymbol.length; i < n; i++) {\n if (types.includes(typesBySymbol[i])) {\n symbols.push(i);\n }\n }\n\n // Copy the array of symbols to the Wasm heap\n const symbolsAddress = C._malloc(SIZE_OF_INT * symbols.length);\n for (let i = 0, n = symbols.length; i < n; i++) {\n C.setValue(symbolsAddress + i * SIZE_OF_INT, symbols[i], 'i32');\n }\n\n // Call the C API to compute the descendants\n marshalNode(this);\n C._ts_node_descendants_of_type_wasm(\n this.tree[0],\n symbolsAddress,\n symbols.length,\n startPosition.row,\n startPosition.column,\n endPosition.row,\n endPosition.column\n );\n\n // Instantiate the nodes based on the data returned\n const descendantCount = C.getValue(TRANSFER_BUFFER, 'i32');\n const descendantAddress = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, 'i32');\n const result = new Array<Node>(descendantCount);\n if (descendantCount > 0) {\n let address = descendantAddress;\n for (let i = 0; i < descendantCount; i++) {\n result[i] = unmarshalNode(this.tree, address)!;\n address += SIZE_OF_NODE;\n }\n }\n\n // Free the intermediate buffers\n C._free(descendantAddress);\n C._free(symbolsAddress);\n return result;\n }\n\n /** Get this node's next sibling. */\n get nextSibling(): Node | null {\n marshalNode(this);\n C._ts_node_next_sibling_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get this node's previous sibling. */\n get previousSibling(): Node | null {\n marshalNode(this);\n C._ts_node_prev_sibling_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Get this node's next *named* sibling.\n *\n * See also {@link Node#isNamed}.\n */\n get nextNamedSibling(): Node | null {\n marshalNode(this);\n C._ts_node_next_named_sibling_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Get this node's previous *named* sibling.\n *\n * See also {@link Node#isNamed}.\n */\n get previousNamedSibling(): Node | null {\n marshalNode(this);\n C._ts_node_prev_named_sibling_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get the node's number of descendants, including one for the node itself. */\n get descendantCount(): number {\n marshalNode(this);\n return C._ts_node_descendant_count_wasm(this.tree[0]);\n }\n\n /**\n * Get this node's immediate parent.\n * Prefer {@link Node#childWithDescendant} for iterating over this node's ancestors.\n */\n get parent(): Node | null {\n marshalNode(this);\n C._ts_node_parent_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Get the node that contains `descendant`.\n *\n * Note that this can return `descendant` itself.\n */\n childWithDescendant(descendant: Node): Node | null {\n marshalNode(this);\n marshalNode(descendant, 1);\n C._ts_node_child_with_descendant_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get the smallest node within this node that spans the given byte range. */\n descendantForIndex(start: number, end: number = start): Node | null {\n if (typeof start !== 'number' || typeof end !== 'number') {\n throw new Error('Arguments must be numbers');\n }\n\n marshalNode(this);\n const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n C.setValue(address, start, 'i32');\n C.setValue(address + SIZE_OF_INT, end, 'i32');\n C._ts_node_descendant_for_index_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get the smallest named node within this node that spans the given byte range. */\n namedDescendantForIndex(start: number, end: number = start): Node | null {\n if (typeof start !== 'number' || typeof end !== 'number') {\n throw new Error('Arguments must be numbers');\n }\n\n marshalNode(this);\n const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n C.setValue(address, start, 'i32');\n C.setValue(address + SIZE_OF_INT, end, 'i32');\n C._ts_node_named_descendant_for_index_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get the smallest node within this node that spans the given point range. */\n descendantForPosition(start: Point, end: Point = start) {\n if (!isPoint(start) || !isPoint(end)) {\n throw new Error('Arguments must be {row, column} objects');\n }\n\n marshalNode(this);\n const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n marshalPoint(address, start);\n marshalPoint(address + SIZE_OF_POINT, end);\n C._ts_node_descendant_for_position_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get the smallest named node within this node that spans the given point range. */\n namedDescendantForPosition(start: Point, end: Point = start) {\n if (!isPoint(start) || !isPoint(end)) {\n throw new Error('Arguments must be {row, column} objects');\n }\n\n marshalNode(this);\n const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n marshalPoint(address, start);\n marshalPoint(address + SIZE_OF_POINT, end);\n C._ts_node_named_descendant_for_position_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Create a new {@link TreeCursor} starting from this node.\n *\n * Note that the given node is considered the root of the cursor,\n * and the cursor cannot walk outside this node.\n */\n walk(): TreeCursor {\n marshalNode(this);\n C._ts_tree_cursor_new_wasm(this.tree[0]);\n return new TreeCursor(INTERNAL, this.tree);\n }\n\n /**\n * Edit this node to keep it in-sync with source code that has been edited.\n *\n * This function is only rarely needed. When you edit a syntax tree with\n * the {@link Tree#edit} method, all of the nodes that you retrieve from\n * the tree afterward will already reflect the edit. You only need to\n * use {@link Node#edit} when you have a specific {@link Node} instance that\n * you want to keep and continue to use after an edit.\n */\n edit(edit: Edit) {\n if (this.startIndex >= edit.oldEndIndex) {\n this.startIndex = edit.newEndIndex + (this.startIndex - edit.oldEndIndex);\n let subbedPointRow;\n let subbedPointColumn;\n if (this.startPosition.row > edit.oldEndPosition.row) {\n subbedPointRow = this.startPosition.row - edit.oldEndPosition.row;\n subbedPointColumn = this.startPosition.column;\n } else {\n subbedPointRow = 0;\n subbedPointColumn = this.startPosition.column;\n if (this.startPosition.column >= edit.oldEndPosition.column) {\n subbedPointColumn =\n this.startPosition.column - edit.oldEndPosition.column;\n }\n }\n\n if (subbedPointRow > 0) {\n this.startPosition.row += subbedPointRow;\n this.startPosition.column = subbedPointColumn;\n } else {\n this.startPosition.column += subbedPointColumn;\n }\n } else if (this.startIndex > edit.startIndex) {\n this.startIndex = edit.newEndIndex;\n this.startPosition.row = edit.newEndPosition.row;\n this.startPosition.column = edit.newEndPosition.column;\n }\n }\n\n /** Get the S-expression representation of this node. */\n toString(): string {\n marshalNode(this);\n const address = C._ts_node_to_string_wasm(this.tree[0]);\n const result = C.AsciiToString(address);\n C._free(address);\n return result;\n }\n}\n", "import { INTERNAL, Point, Range, SIZE_OF_INT, SIZE_OF_NODE, SIZE_OF_POINT, C } from \"./constants\";\nimport { Node } from \"./node\";\nimport { Tree } from \"./tree\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { Query, QueryCapture, type QueryMatch } from \"./query\";\nimport { TreeCursor } from \"./tree_cursor\";\nimport { TRANSFER_BUFFER } from \"./parser\";\nimport { LanguageMetadata } from \"./language\";\nimport { Edit } from \"./edit\";\n\n/**\n * @internal\n *\n * Unmarshals a {@link QueryMatch} to the transfer buffer.\n */\nexport function unmarshalCaptures(\n query: Query,\n tree: Tree,\n address: number,\n patternIndex: number,\n result: QueryCapture[]\n) {\n for (let i = 0, n = result.length; i < n; i++) {\n const captureIndex = C.getValue(address, 'i32');\n address += SIZE_OF_INT;\n const node = unmarshalNode(tree, address)!;\n address += SIZE_OF_NODE;\n result[i] = {patternIndex, name: query.captureNames[captureIndex], node};\n }\n return address;\n}\n\n/**\n * @internal\n *\n * Marshals a {@link Node} to the transfer buffer.\n */\nexport function marshalNode(node: Node, index = 0) {\n let address = TRANSFER_BUFFER + index * SIZE_OF_NODE;\n C.setValue(address, node.id, 'i32');\n address += SIZE_OF_INT;\n C.setValue(address, node.startIndex, 'i32');\n address += SIZE_OF_INT;\n C.setValue(address, node.startPosition.row, 'i32');\n address += SIZE_OF_INT;\n C.setValue(address, node.startPosition.column, 'i32');\n address += SIZE_OF_INT;\n C.setValue(address, node[0], 'i32');\n}\n\n/**\n * @internal\n *\n * Unmarshals a {@link Node} from the transfer buffer.\n */\nexport function unmarshalNode(tree: Tree, address = TRANSFER_BUFFER): Node | null {\n const id = C.getValue(address, 'i32');\n address += SIZE_OF_INT;\n if (id === 0) return null;\n\n const index = C.getValue(address, 'i32');\n address += SIZE_OF_INT;\n const row = C.getValue(address, 'i32');\n address += SIZE_OF_INT;\n const column = C.getValue(address, 'i32');\n address += SIZE_OF_INT;\n const other = C.getValue(address, 'i32');\n\n const result = new Node(INTERNAL, {\n id,\n tree,\n startIndex: index,\n startPosition: {row, column},\n other,\n });\n\n return result;\n}\n\n/**\n * @internal\n *\n * Marshals a {@link TreeCursor} to the transfer buffer.\n */\nexport function marshalTreeCursor(cursor: TreeCursor, address = TRANSFER_BUFFER) {\n C.setValue(address + 0 * SIZE_OF_INT, cursor[0], 'i32');\n C.setValue(address + 1 * SIZE_OF_INT, cursor[1], 'i32');\n C.setValue(address + 2 * SIZE_OF_INT, cursor[2], 'i32');\n C.setValue(address + 3 * SIZE_OF_INT, cursor[3], 'i32');\n}\n\n/**\n * @internal\n *\n * Unmarshals a {@link TreeCursor} from the transfer buffer.\n */\nexport function unmarshalTreeCursor(cursor: TreeCursor) {\n cursor[0] = C.getValue(TRANSFER_BUFFER + 0 * SIZE_OF_INT, 'i32');\n cursor[1] = C.getValue(TRANSFER_BUFFER + 1 * SIZE_OF_INT, 'i32');\n cursor[2] = C.getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, 'i32');\n cursor[3] = C.getValue(TRANSFER_BUFFER + 3 * SIZE_OF_INT, 'i32');\n}\n\n/**\n * @internal\n *\n * Marshals a {@link Point} to the transfer buffer.\n */\nexport function marshalPoint(address: number, point: Point): void {\n C.setValue(address, point.row, 'i32');\n C.setValue(address + SIZE_OF_INT, point.column, 'i32');\n}\n\n/**\n * @internal\n *\n * Unmarshals a {@link Point} from the transfer buffer.\n */\nexport function unmarshalPoint(address: number): Point {\n const result = {\n row: C.getValue(address, 'i32') >>> 0,\n column: C.getValue(address + SIZE_OF_INT, 'i32') >>> 0,\n };\n return result;\n}\n\n/**\n * @internal\n *\n * Marshals a {@link Range} to the transfer buffer.\n */\nexport function marshalRange(address: number, range: Range): void {\n marshalPoint(address, range.startPosition); address += SIZE_OF_POINT;\n marshalPoint(address, range.endPosition); address += SIZE_OF_POINT;\n C.setValue(address, range.startIndex, 'i32'); address += SIZE_OF_INT;\n C.setValue(address, range.endIndex, 'i32'); address += SIZE_OF_INT;\n}\n\n/**\n * @internal\n *\n * Unmarshals a {@link Range} from the transfer buffer.\n */\nexport function unmarshalRange(address: number): Range {\n const result = {} as Range;\n result.startPosition = unmarshalPoint(address); address += SIZE_OF_POINT;\n result.endPosition = unmarshalPoint(address); address += SIZE_OF_POINT;\n result.startIndex = C.getValue(address, 'i32') >>> 0; address += SIZE_OF_INT;\n result.endIndex = C.getValue(address, 'i32') >>> 0;\n return result;\n}\n\n/**\n * @internal\n *\n * Marshals an {@link Edit} to the transfer buffer.\n */\nexport function marshalEdit(edit: Edit, address = TRANSFER_BUFFER) {\n marshalPoint(address, edit.startPosition); address += SIZE_OF_POINT;\n marshalPoint(address, edit.oldEndPosition); address += SIZE_OF_POINT;\n marshalPoint(address, edit.newEndPosition); address += SIZE_OF_POINT;\n C.setValue(address, edit.startIndex, 'i32'); address += SIZE_OF_INT;\n C.setValue(address, edit.oldEndIndex, 'i32'); address += SIZE_OF_INT;\n C.setValue(address, edit.newEndIndex, 'i32'); address += SIZE_OF_INT;\n}\n\n/**\n * @internal\n *\n * Unmarshals a {@link LanguageMetadata} from the transfer buffer.\n */\nexport function unmarshalLanguageMetadata(address: number): LanguageMetadata { \n const major_version = C.getValue(address, 'i32');\n const minor_version = C.getValue(address += SIZE_OF_INT, 'i32');\n const patch_version = C.getValue(address += SIZE_OF_INT, 'i32');\n return { major_version, minor_version, patch_version };\n}\n", "import { C, INTERNAL, Internal, assertInternal, SIZE_OF_INT, SIZE_OF_SHORT } from './constants';\nimport { LookaheadIterator } from './lookahead_iterator';\nimport { unmarshalLanguageMetadata } from './marshal';\nimport { TRANSFER_BUFFER } from './parser';\n\nconst LANGUAGE_FUNCTION_REGEX = /^tree_sitter_\\w+$/;\n\nexport interface LanguageMetadata {\n readonly major_version: number;\n readonly minor_version: number;\n readonly patch_version: number;\n}\n\n/**\n * An opaque object that defines how to parse a particular language.\n * The code for each `Language` is generated by the Tree-sitter CLI.\n */\nexport class Language {\n /** @internal */\n private [0] = 0; // Internal handle for Wasm\n\n /**\n * A list of all node types in the language. The index of each type in this\n * array is its node type id.\n */\n types: string[];\n\n /**\n * A list of all field names in the language. The index of each field name in\n * this array is its field id.\n */\n fields: (string | null)[];\n\n /** @internal */\n constructor(internal: Internal, address: number) {\n assertInternal(internal);\n this[0] = address;\n this.types = new Array<string>(C._ts_language_symbol_count(this[0]));\n for (let i = 0, n = this.types.length; i < n; i++) {\n if (C._ts_language_symbol_type(this[0], i) < 2) {\n this.types[i] = C.UTF8ToString(C._ts_language_symbol_name(this[0], i));\n }\n }\n this.fields = new Array<string>(C._ts_language_field_count(this[0]) + 1);\n for (let i = 0, n = this.fields.length; i < n; i++) {\n const fieldName = C._ts_language_field_name_for_id(this[0], i);\n if (fieldName !== 0) {\n this.fields[i] = C.UTF8ToString(fieldName);\n } else {\n this.fields[i] = null;\n }\n }\n }\n\n\n /**\n * Gets the name of the language.\n */\n get name(): string | null {\n const ptr = C._ts_language_name(this[0]);\n if (ptr === 0) return null;\n return C.UTF8ToString(ptr);\n }\n\n /**\n * Gets the ABI version of the language.\n */\n get abiVersion(): number {\n return C._ts_language_abi_version(this[0]);\n }\n\n /**\n * Get the metadata for this language. This information is generated by the\n * CLI, and relies on the language author providing the correct metadata in\n * the language's `tree-sitter.json` file.\n */\n get metadata(): LanguageMetadata | null {\n C._ts_language_metadata_wasm(this[0]);\n const length = C.getValue(TRANSFER_BUFFER, 'i32');\n if (length === 0) return null;\n return unmarshalLanguageMetadata(TRANSFER_BUFFER + SIZE_OF_INT);\n }\n\n /**\n * Gets the number of fields in the language.\n */\n get fieldCount(): number {\n return this.fields.length - 1;\n }\n\n /**\n * Gets the number of states in the language.\n */\n get stateCount(): number {\n return C._ts_language_state_count(this[0]);\n }\n\n /**\n * Get the field id for a field name.\n */\n fieldIdForName(fieldName: string): number | null {\n const result = this.fields.indexOf(fieldName);\n return result !== -1 ? result : null;\n }\n\n /**\n * Get the field name for a field id.\n */\n fieldNameForId(fieldId: number): string | null {\n return this.fields[fieldId] ?? null;\n }\n\n /**\n * Get the node type id for a node type name.\n */\n idForNodeType(type: string, named: boolean): number | null {\n const typeLength = C.lengthBytesUTF8(type);\n const typeAddress = C._malloc(typeLength + 1);\n C.stringToUTF8(type, typeAddress, typeLength + 1);\n const result = C._ts_language_symbol_for_name(this[0], typeAddress, typeLength, named ? 1 : 0);\n C._free(typeAddress);\n return result || null;\n }\n\n /**\n * Gets the number of node types in the language.\n */\n get nodeTypeCount(): number {\n return C._ts_language_symbol_count(this[0]);\n }\n\n /**\n * Get the node type name for a node type id.\n */\n nodeTypeForId(typeId: number): string | null {\n const name = C._ts_language_symbol_name(this[0], typeId);\n return name ? C.UTF8ToString(name) : null;\n }\n\n /**\n * Check if a node type is named.\n *\n * @see {@link https://tree-sitter.github.io/tree-sitter/using-parsers/2-basic-parsing.html#named-vs-anonymous-nodes}\n */\n nodeTypeIsNamed(typeId: number): boolean {\n return C._ts_language_type_is_named_wasm(this[0], typeId) ? true : false;\n }\n\n /**\n * Check if a node type is visible.\n */\n nodeTypeIsVisible(typeId: number): boolean {\n return C._ts_language_type_is_visible_wasm(this[0], typeId) ? true : false;\n }\n\n /**\n * Get the supertypes ids of this language.\n *\n * @see {@link https://tree-sitter.github.io/tree-sitter/using-parsers/6-static-node-types.html?highlight=supertype#supertype-nodes}\n */\n get supertypes(): number[] {\n C._ts_language_supertypes_wasm(this[0]);\n const count = C.getValue(TRANSFER_BUFFER, 'i32');\n const buffer = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, 'i32');\n const result = new Array<number>(count);\n\n if (count > 0) {\n let address = buffer;\n for (let i = 0; i < count; i++) {\n result[i] = C.getValue(address, 'i16');\n address += SIZE_OF_SHORT;\n }\n }\n\n return result;\n }\n\n /**\n * Get the subtype ids for a given supertype node id.\n */\n subtypes(supertype: number): number[] {\n C._ts_language_subtypes_wasm(this[0], supertype);\n const count = C.getValue(TRANSFER_BUFFER, 'i32');\n const buffer = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, 'i32');\n const result = new Array<number>(count);\n\n if (count > 0) {\n let address = buffer;\n for (let i = 0; i < count; i++) {\n result[i] = C.getValue(address, 'i16');\n address += SIZE_OF_SHORT;\n }\n }\n\n return result;\n }\n\n /**\n * Get the next state id for a given state id and node type id.\n */\n nextState(stateId: number, typeId: number): number {\n return C._ts_language_next_state(this[0], stateId, typeId);\n }\n\n /**\n * Create a new lookahead iterator for this language and parse state.\n *\n * This returns `null` if state is invalid for this language.\n *\n * Iterating {@link LookaheadIterator} will yield valid symbols in the given\n * parse state. Newly created lookahead iterators will return the `ERROR`\n * symbol from {@link LookaheadIterator#currentType}.\n *\n * Lookahead iterators can be useful for generating suggestions and improving\n * syntax error diagnostics. To get symbols valid in an `ERROR` node, use the\n * lookahead iterator on its first leaf node state. For `MISSING` nodes, a\n * lookahead iterator created on the previous non-extra leaf node may be\n * appropriate.\n */\n lookaheadIterator(stateId: number): LookaheadIterator | null {\n const address = C._ts_lookahead_iterator_new(this[0], stateId);\n if (address) return new LookaheadIterator(INTERNAL, address, this);\n return null;\n }\n\n /**\n * Load a language from a WebAssembly module.\n * The module can be provided as a path to a file or as a buffer.\n */\n static async load(input: string | Uint8Array): Promise<Language> {\n let binary: Uint8Array | WebAssembly.Module;\n if (input instanceof Uint8Array) {\n binary = input;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n } else if (globalThis.process?.versions.node) {\n const fs: typeof import('fs/promises') = await import('fs/promises');\n binary = await fs.readFile(input);\n } else {\n const response = await fetch(input);\n\n if (!response.ok){\n const body = await response.text();\n throw new Error(`Language.load failed with status ${response.status}.\\n\\n${body}`);\n }\n\n const retryResp = response.clone();\n try {\n binary = await WebAssembly.compileStreaming(response);\n } catch (reason) {\n console.error('wasm streaming compile failed:', reason);\n console.error('falling back to ArrayBuffer instantiation');\n // fallback, probably because of bad MIME type\n binary = new Uint8Array(await retryResp.arrayBuffer())\n }\n }\n\n const mod = await C.loadWebAssemblyModule(binary, { loadAsync: true });\n const symbolNames = Object.keys(mod);\n const functionName = symbolNames.find((key) => LANGUAGE_FUNCTION_REGEX.test(key) &&\n !key.includes('external_scanner_'));\n if (!functionName) {\n console.log(`Couldn't find language function in Wasm file. Symbols:\\n${JSON.stringify(symbolNames, null, 2)}`);\n throw new Error('Language.load failed: no language function found in Wasm file');\n }\n const languageAddress = mod[functionName]();\n return new Language(INTERNAL, languageAddress);\n }\n}\n", "// This code implements the `-sMODULARIZE` settings by taking the generated\n// JS program code (INNER_JS_CODE) and wrapping it in a factory function.\n\n// When targetting node and ES6 we use `await import ..` in the generated code\n// so the outer function needs to be marked as async.\nasync function Module(moduleArg = {}) {\n var moduleRtn;\n\n// include: shell.js\n// The Module object: Our interface to the outside world. We import\n// and export values on it. There are various ways Module can be used:\n// 1. Not defined. We create it here\n// 2. A function parameter, function(moduleArg) => Promise<Module>\n// 3. pre-run appended it, var Module = {}; ..generated code..\n// 4. External script tag defines var Module.\n// We need to check if Module already exists (e.g. case 3 above).\n// Substitution will be replaced with actual code on later stage of the build,\n// this way Closure Compiler will not mangle it (e.g. case 4. above).\n// Note that if you want to run closure, and also to use Module\n// after the generated code, you will need to define var Module = {};\n// before the code. Then that object will be used in the code, and you\n// can continue to use Module afterwards as well.\nvar Module = moduleArg;\n\n// Determine the runtime environment we are in. You can customize this by\n// setting the ENVIRONMENT setting at compile time (see settings.js).\n// Attempt to auto-detect the environment\nvar ENVIRONMENT_IS_WEB = typeof window == \"object\";\n\nvar ENVIRONMENT_IS_WORKER = typeof WorkerGlobalScope != \"undefined\";\n\n// N.b. Electron.js environment is simultaneously a NODE-environment, but\n// also a web environment.\nvar ENVIRONMENT_IS_NODE = typeof process == \"object\" && process.versions?.node && process.type != \"renderer\";\n\nif (ENVIRONMENT_IS_NODE) {\n // When building an ES module `require` is not normally available.\n // We need to use `createRequire()` to construct the require()` function.\n const {createRequire} = await import(\"module\");\n /** @suppress{duplicate} */ var require = createRequire(import.meta.url);\n}\n\n// --pre-jses are emitted after the Module integration code, so that they can\n// refer to Module (if they choose; they can also define Module)\n// include: lib/binding_web/lib/prefix.js\nModule.currentQueryProgressCallback = null;\n\nModule.currentProgressCallback = null;\n\nModule.currentLogCallback = null;\n\nModule.currentParseCallback = null;\n\n// end include: lib/binding_web/lib/prefix.js\nvar arguments_ = [];\n\nvar thisProgram = \"./this.program\";\n\nvar quit_ = (status, toThrow) => {\n throw toThrow;\n};\n\nvar _scriptName = import.meta.url;\n\n// `/` should be present at the end if `scriptDirectory` is not empty\nvar scriptDirectory = \"\";\n\nfunction locateFile(path) {\n if (Module[\"locateFile\"]) {\n return Module[\"locateFile\"](path, scriptDirectory);\n }\n return scriptDirectory + path;\n}\n\n// Hooks that are implemented differently in different runtime environments.\nvar readAsync, readBinary;\n\nif (ENVIRONMENT_IS_NODE) {\n // These modules will usually be used on Node.js. Load them eagerly to avoid\n // the complexity of lazy-loading.\n var fs = require(\"fs\");\n if (_scriptName.startsWith(\"file:\")) {\n scriptDirectory = require(\"path\").dirname(require(\"url\").fileURLToPath(_scriptName)) + \"/\";\n }\n // include: node_shell_read.js\n readBinary = filename => {\n // We need to re-wrap `file://` strings to URLs.\n filename = isFileURI(filename) ? new URL(filename) : filename;\n var ret = fs.readFileSync(filename);\n return ret;\n };\n readAsync = async (filename, binary = true) => {\n // See the comment in the `readBinary` function.\n filename = isFileURI(filename) ? new URL(filename) : filename;\n var ret = fs.readFileSync(filename, binary ? undefined : \"utf8\");\n return ret;\n };\n // end include: node_shell_read.js\n if (process.argv.length > 1) {\n thisProgram = process.argv[1].replace(/\\\\/g, \"/\");\n }\n arguments_ = process.argv.slice(2);\n quit_ = (status, toThrow) => {\n process.exitCode = status;\n throw toThrow;\n };\n} else // Note that this includes Node.js workers when relevant (pthreads is enabled).\n// Node.js workers are detected as a combination of ENVIRONMENT_IS_WORKER and\n// ENVIRONMENT_IS_NODE.\nif (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {\n try {\n scriptDirectory = new URL(\".\", _scriptName).href;\n } catch {}\n {\n // include: web_or_worker_shell_read.js\n if (ENVIRONMENT_IS_WORKER) {\n readBinary = url => {\n var xhr = new XMLHttpRequest;\n xhr.open(\"GET\", url, false);\n xhr.responseType = \"arraybuffer\";\n xhr.send(null);\n return new Uint8Array(/** @type{!ArrayBuffer} */ (xhr.response));\n };\n }\n readAsync = async url => {\n // Fetch has some additional restrictions over XHR, like it can't be used on a file:// url.\n // See https://github.com/github/fetch/pull/92#issuecomment-140665932\n // Cordova or Electron apps are typically loaded from a file:// url.\n // So use XHR on webview if URL is a file URL.\n if (isFileURI(url)) {\n return new Promise((resolve, reject) => {\n var xhr = new XMLHttpRequest;\n xhr.open(\"GET\", url, true);\n xhr.responseType = \"arraybuffer\";\n xhr.onload = () => {\n if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) {\n // file URLs can return 0\n resolve(xhr.response);\n return;\n }\n reject(xhr.status);\n };\n xhr.onerror = reject;\n xhr.send(null);\n });\n }\n var response = await fetch(url, {\n credentials: \"same-origin\"\n });\n if (response.ok) {\n return response.arrayBuffer();\n }\n throw new Error(response.status + \" : \" + response.url);\n };\n }\n} else {}\n\nvar out = console.log.bind(console);\n\nvar err = console.error.bind(console);\n\n// end include: shell.js\n// include: preamble.js\n// === Preamble library stuff ===\n// Documentation for the public APIs defined in this file must be updated in:\n// site/source/docs/api_reference/preamble.js.rst\n// A prebuilt local version of the documentation is available at:\n// site/build/text/docs/api_reference/preamble.js.txt\n// You can also build docs locally as HTML or other formats in site/\n// An online HTML version (which may be of a different version of Emscripten)\n// is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html\nvar dynamicLibraries = [];\n\nvar wasmBinary;\n\n// Wasm globals\n//========================================\n// Runtime essentials\n//========================================\n// whether we are quitting the application. no code should run after this.\n// set in exit() and abort()\nvar ABORT = false;\n\n// set by exit() and abort(). Passed to 'onExit' handler.\n// NOTE: This is also used as the process return code code in shell environments\n// but only when noExitRuntime is false.\nvar EXITSTATUS;\n\n/**\n * Indicates whether filename is delivered via file protocol (as opposed to http/https)\n * @noinline\n */ var isFileURI = filename => filename.startsWith(\"file://\");\n\n// include: runtime_common.js\n// include: runtime_stack_check.js\n// end include: runtime_stack_check.js\n// include: runtime_exceptions.js\n// end include: runtime_exceptions.js\n// include: runtime_debug.js\n// end include: runtime_debug.js\nvar readyPromiseResolve, readyPromiseReject;\n\n// Memory management\nvar wasmMemory;\n\nvar /** @type {!Int8Array} */ HEAP8, /** @type {!Uint8Array} */ HEAPU8, /** @type {!Int16Array} */ HEAP16, /** @type {!Uint16Array} */ HEAPU16, /** @type {!Int32Array} */ HEAP32, /** @type {!Uint32Array} */ HEAPU32, /** @type {!Float32Array} */ HEAPF32, /** @type {!Float64Array} */ HEAPF64;\n\n// BigInt64Array type is not correctly defined in closure\nvar /** not-@type {!BigInt64Array} */ HEAP64, /* BigUint64Array type is not correctly defined in closure\n/** not-@type {!BigUint64Array} */ HEAPU64;\n\n/** @type {!DataView} */ var HEAP_DATA_VIEW;\n\nvar runtimeInitialized = false;\n\nfunction updateMemoryViews() {\n var b = wasmMemory.buffer;\n Module[\"HEAP8\"] = HEAP8 = new Int8Array(b);\n Module[\"HEAP16\"] = HEAP16 = new Int16Array(b);\n Module[\"HEAPU8\"] = HEAPU8 = new Uint8Array(b);\n Module[\"HEAPU16\"] = HEAPU16 = new Uint16Array(b);\n Module[\"HEAP32\"] = HEAP32 = new Int32Array(b);\n Module[\"HEAPU32\"] = HEAPU32 = new Uint32Array(b);\n Module[\"HEAPF32\"] = HEAPF32 = new Float32Array(b);\n Module[\"HEAPF64\"] = HEAPF64 = new Float64Array(b);\n Module[\"HEAP64\"] = HEAP64 = new BigInt64Array(b);\n Module[\"HEAPU64\"] = HEAPU64 = new BigUint64Array(b);\n Module[\"HEAP_DATA_VIEW\"] = HEAP_DATA_VIEW = new DataView(b);\n LE_HEAP_UPDATE();\n}\n\n// In non-standalone/normal mode, we create the memory here.\n// include: runtime_init_memory.js\n// Create the wasm memory. (Note: this only applies if IMPORTED_MEMORY is defined)\n// check for full engine support (use string 'subarray' to avoid closure compiler confusion)\nfunction initMemory() {\n if (Module[\"wasmMemory\"]) {\n wasmMemory = Module[\"wasmMemory\"];\n } else {\n var INITIAL_MEMORY = Module[\"INITIAL_MEMORY\"] || 33554432;\n /** @suppress {checkTypes} */ wasmMemory = new WebAssembly.Memory({\n \"initial\": INITIAL_MEMORY / 65536,\n // In theory we should not need to emit the maximum if we want \"unlimited\"\n // or 4GB of memory, but VMs error on that atm, see\n // https://github.com/emscripten-core/emscripten/issues/14130\n // And in the pthreads case we definitely need to emit a maximum. So\n // always emit one.\n \"maximum\": 32768\n });\n }\n updateMemoryViews();\n}\n\n// end include: runtime_init_memory.js\n// include: memoryprofiler.js\n// end include: memoryprofiler.js\n// end include: runtime_common.js\nvar __RELOC_FUNCS__ = [];\n\nfunction preRun() {\n if (Module[\"preRun\"]) {\n if (typeof Module[\"preRun\"] == \"function\") Module[\"preRun\"] = [ Module[\"preRun\"] ];\n while (Module[\"preRun\"].length) {\n addOnPreRun(Module[\"preRun\"].shift());\n }\n }\n // Begin ATPRERUNS hooks\n callRuntimeCallbacks(onPreRuns);\n}\n\nfunction initRuntime() {\n runtimeInitialized = true;\n callRuntimeCallbacks(__RELOC_FUNCS__);\n // No ATINITS hooks\n wasmExports[\"__wasm_call_ctors\"]();\n // Begin ATPOSTCTORS hooks\n callRuntimeCallbacks(onPostCtors);\n}\n\nfunction preMain() {}\n\nfunction postRun() {\n // PThreads reuse the runtime from the main thread.\n if (Module[\"postRun\"]) {\n if (typeof Module[\"postRun\"] == \"function\") Module[\"postRun\"] = [ Module[\"postRun\"] ];\n while (Module[\"postRun\"].length) {\n addOnPostRun(Module[\"postRun\"].shift());\n }\n }\n // Begin ATPOSTRUNS hooks\n callRuntimeCallbacks(onPostRuns);\n}\n\n/** @param {string|number=} what */ function abort(what) {\n Module[\"onAbort\"]?.(what);\n what = \"Aborted(\" + what + \")\";\n // TODO(sbc): Should we remove printing and leave it up to whoever\n // catches the exception?\n err(what);\n ABORT = true;\n what += \". Build with -sASSERTIONS for more info.\";\n // Use a wasm runtime error, because a JS error might be seen as a foreign\n // exception, which means we'd run destructors on it. We need the error to\n // simply make the program stop.\n // FIXME This approach does not work in Wasm EH because it currently does not assume\n // all RuntimeErrors are from traps; it decides whether a RuntimeError is from\n // a trap or not based on a hidden field within the object. So at the moment\n // we don't have a way of throwing a wasm trap from JS. TODO Make a JS API that\n // allows this in the wasm spec.\n // Suppress closure compiler warning here. Closure compiler's builtin extern\n // definition for WebAssembly.RuntimeError claims it takes no arguments even\n // though it can.\n // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure gets fixed.\n /** @suppress {checkTypes} */ var e = new WebAssembly.RuntimeError(what);\n readyPromiseReject?.(e);\n // Throw the error whether or not MODULARIZE is set because abort is used\n // in code paths apart from instantiation where an exception is expected\n // to be thrown when abort is called.\n throw e;\n}\n\nvar wasmBinaryFile;\n\nfunction findWasmBinary() {\n if (Module[\"locateFile\"]) {\n return locateFile(\"web-tree-sitter.wasm\");\n }\n // Use bundler-friendly `new URL(..., import.meta.url)` pattern; works in browsers too.\n return new URL(\"web-tree-sitter.wasm\", import.meta.url).href;\n}\n\nfunction getBinarySync(file) {\n if (file == wasmBinaryFile && wasmBinary) {\n return new Uint8Array(wasmBinary);\n }\n if (readBinary) {\n return readBinary(file);\n }\n // Throwing a plain string here, even though it not normally adviables since\n // this gets turning into an `abort` in instantiateArrayBuffer.\n throw \"both async and sync fetching of the wasm failed\";\n}\n\nasync function getWasmBinary(binaryFile) {\n // If we don't have the binary yet, load it asynchronously using readAsync.\n if (!wasmBinary) {\n // Fetch the binary using readAsync\n try {\n var response = await readAsync(binaryFile);\n return new Uint8Array(response);\n } catch {}\n }\n // Otherwise, getBinarySync should be able to get it synchronously\n return getBinarySync(binaryFile);\n}\n\nasync function instantiateArrayBuffer(binaryFile, imports) {\n try {\n var binary = await getWasmBinary(binaryFile);\n var instance = await WebAssembly.instantiate(binary, imports);\n return instance;\n } catch (reason) {\n err(`failed to asynchronously prepare wasm: ${reason}`);\n abort(reason);\n }\n}\n\nasync function instantiateAsync(binary, binaryFile, imports) {\n if (!binary && !isFileURI(binaryFile) && !ENVIRONMENT_IS_NODE) {\n try {\n var response = fetch(binaryFile, {\n credentials: \"same-origin\"\n });\n var instantiationResult = await WebAssembly.instantiateStreaming(response, imports);\n return instantiationResult;\n } catch (reason) {\n // We expect the most common failure cause to be a bad MIME type for the binary,\n // in which case falling back to ArrayBuffer instantiation should work.\n err(`wasm streaming compile failed: ${reason}`);\n err(\"falling back to ArrayBuffer instantiation\");\n }\n }\n return instantiateArrayBuffer(binaryFile, imports);\n}\n\nfunction getWasmImports() {\n // prepare imports\n return {\n \"env\": wasmImports,\n \"wasi_snapshot_preview1\": wasmImports,\n \"GOT.mem\": new Proxy(wasmImports, GOTHandler),\n \"GOT.func\": new Proxy(wasmImports, GOTHandler)\n };\n}\n\n// Create the wasm instance.\n// Receives the wasm imports, returns the exports.\nasync function createWasm() {\n // Load the wasm module and create an instance of using native support in the JS engine.\n // handle a generated wasm instance, receiving its exports and\n // performing other necessary setup\n /** @param {WebAssembly.Module=} module*/ function receiveInstance(instance, module) {\n wasmExports = instance.exports;\n wasmExports = relocateExports(wasmExports, 1024);\n var metadata = getDylinkMetadata(module);\n if (metadata.neededDynlibs) {\n dynamicLibraries = metadata.neededDynlibs.concat(dynamicLibraries);\n }\n mergeLibSymbols(wasmExports, \"main\");\n LDSO.init();\n loadDylibs();\n __RELOC_FUNCS__.push(wasmExports[\"__wasm_apply_data_relocs\"]);\n assignWasmExports(wasmExports);\n return wasmExports;\n }\n // Prefer streaming instantiation if available.\n function receiveInstantiationResult(result) {\n // 'result' is a ResultObject object which has both the module and instance.\n // receiveInstance() will swap in the exports (to Module.asm) so they can be called\n return receiveInstance(result[\"instance\"], result[\"module\"]);\n }\n var info = getWasmImports();\n // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback\n // to manually instantiate the Wasm module themselves. This allows pages to\n // run the instantiation parallel to any other async startup actions they are\n // performing.\n // Also pthreads and wasm workers initialize the wasm instance through this\n // path.\n if (Module[\"instantiateWasm\"]) {\n return new Promise((resolve, reject) => {\n Module[\"instantiateWasm\"](info, (mod, inst) => {\n resolve(receiveInstance(mod, inst));\n });\n });\n }\n wasmBinaryFile ??= findWasmBinary();\n var result = await instantiateAsync(wasmBinary, wasmBinaryFile, info);\n var exports = receiveInstantiationResult(result);\n return exports;\n}\n\n// end include: preamble.js\n// Begin JS library code\nclass ExitStatus {\n name=\"ExitStatus\";\n constructor(status) {\n this.message = `Program terminated with exit(${status})`;\n this.status = status;\n }\n}\n\nvar GOT = {};\n\nvar currentModuleWeakSymbols = new Set([]);\n\nvar GOTHandler = {\n get(obj, symName) {\n var rtn = GOT[symName];\n if (!rtn) {\n rtn = GOT[symName] = new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": true\n });\n }\n if (!currentModuleWeakSymbols.has(symName)) {\n // Any non-weak reference to a symbol marks it as `required`, which\n // enabled `reportUndefinedSymbols` to report undefined symbol errors\n // correctly.\n rtn.required = true;\n }\n return rtn;\n }\n};\n\nvar LE_ATOMICS_NATIVE_BYTE_ORDER = [];\n\nvar LE_HEAP_LOAD_F32 = byteOffset => HEAP_DATA_VIEW.getFloat32(byteOffset, true);\n\nvar LE_HEAP_LOAD_F64 = byteOffset => HEAP_DATA_VIEW.getFloat64(byteOffset, true);\n\nvar LE_HEAP_LOAD_I16 = byteOffset => HEAP_DATA_VIEW.getInt16(byteOffset, true);\n\nvar LE_HEAP_LOAD_I32 = byteOffset => HEAP_DATA_VIEW.getInt32(byteOffset, true);\n\nvar LE_HEAP_LOAD_I64 = byteOffset => HEAP_DATA_VIEW.getBigInt64(byteOffset, true);\n\nvar LE_HEAP_LOAD_U32 = byteOffset => HEAP_DATA_VIEW.getUint32(byteOffset, true);\n\nvar LE_HEAP_STORE_F32 = (byteOffset, value) => HEAP_DATA_VIEW.setFloat32(byteOffset, value, true);\n\nvar LE_HEAP_STORE_F64 = (byteOffset, value) => HEAP_DATA_VIEW.setFloat64(byteOffset, value, true);\n\nvar LE_HEAP_STORE_I16 = (byteOffset, value) => HEAP_DATA_VIEW.setInt16(byteOffset, value, true);\n\nvar LE_HEAP_STORE_I32 = (byteOffset, value) => HEAP_DATA_VIEW.setInt32(byteOffset, value, true);\n\nvar LE_HEAP_STORE_I64 = (byteOffset, value) => HEAP_DATA_VIEW.setBigInt64(byteOffset, value, true);\n\nvar LE_HEAP_STORE_U32 = (byteOffset, value) => HEAP_DATA_VIEW.setUint32(byteOffset, value, true);\n\nvar callRuntimeCallbacks = callbacks => {\n while (callbacks.length > 0) {\n // Pass the module as the first argument.\n callbacks.shift()(Module);\n }\n};\n\nvar onPostRuns = [];\n\nvar addOnPostRun = cb => onPostRuns.push(cb);\n\nvar onPreRuns = [];\n\nvar addOnPreRun = cb => onPreRuns.push(cb);\n\nvar UTF8Decoder = typeof TextDecoder != \"undefined\" ? new TextDecoder : undefined;\n\nvar findStringEnd = (heapOrArray, idx, maxBytesToRead, ignoreNul) => {\n var maxIdx = idx + maxBytesToRead;\n if (ignoreNul) return maxIdx;\n // TextDecoder needs to know the byte length in advance, it doesn't stop on\n // null terminator by itself.\n // As a tiny code save trick, compare idx against maxIdx using a negation,\n // so that maxBytesToRead=undefined/NaN means Infinity.\n while (heapOrArray[idx] && !(idx >= maxIdx)) ++idx;\n return idx;\n};\n\n/**\n * Given a pointer 'idx' to a null-terminated UTF8-encoded string in the given\n * array that contains uint8 values, returns a copy of that string as a\n * Javascript String object.\n * heapOrArray is either a regular array, or a JavaScript typed array view.\n * @param {number=} idx\n * @param {number=} maxBytesToRead\n * @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character.\n * @return {string}\n */ var UTF8ArrayToString = (heapOrArray, idx = 0, maxBytesToRead, ignoreNul) => {\n var endPtr = findStringEnd(heapOrArray, idx, maxBytesToRead, ignoreNul);\n // When using conditional TextDecoder, skip it for short strings as the overhead of the native call is not worth it.\n if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {\n return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));\n }\n var str = \"\";\n while (idx < endPtr) {\n // For UTF8 byte structure, see:\n // http://en.wikipedia.org/wiki/UTF-8#Description\n // https://www.ietf.org/rfc/rfc2279.txt\n // https://tools.ietf.org/html/rfc3629\n var u0 = heapOrArray[idx++];\n if (!(u0 & 128)) {\n str += String.fromCharCode(u0);\n continue;\n }\n var u1 = heapOrArray[idx++] & 63;\n if ((u0 & 224) == 192) {\n str += String.fromCharCode(((u0 & 31) << 6) | u1);\n continue;\n }\n var u2 = heapOrArray[idx++] & 63;\n if ((u0 & 240) == 224) {\n u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;\n } else {\n u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heapOrArray[idx++] & 63);\n }\n if (u0 < 65536) {\n str += String.fromCharCode(u0);\n } else {\n var ch = u0 - 65536;\n str += String.fromCharCode(55296 | (ch >> 10), 56320 | (ch & 1023));\n }\n }\n return str;\n};\n\nvar getDylinkMetadata = binary => {\n var offset = 0;\n var end = 0;\n function getU8() {\n return binary[offset++];\n }\n function getLEB() {\n var ret = 0;\n var mul = 1;\n while (1) {\n var byte = binary[offset++];\n ret += ((byte & 127) * mul);\n mul *= 128;\n if (!(byte & 128)) break;\n }\n return ret;\n }\n function getString() {\n var len = getLEB();\n offset += len;\n return UTF8ArrayToString(binary, offset - len, len);\n }\n function getStringList() {\n var count = getLEB();\n var rtn = [];\n while (count--) rtn.push(getString());\n return rtn;\n }\n /** @param {string=} message */ function failIf(condition, message) {\n if (condition) throw new Error(message);\n }\n if (binary instanceof WebAssembly.Module) {\n var dylinkSection = WebAssembly.Module.customSections(binary, \"dylink.0\");\n failIf(dylinkSection.length === 0, \"need dylink section\");\n binary = new Uint8Array(dylinkSection[0]);\n end = binary.length;\n } else {\n var int32View = new Uint32Array(new Uint8Array(binary.subarray(0, 24)).buffer);\n var magicNumberFound = int32View[0] == 1836278016 || int32View[0] == 6386541;\n failIf(!magicNumberFound, \"need to see wasm magic number\");\n // \\0asm\n // we should see the dylink custom section right after the magic number and wasm version\n failIf(binary[8] !== 0, \"need the dylink section to be first\");\n offset = 9;\n var section_size = getLEB();\n //section size\n end = offset + section_size;\n var name = getString();\n failIf(name !== \"dylink.0\");\n }\n var customSection = {\n neededDynlibs: [],\n tlsExports: new Set,\n weakImports: new Set,\n runtimePaths: []\n };\n var WASM_DYLINK_MEM_INFO = 1;\n var WASM_DYLINK_NEEDED = 2;\n var WASM_DYLINK_EXPORT_INFO = 3;\n var WASM_DYLINK_IMPORT_INFO = 4;\n var WASM_DYLINK_RUNTIME_PATH = 5;\n var WASM_SYMBOL_TLS = 256;\n var WASM_SYMBOL_BINDING_MASK = 3;\n var WASM_SYMBOL_BINDING_WEAK = 1;\n while (offset < end) {\n var subsectionType = getU8();\n var subsectionSize = getLEB();\n if (subsectionType === WASM_DYLINK_MEM_INFO) {\n customSection.memorySize = getLEB();\n customSection.memoryAlign = getLEB();\n customSection.tableSize = getLEB();\n customSection.tableAlign = getLEB();\n } else if (subsectionType === WASM_DYLINK_NEEDED) {\n customSection.neededDynlibs = getStringList();\n } else if (subsectionType === WASM_DYLINK_EXPORT_INFO) {\n var count = getLEB();\n while (count--) {\n var symname = getString();\n var flags = getLEB();\n if (flags & WASM_SYMBOL_TLS) {\n customSection.tlsExports.add(symname);\n }\n }\n } else if (subsectionType === WASM_DYLINK_IMPORT_INFO) {\n var count = getLEB();\n while (count--) {\n var modname = getString();\n var symname = getString();\n var flags = getLEB();\n if ((flags & WASM_SYMBOL_BINDING_MASK) == WASM_SYMBOL_BINDING_WEAK) {\n customSection.weakImports.add(symname);\n }\n }\n } else if (subsectionType === WASM_DYLINK_RUNTIME_PATH) {\n customSection.runtimePaths = getStringList();\n } else {\n // unknown subsection\n offset += subsectionSize;\n }\n }\n return customSection;\n};\n\n/**\n * @param {number} ptr\n * @param {string} type\n */ function getValue(ptr, type = \"i8\") {\n if (type.endsWith(\"*\")) type = \"*\";\n switch (type) {\n case \"i1\":\n return HEAP8[ptr];\n\n case \"i8\":\n return HEAP8[ptr];\n\n case \"i16\":\n return LE_HEAP_LOAD_I16(((ptr) >> 1) * 2);\n\n case \"i32\":\n return LE_HEAP_LOAD_I32(((ptr) >> 2) * 4);\n\n case \"i64\":\n return LE_HEAP_LOAD_I64(((ptr) >> 3) * 8);\n\n case \"float\":\n return LE_HEAP_LOAD_F32(((ptr) >> 2) * 4);\n\n case \"double\":\n return LE_HEAP_LOAD_F64(((ptr) >> 3) * 8);\n\n case \"*\":\n return LE_HEAP_LOAD_U32(((ptr) >> 2) * 4);\n\n default:\n abort(`invalid type for getValue: ${type}`);\n }\n}\n\nvar newDSO = (name, handle, syms) => {\n var dso = {\n refcount: Infinity,\n name,\n exports: syms,\n global: true\n };\n LDSO.loadedLibsByName[name] = dso;\n if (handle != undefined) {\n LDSO.loadedLibsByHandle[handle] = dso;\n }\n return dso;\n};\n\nvar LDSO = {\n loadedLibsByName: {},\n loadedLibsByHandle: {},\n init() {\n newDSO(\"__main__\", 0, wasmImports);\n }\n};\n\nvar ___heap_base = 78240;\n\nvar alignMemory = (size, alignment) => Math.ceil(size / alignment) * alignment;\n\nvar getMemory = size => {\n // After the runtime is initialized, we must only use sbrk() normally.\n if (runtimeInitialized) {\n // Currently we don't support freeing of static data when modules are\n // unloaded via dlclose. This function is tagged as `noleakcheck` to\n // avoid having this reported as leak.\n return _calloc(size, 1);\n }\n var ret = ___heap_base;\n // Keep __heap_base stack aligned.\n var end = ret + alignMemory(size, 16);\n ___heap_base = end;\n GOT[\"__heap_base\"].value = end;\n return ret;\n};\n\nvar isInternalSym = symName => [ \"__cpp_exception\", \"__c_longjmp\", \"__wasm_apply_data_relocs\", \"__dso_handle\", \"__tls_size\", \"__tls_align\", \"__set_stack_limits\", \"_emscripten_tls_init\", \"__wasm_init_tls\", \"__wasm_call_ctors\", \"__start_em_asm\", \"__stop_em_asm\", \"__start_em_js\", \"__stop_em_js\" ].includes(symName) || symName.startsWith(\"__em_js__\");\n\nvar uleb128EncodeWithLen = arr => {\n const n = arr.length;\n // Note: this LEB128 length encoding produces extra byte for n < 128,\n // but we don't care as it's only used in a temporary representation.\n return [ (n % 128) | 128, n >> 7, ...arr ];\n};\n\nvar wasmTypeCodes = {\n \"i\": 127,\n // i32\n \"p\": 127,\n // i32\n \"j\": 126,\n // i64\n \"f\": 125,\n // f32\n \"d\": 124,\n // f64\n \"e\": 111\n};\n\nvar generateTypePack = types => uleb128EncodeWithLen(Array.from(types, type => {\n var code = wasmTypeCodes[type];\n return code;\n}));\n\nvar convertJsFunctionToWasm = (func, sig) => {\n // Rest of the module is static\n var bytes = Uint8Array.of(0, 97, 115, 109, // magic (\"\\0asm\")\n 1, 0, 0, 0, // version: 1\n 1, // Type section code\n // The module is static, with the exception of the type section, which is\n // generated based on the signature passed in.\n ...uleb128EncodeWithLen([ 1, // count: 1\n 96, // param types\n ...generateTypePack(sig.slice(1)), // return types (for now only supporting [] if `void` and single [T] otherwise)\n ...generateTypePack(sig[0] === \"v\" ? \"\" : sig[0]) ]), // The rest of the module is static\n 2, 7, // import section\n // (import \"e\" \"f\" (func 0 (type 0)))\n 1, 1, 101, 1, 102, 0, 0, 7, 5, // export section\n // (export \"f\" (func 0 (type 0)))\n 1, 1, 102, 0, 0);\n // We can compile this wasm module synchronously because it is very small.\n // This accepts an import (at \"e.f\"), that it reroutes to an export (at \"f\")\n var module = new WebAssembly.Module(bytes);\n var instance = new WebAssembly.Instance(module, {\n \"e\": {\n \"f\": func\n }\n });\n var wrappedFunc = instance.exports[\"f\"];\n return wrappedFunc;\n};\n\nvar wasmTableMirror = [];\n\n/** @type {WebAssembly.Table} */ var wasmTable = new WebAssembly.Table({\n \"initial\": 31,\n \"element\": \"anyfunc\"\n});\n\nvar getWasmTableEntry = funcPtr => {\n var func = wasmTableMirror[funcPtr];\n if (!func) {\n /** @suppress {checkTypes} */ wasmTableMirror[funcPtr] = func = wasmTable.get(funcPtr);\n }\n return func;\n};\n\nvar updateTableMap = (offset, count) => {\n if (functionsInTableMap) {\n for (var i = offset; i < offset + count; i++) {\n var item = getWasmTableEntry(i);\n // Ignore null values.\n if (item) {\n functionsInTableMap.set(item, i);\n }\n }\n }\n};\n\nvar functionsInTableMap;\n\nvar getFunctionAddress = func => {\n // First, create the map if this is the first use.\n if (!functionsInTableMap) {\n functionsInTableMap = new WeakMap;\n updateTableMap(0, wasmTable.length);\n }\n return functionsInTableMap.get(func) || 0;\n};\n\nvar freeTableIndexes = [];\n\nvar getEmptyTableSlot = () => {\n // Reuse a free index if there is one, otherwise grow.\n if (freeTableIndexes.length) {\n return freeTableIndexes.pop();\n }\n // Grow the table\n return wasmTable[\"grow\"](1);\n};\n\nvar setWasmTableEntry = (idx, func) => {\n /** @suppress {checkTypes} */ wasmTable.set(idx, func);\n // With ABORT_ON_WASM_EXCEPTIONS wasmTable.get is overridden to return wrapped\n // functions so we need to call it here to retrieve the potential wrapper correctly\n // instead of just storing 'func' directly into wasmTableMirror\n /** @suppress {checkTypes} */ wasmTableMirror[idx] = wasmTable.get(idx);\n};\n\n/** @param {string=} sig */ var addFunction = (func, sig) => {\n // Check if the function is already in the table, to ensure each function\n // gets a unique index.\n var rtn = getFunctionAddress(func);\n if (rtn) {\n return rtn;\n }\n // It's not in the table, add it now.\n var ret = getEmptyTableSlot();\n // Set the new value.\n try {\n // Attempting to call this with JS function will cause of table.set() to fail\n setWasmTableEntry(ret, func);\n } catch (err) {\n if (!(err instanceof TypeError)) {\n throw err;\n }\n var wrapped = convertJsFunctionToWasm(func, sig);\n setWasmTableEntry(ret, wrapped);\n }\n functionsInTableMap.set(func, ret);\n return ret;\n};\n\nvar updateGOT = (exports, replace) => {\n for (var symName in exports) {\n if (isInternalSym(symName)) {\n continue;\n }\n var value = exports[symName];\n GOT[symName] ||= new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": true\n });\n if (replace || GOT[symName].value == 0) {\n if (typeof value == \"function\") {\n GOT[symName].value = addFunction(value);\n } else if (typeof value == \"number\") {\n GOT[symName].value = value;\n } else {\n err(`unhandled export type for '${symName}': ${typeof value}`);\n }\n }\n }\n};\n\n/** @param {boolean=} replace */ var relocateExports = (exports, memoryBase, replace) => {\n var relocated = {};\n for (var e in exports) {\n var value = exports[e];\n if (typeof value == \"object\") {\n // a breaking change in the wasm spec, globals are now objects\n // https://github.com/WebAssembly/mutable-global/issues/1\n value = value.value;\n }\n if (typeof value == \"number\") {\n value += memoryBase;\n }\n relocated[e] = value;\n }\n updateGOT(relocated, replace);\n return relocated;\n};\n\nvar isSymbolDefined = symName => {\n // Ignore 'stub' symbols that are auto-generated as part of the original\n // `wasmImports` used to instantiate the main module.\n var existing = wasmImports[symName];\n if (!existing || existing.stub) {\n return false;\n }\n return true;\n};\n\nvar dynCall = (sig, ptr, args = [], promising = false) => {\n var func = getWasmTableEntry(ptr);\n var rtn = func(...args);\n function convert(rtn) {\n return rtn;\n }\n return convert(rtn);\n};\n\nvar stackSave = () => _emscripten_stack_get_current();\n\nvar stackRestore = val => __emscripten_stack_restore(val);\n\nvar createInvokeFunction = sig => (ptr, ...args) => {\n var sp = stackSave();\n try {\n return dynCall(sig, ptr, args);\n } catch (e) {\n stackRestore(sp);\n // Create a try-catch guard that rethrows the Emscripten EH exception.\n // Exceptions thrown from C++ will be a pointer (number) and longjmp\n // will throw the number Infinity. Use the compact and fast \"e !== e+0\"\n // test to check if e was not a Number.\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n // In theory this if statement could be done on\n // creating the function, but I just added this to\n // save wasting code space as it only happens on exception.\n if (sig[0] == \"j\") return 0n;\n }\n};\n\nvar resolveGlobalSymbol = (symName, direct = false) => {\n var sym;\n if (isSymbolDefined(symName)) {\n sym = wasmImports[symName];\n } else if (symName.startsWith(\"invoke_\")) {\n // Create (and cache) new invoke_ functions on demand.\n sym = wasmImports[symName] = createInvokeFunction(symName.split(\"_\")[1]);\n }\n return {\n sym,\n name: symName\n };\n};\n\nvar onPostCtors = [];\n\nvar addOnPostCtor = cb => onPostCtors.push(cb);\n\n/**\n * Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the\n * emscripten HEAP, returns a copy of that string as a Javascript String object.\n *\n * @param {number} ptr\n * @param {number=} maxBytesToRead - An optional length that specifies the\n * maximum number of bytes to read. You can omit this parameter to scan the\n * string until the first 0 byte. If maxBytesToRead is passed, and the string\n * at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the\n * string will cut short at that byte index.\n * @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character.\n * @return {string}\n */ var UTF8ToString = (ptr, maxBytesToRead, ignoreNul) => ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead, ignoreNul) : \"\";\n\n/**\n * @param {string=} libName\n * @param {Object=} localScope\n * @param {number=} handle\n */ var loadWebAssemblyModule = (binary, flags, libName, localScope, handle) => {\n var metadata = getDylinkMetadata(binary);\n // loadModule loads the wasm module after all its dependencies have been loaded.\n // can be called both sync/async.\n function loadModule() {\n // alignments are powers of 2\n var memAlign = Math.pow(2, metadata.memoryAlign);\n // prepare memory\n var memoryBase = metadata.memorySize ? alignMemory(getMemory(metadata.memorySize + memAlign), memAlign) : 0;\n // TODO: add to cleanups\n var tableBase = metadata.tableSize ? wasmTable.length : 0;\n if (handle) {\n HEAP8[(handle) + (8)] = 1;\n LE_HEAP_STORE_U32((((handle) + (12)) >> 2) * 4, memoryBase);\n LE_HEAP_STORE_I32((((handle) + (16)) >> 2) * 4, metadata.memorySize);\n LE_HEAP_STORE_U32((((handle) + (20)) >> 2) * 4, tableBase);\n LE_HEAP_STORE_I32((((handle) + (24)) >> 2) * 4, metadata.tableSize);\n }\n if (metadata.tableSize) {\n wasmTable.grow(metadata.tableSize);\n }\n // This is the export map that we ultimately return. We declare it here\n // so it can be used within resolveSymbol. We resolve symbols against\n // this local symbol map in the case there they are not present on the\n // global Module object. We need this fallback because Modules sometime\n // need to import their own symbols\n var moduleExports;\n function resolveSymbol(sym) {\n var resolved = resolveGlobalSymbol(sym).sym;\n if (!resolved && localScope) {\n resolved = localScope[sym];\n }\n if (!resolved) {\n resolved = moduleExports[sym];\n }\n return resolved;\n }\n // TODO kill \u2193\u2193\u2193 (except \"symbols local to this module\", it will likely be\n // not needed if we require that if A wants symbols from B it has to link\n // to B explicitly: similarly to -Wl,--no-undefined)\n // wasm dynamic libraries are pure wasm, so they cannot assist in\n // their own loading. When side module A wants to import something\n // provided by a side module B that is loaded later, we need to\n // add a layer of indirection, but worse, we can't even tell what\n // to add the indirection for, without inspecting what A's imports\n // are. To do that here, we use a JS proxy (another option would\n // be to inspect the binary directly).\n var proxyHandler = {\n get(stubs, prop) {\n // symbols that should be local to this module\n switch (prop) {\n case \"__memory_base\":\n return memoryBase;\n\n case \"__table_base\":\n return tableBase;\n }\n if (prop in wasmImports && !wasmImports[prop].stub) {\n // No stub needed, symbol already exists in symbol table\n var res = wasmImports[prop];\n return res;\n }\n // Return a stub function that will resolve the symbol\n // when first called.\n if (!(prop in stubs)) {\n var resolved;\n stubs[prop] = (...args) => {\n resolved ||= resolveSymbol(prop);\n return resolved(...args);\n };\n }\n return stubs[prop];\n }\n };\n var proxy = new Proxy({}, proxyHandler);\n currentModuleWeakSymbols = metadata.weakImports;\n var info = {\n \"GOT.mem\": new Proxy({}, GOTHandler),\n \"GOT.func\": new Proxy({}, GOTHandler),\n \"env\": proxy,\n \"wasi_snapshot_preview1\": proxy\n };\n function postInstantiation(module, instance) {\n // add new entries to functionsInTableMap\n updateTableMap(tableBase, metadata.tableSize);\n moduleExports = relocateExports(instance.exports, memoryBase);\n if (!flags.allowUndefined) {\n reportUndefinedSymbols();\n }\n function addEmAsm(addr, body) {\n var args = [];\n var arity = 0;\n for (;arity < 16; arity++) {\n if (body.indexOf(\"$\" + arity) != -1) {\n args.push(\"$\" + arity);\n } else {\n break;\n }\n }\n args = args.join(\",\");\n var func = `(${args}) => { ${body} };`;\n ASM_CONSTS[start] = eval(func);\n }\n // Add any EM_ASM function that exist in the side module\n if (\"__start_em_asm\" in moduleExports) {\n var start = moduleExports[\"__start_em_asm\"];\n var stop = moduleExports[\"__stop_em_asm\"];\n while (start < stop) {\n var jsString = UTF8ToString(start);\n addEmAsm(start, jsString);\n start = HEAPU8.indexOf(0, start) + 1;\n }\n }\n function addEmJs(name, cSig, body) {\n // The signature here is a C signature (e.g. \"(int foo, char* bar)\").\n // See `create_em_js` in emcc.py` for the build-time version of this\n // code.\n var jsArgs = [];\n cSig = cSig.slice(1, -1);\n if (cSig != \"void\") {\n cSig = cSig.split(\",\");\n for (var i in cSig) {\n var jsArg = cSig[i].split(\" \").pop();\n jsArgs.push(jsArg.replace(\"*\", \"\"));\n }\n }\n var func = `(${jsArgs}) => ${body};`;\n moduleExports[name] = eval(func);\n }\n for (var name in moduleExports) {\n if (name.startsWith(\"__em_js__\")) {\n var start = moduleExports[name];\n var jsString = UTF8ToString(start);\n // EM_JS strings are stored in the data section in the form\n // SIG<::>BODY.\n var parts = jsString.split(\"<::>\");\n addEmJs(name.replace(\"__em_js__\", \"\"), parts[0], parts[1]);\n delete moduleExports[name];\n }\n }\n // initialize the module\n var applyRelocs = moduleExports[\"__wasm_apply_data_relocs\"];\n if (applyRelocs) {\n if (runtimeInitialized) {\n applyRelocs();\n } else {\n __RELOC_FUNCS__.push(applyRelocs);\n }\n }\n var init = moduleExports[\"__wasm_call_ctors\"];\n if (init) {\n if (runtimeInitialized) {\n init();\n } else {\n // we aren't ready to run compiled code yet\n addOnPostCtor(init);\n }\n }\n return moduleExports;\n }\n if (flags.loadAsync) {\n return (async () => {\n var instance;\n if (binary instanceof WebAssembly.Module) {\n instance = new WebAssembly.Instance(binary, info);\n } else {\n // Destructuring assignment without declaration has to be wrapped\n // with parens or parser will treat the l-value as an object\n // literal instead.\n (((({module: binary, instance} = await WebAssembly.instantiate(binary, info)))));\n }\n return postInstantiation(binary, instance);\n })();\n }\n var module = binary instanceof WebAssembly.Module ? binary : new WebAssembly.Module(binary);\n var instance = new WebAssembly.Instance(module, info);\n return postInstantiation(module, instance);\n }\n // We need to set rpath in flags based on the current library's rpath.\n // We can't mutate flags or else if a depends on b and c and b depends on d,\n // then c will be loaded with b's rpath instead of a's.\n flags = {\n ...flags,\n rpath: {\n parentLibPath: libName,\n paths: metadata.runtimePaths\n }\n };\n // now load needed libraries and the module itself.\n if (flags.loadAsync) {\n return metadata.neededDynlibs.reduce((chain, dynNeeded) => chain.then(() => loadDynamicLibrary(dynNeeded, flags, localScope)), Promise.resolve()).then(loadModule);\n }\n metadata.neededDynlibs.forEach(needed => loadDynamicLibrary(needed, flags, localScope));\n return loadModule();\n};\n\nvar mergeLibSymbols = (exports, libName) => {\n // add symbols into global namespace TODO: weak linking etc.\n for (var [sym, exp] of Object.entries(exports)) {\n // When RTLD_GLOBAL is enabled, the symbols defined by this shared object\n // will be made available for symbol resolution of subsequently loaded\n // shared objects.\n // We should copy the symbols (which include methods and variables) from\n // SIDE_MODULE to MAIN_MODULE.\n const setImport = target => {\n if (!isSymbolDefined(target)) {\n wasmImports[target] = exp;\n }\n };\n setImport(sym);\n // Special case for handling of main symbol: If a side module exports\n // `main` that also acts a definition for `__main_argc_argv` and vice\n // versa.\n const main_alias = \"__main_argc_argv\";\n if (sym == \"main\") {\n setImport(main_alias);\n }\n if (sym == main_alias) {\n setImport(\"main\");\n }\n }\n};\n\nvar asyncLoad = async url => {\n var arrayBuffer = await readAsync(url);\n return new Uint8Array(arrayBuffer);\n};\n\n/**\n * @param {number=} handle\n * @param {Object=} localScope\n */ function loadDynamicLibrary(libName, flags = {\n global: true,\n nodelete: true\n}, localScope, handle) {\n // when loadDynamicLibrary did not have flags, libraries were loaded\n // globally & permanently\n var dso = LDSO.loadedLibsByName[libName];\n if (dso) {\n // the library is being loaded or has been loaded already.\n if (!flags.global) {\n if (localScope) {\n Object.assign(localScope, dso.exports);\n }\n } else if (!dso.global) {\n // The library was previously loaded only locally but not\n // we have a request with global=true.\n dso.global = true;\n mergeLibSymbols(dso.exports, libName);\n }\n // same for \"nodelete\"\n if (flags.nodelete && dso.refcount !== Infinity) {\n dso.refcount = Infinity;\n }\n dso.refcount++;\n if (handle) {\n LDSO.loadedLibsByHandle[handle] = dso;\n }\n return flags.loadAsync ? Promise.resolve(true) : true;\n }\n // allocate new DSO\n dso = newDSO(libName, handle, \"loading\");\n dso.refcount = flags.nodelete ? Infinity : 1;\n dso.global = flags.global;\n // libName -> libData\n function loadLibData() {\n // for wasm, we can use fetch for async, but for fs mode we can only imitate it\n if (handle) {\n var data = LE_HEAP_LOAD_U32((((handle) + (28)) >> 2) * 4);\n var dataSize = LE_HEAP_LOAD_U32((((handle) + (32)) >> 2) * 4);\n if (data && dataSize) {\n var libData = HEAP8.slice(data, data + dataSize);\n return flags.loadAsync ? Promise.resolve(libData) : libData;\n }\n }\n var libFile = locateFile(libName);\n if (flags.loadAsync) {\n return asyncLoad(libFile);\n }\n // load the binary synchronously\n if (!readBinary) {\n throw new Error(`${libFile}: file not found, and synchronous loading of external files is not available`);\n }\n return readBinary(libFile);\n }\n // libName -> exports\n function getExports() {\n // module not preloaded - load lib data and create new module from it\n if (flags.loadAsync) {\n return loadLibData().then(libData => loadWebAssemblyModule(libData, flags, libName, localScope, handle));\n }\n return loadWebAssemblyModule(loadLibData(), flags, libName, localScope, handle);\n }\n // module for lib is loaded - update the dso & global namespace\n function moduleLoaded(exports) {\n if (dso.global) {\n mergeLibSymbols(exports, libName);\n } else if (localScope) {\n Object.assign(localScope, exports);\n }\n dso.exports = exports;\n }\n if (flags.loadAsync) {\n return getExports().then(exports => {\n moduleLoaded(exports);\n return true;\n });\n }\n moduleLoaded(getExports());\n return true;\n}\n\nvar reportUndefinedSymbols = () => {\n for (var [symName, entry] of Object.entries(GOT)) {\n if (entry.value == 0) {\n var value = resolveGlobalSymbol(symName, true).sym;\n if (!value && !entry.required) {\n // Ignore undefined symbols that are imported as weak.\n continue;\n }\n if (typeof value == \"function\") {\n /** @suppress {checkTypes} */ entry.value = addFunction(value, value.sig);\n } else if (typeof value == \"number\") {\n entry.value = value;\n } else {\n throw new Error(`bad export type for '${symName}': ${typeof value}`);\n }\n }\n }\n};\n\nvar runDependencies = 0;\n\nvar dependenciesFulfilled = null;\n\nvar removeRunDependency = id => {\n runDependencies--;\n Module[\"monitorRunDependencies\"]?.(runDependencies);\n if (runDependencies == 0) {\n if (dependenciesFulfilled) {\n var callback = dependenciesFulfilled;\n dependenciesFulfilled = null;\n callback();\n }\n }\n};\n\nvar addRunDependency = id => {\n runDependencies++;\n Module[\"monitorRunDependencies\"]?.(runDependencies);\n};\n\nvar loadDylibs = async () => {\n if (!dynamicLibraries.length) {\n reportUndefinedSymbols();\n return;\n }\n addRunDependency(\"loadDylibs\");\n // Load binaries asynchronously\n for (var lib of dynamicLibraries) {\n await loadDynamicLibrary(lib, {\n loadAsync: true,\n global: true,\n nodelete: true,\n allowUndefined: true\n });\n }\n // we got them all, wonderful\n reportUndefinedSymbols();\n removeRunDependency(\"loadDylibs\");\n};\n\nvar noExitRuntime = true;\n\n/**\n * @param {number} ptr\n * @param {number} value\n * @param {string} type\n */ function setValue(ptr, value, type = \"i8\") {\n if (type.endsWith(\"*\")) type = \"*\";\n switch (type) {\n case \"i1\":\n HEAP8[ptr] = value;\n break;\n\n case \"i8\":\n HEAP8[ptr] = value;\n break;\n\n case \"i16\":\n LE_HEAP_STORE_I16(((ptr) >> 1) * 2, value);\n break;\n\n case \"i32\":\n LE_HEAP_STORE_I32(((ptr) >> 2) * 4, value);\n break;\n\n case \"i64\":\n LE_HEAP_STORE_I64(((ptr) >> 3) * 8, BigInt(value));\n break;\n\n case \"float\":\n LE_HEAP_STORE_F32(((ptr) >> 2) * 4, value);\n break;\n\n case \"double\":\n LE_HEAP_STORE_F64(((ptr) >> 3) * 8, value);\n break;\n\n case \"*\":\n LE_HEAP_STORE_U32(((ptr) >> 2) * 4, value);\n break;\n\n default:\n abort(`invalid type for setValue: ${type}`);\n }\n}\n\nvar ___memory_base = new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": false\n}, 1024);\n\nvar ___stack_high = 78240;\n\nvar ___stack_low = 12704;\n\nvar ___stack_pointer = new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": true\n}, 78240);\n\nvar ___table_base = new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": false\n}, 1);\n\nvar __abort_js = () => abort(\"\");\n\n__abort_js.sig = \"v\";\n\nvar getHeapMax = () => // Stay one Wasm page short of 4GB: while e.g. Chrome is able to allocate\n// full 4GB Wasm memories, the size will wrap back to 0 bytes in Wasm side\n// for any code that deals with heap sizes, which would require special\n// casing all heap size related code to treat 0 specially.\n2147483648;\n\nvar growMemory = size => {\n var oldHeapSize = wasmMemory.buffer.byteLength;\n var pages = ((size - oldHeapSize + 65535) / 65536) | 0;\n try {\n // round size grow request up to wasm page size (fixed 64KB per spec)\n wasmMemory.grow(pages);\n // .grow() takes a delta compared to the previous size\n updateMemoryViews();\n return 1;\n } catch (e) {}\n};\n\nvar _emscripten_resize_heap = requestedSize => {\n var oldSize = HEAPU8.length;\n // With CAN_ADDRESS_2GB or MEMORY64, pointers are already unsigned.\n requestedSize >>>= 0;\n // With multithreaded builds, races can happen (another thread might increase the size\n // in between), so return a failure, and let the caller retry.\n // Memory resize rules:\n // 1. Always increase heap size to at least the requested size, rounded up\n // to next page multiple.\n // 2a. If MEMORY_GROWTH_LINEAR_STEP == -1, excessively resize the heap\n // geometrically: increase the heap size according to\n // MEMORY_GROWTH_GEOMETRIC_STEP factor (default +20%), At most\n // overreserve by MEMORY_GROWTH_GEOMETRIC_CAP bytes (default 96MB).\n // 2b. If MEMORY_GROWTH_LINEAR_STEP != -1, excessively resize the heap\n // linearly: increase the heap size by at least\n // MEMORY_GROWTH_LINEAR_STEP bytes.\n // 3. Max size for the heap is capped at 2048MB-WASM_PAGE_SIZE, or by\n // MAXIMUM_MEMORY, or by ASAN limit, depending on which is smallest\n // 4. If we were unable to allocate as much memory, it may be due to\n // over-eager decision to excessively reserve due to (3) above.\n // Hence if an allocation fails, cut down on the amount of excess\n // growth, in an attempt to succeed to perform a smaller allocation.\n // A limit is set for how much we can grow. We should not exceed that\n // (the wasm binary specifies it, so if we tried, we'd fail anyhow).\n var maxHeapSize = getHeapMax();\n if (requestedSize > maxHeapSize) {\n return false;\n }\n // Loop through potential heap size increases. If we attempt a too eager\n // reservation that fails, cut down on the attempted size and reserve a\n // smaller bump instead. (max 3 times, chosen somewhat arbitrarily)\n for (var cutDown = 1; cutDown <= 4; cutDown *= 2) {\n var overGrownHeapSize = oldSize * (1 + .2 / cutDown);\n // ensure geometric growth\n // but limit overreserving (default to capping at +96MB overgrowth at most)\n overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296);\n var newSize = Math.min(maxHeapSize, alignMemory(Math.max(requestedSize, overGrownHeapSize), 65536));\n var replacement = growMemory(newSize);\n if (replacement) {\n return true;\n }\n }\n return false;\n};\n\n_emscripten_resize_heap.sig = \"ip\";\n\nvar _fd_close = fd => 52;\n\n_fd_close.sig = \"ii\";\n\nvar INT53_MAX = 9007199254740992;\n\nvar INT53_MIN = -9007199254740992;\n\nvar bigintToI53Checked = num => (num < INT53_MIN || num > INT53_MAX) ? NaN : Number(num);\n\nfunction _fd_seek(fd, offset, whence, newOffset) {\n offset = bigintToI53Checked(offset);\n return 70;\n}\n\n_fd_seek.sig = \"iijip\";\n\nvar printCharBuffers = [ null, [], [] ];\n\nvar printChar = (stream, curr) => {\n var buffer = printCharBuffers[stream];\n if (curr === 0 || curr === 10) {\n (stream === 1 ? out : err)(UTF8ArrayToString(buffer));\n buffer.length = 0;\n } else {\n buffer.push(curr);\n }\n};\n\nvar _fd_write = (fd, iov, iovcnt, pnum) => {\n // hack to support printf in SYSCALLS_REQUIRE_FILESYSTEM=0\n var num = 0;\n for (var i = 0; i < iovcnt; i++) {\n var ptr = LE_HEAP_LOAD_U32(((iov) >> 2) * 4);\n var len = LE_HEAP_LOAD_U32((((iov) + (4)) >> 2) * 4);\n iov += 8;\n for (var j = 0; j < len; j++) {\n printChar(fd, HEAPU8[ptr + j]);\n }\n num += len;\n }\n LE_HEAP_STORE_U32(((pnum) >> 2) * 4, num);\n return 0;\n};\n\n_fd_write.sig = \"iippp\";\n\nfunction _tree_sitter_log_callback(isLexMessage, messageAddress) {\n if (Module.currentLogCallback) {\n const message = UTF8ToString(messageAddress);\n Module.currentLogCallback(message, isLexMessage !== 0);\n }\n}\n\nfunction _tree_sitter_parse_callback(inputBufferAddress, index, row, column, lengthAddress) {\n const INPUT_BUFFER_SIZE = 10 * 1024;\n const string = Module.currentParseCallback(index, {\n row,\n column\n });\n if (typeof string === \"string\") {\n setValue(lengthAddress, string.length, \"i32\");\n stringToUTF16(string, inputBufferAddress, INPUT_BUFFER_SIZE);\n } else {\n setValue(lengthAddress, 0, \"i32\");\n }\n}\n\nfunction _tree_sitter_progress_callback(currentOffset, hasError) {\n if (Module.currentProgressCallback) {\n return Module.currentProgressCallback({\n currentOffset,\n hasError\n });\n }\n return false;\n}\n\nfunction _tree_sitter_query_progress_callback(currentOffset) {\n if (Module.currentQueryProgressCallback) {\n return Module.currentQueryProgressCallback({\n currentOffset\n });\n }\n return false;\n}\n\nvar runtimeKeepaliveCounter = 0;\n\nvar keepRuntimeAlive = () => noExitRuntime || runtimeKeepaliveCounter > 0;\n\nvar _proc_exit = code => {\n EXITSTATUS = code;\n if (!keepRuntimeAlive()) {\n Module[\"onExit\"]?.(code);\n ABORT = true;\n }\n quit_(code, new ExitStatus(code));\n};\n\n_proc_exit.sig = \"vi\";\n\n/** @param {boolean|number=} implicit */ var exitJS = (status, implicit) => {\n EXITSTATUS = status;\n _proc_exit(status);\n};\n\nvar handleException = e => {\n // Certain exception types we do not treat as errors since they are used for\n // internal control flow.\n // 1. ExitStatus, which is thrown by exit()\n // 2. \"unwind\", which is thrown by emscripten_unwind_to_js_event_loop() and others\n // that wish to return to JS event loop.\n if (e instanceof ExitStatus || e == \"unwind\") {\n return EXITSTATUS;\n }\n quit_(1, e);\n};\n\nvar lengthBytesUTF8 = str => {\n var len = 0;\n for (var i = 0; i < str.length; ++i) {\n // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code\n // unit, not a Unicode code point of the character! So decode\n // UTF16->UTF32->UTF8.\n // See http://unicode.org/faq/utf_bom.html#utf16-3\n var c = str.charCodeAt(i);\n // possibly a lead surrogate\n if (c <= 127) {\n len++;\n } else if (c <= 2047) {\n len += 2;\n } else if (c >= 55296 && c <= 57343) {\n len += 4;\n ++i;\n } else {\n len += 3;\n }\n }\n return len;\n};\n\nvar stringToUTF8Array = (str, heap, outIdx, maxBytesToWrite) => {\n // Parameter maxBytesToWrite is not optional. Negative values, 0, null,\n // undefined and false each don't write out any bytes.\n if (!(maxBytesToWrite > 0)) return 0;\n var startIdx = outIdx;\n var endIdx = outIdx + maxBytesToWrite - 1;\n // -1 for string null terminator.\n for (var i = 0; i < str.length; ++i) {\n // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description\n // and https://www.ietf.org/rfc/rfc2279.txt\n // and https://tools.ietf.org/html/rfc3629\n var u = str.codePointAt(i);\n if (u <= 127) {\n if (outIdx >= endIdx) break;\n heap[outIdx++] = u;\n } else if (u <= 2047) {\n if (outIdx + 1 >= endIdx) break;\n heap[outIdx++] = 192 | (u >> 6);\n heap[outIdx++] = 128 | (u & 63);\n } else if (u <= 65535) {\n if (outIdx + 2 >= endIdx) break;\n heap[outIdx++] = 224 | (u >> 12);\n heap[outIdx++] = 128 | ((u >> 6) & 63);\n heap[outIdx++] = 128 | (u & 63);\n } else {\n if (outIdx + 3 >= endIdx) break;\n heap[outIdx++] = 240 | (u >> 18);\n heap[outIdx++] = 128 | ((u >> 12) & 63);\n heap[outIdx++] = 128 | ((u >> 6) & 63);\n heap[outIdx++] = 128 | (u & 63);\n // Gotcha: if codePoint is over 0xFFFF, it is represented as a surrogate pair in UTF-16.\n // We need to manually skip over the second code unit for correct iteration.\n i++;\n }\n }\n // Null-terminate the pointer to the buffer.\n heap[outIdx] = 0;\n return outIdx - startIdx;\n};\n\nvar stringToUTF8 = (str, outPtr, maxBytesToWrite) => stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);\n\nvar stackAlloc = sz => __emscripten_stack_alloc(sz);\n\nvar stringToUTF8OnStack = str => {\n var size = lengthBytesUTF8(str) + 1;\n var ret = stackAlloc(size);\n stringToUTF8(str, ret, size);\n return ret;\n};\n\nvar AsciiToString = ptr => {\n var str = \"\";\n while (1) {\n var ch = HEAPU8[ptr++];\n if (!ch) return str;\n str += String.fromCharCode(ch);\n }\n};\n\nvar stringToUTF16 = (str, outPtr, maxBytesToWrite) => {\n // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed.\n maxBytesToWrite ??= 2147483647;\n if (maxBytesToWrite < 2) return 0;\n maxBytesToWrite -= 2;\n // Null terminator.\n var startPtr = outPtr;\n var numCharsToWrite = (maxBytesToWrite < str.length * 2) ? (maxBytesToWrite / 2) : str.length;\n for (var i = 0; i < numCharsToWrite; ++i) {\n // charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP.\n var codeUnit = str.charCodeAt(i);\n // possibly a lead surrogate\n LE_HEAP_STORE_I16(((outPtr) >> 1) * 2, codeUnit);\n outPtr += 2;\n }\n // Null-terminate the pointer to the HEAP.\n LE_HEAP_STORE_I16(((outPtr) >> 1) * 2, 0);\n return outPtr - startPtr;\n};\n\nLE_ATOMICS_NATIVE_BYTE_ORDER = (new Int8Array(new Int16Array([ 1 ]).buffer)[0] === 1) ? [ /* little endian */ (x => x), (x => x), undefined, (x => x) ] : [ /* big endian */ (x => x), (x => (((x & 65280) << 8) | ((x & 255) << 24)) >> 16), undefined, (x => ((x >> 24) & 255) | ((x >> 8) & 65280) | ((x & 65280) << 8) | ((x & 255) << 24)) ];\n\nfunction LE_HEAP_UPDATE() {\n HEAPU16.unsigned = (x => x & 65535);\n HEAPU32.unsigned = (x => x >>> 0);\n}\n\n// End JS library code\n// include: postlibrary.js\n// This file is included after the automatically-generated JS library code\n// but before the wasm module is created.\n{\n // With WASM_ESM_INTEGRATION this has to happen at the top level and not\n // delayed until processModuleArgs.\n initMemory();\n // Begin ATMODULES hooks\n if (Module[\"noExitRuntime\"]) noExitRuntime = Module[\"noExitRuntime\"];\n if (Module[\"print\"]) out = Module[\"print\"];\n if (Module[\"printErr\"]) err = Module[\"printErr\"];\n if (Module[\"dynamicLibraries\"]) dynamicLibraries = Module[\"dynamicLibraries\"];\n if (Module[\"wasmBinary\"]) wasmBinary = Module[\"wasmBinary\"];\n // End ATMODULES hooks\n if (Module[\"arguments\"]) arguments_ = Module[\"arguments\"];\n if (Module[\"thisProgram\"]) thisProgram = Module[\"thisProgram\"];\n if (Module[\"preInit\"]) {\n if (typeof Module[\"preInit\"] == \"function\") Module[\"preInit\"] = [ Module[\"preInit\"] ];\n while (Module[\"preInit\"].length > 0) {\n Module[\"preInit\"].shift()();\n }\n }\n}\n\n// Begin runtime exports\nModule[\"setValue\"] = setValue;\n\nModule[\"getValue\"] = getValue;\n\nModule[\"UTF8ToString\"] = UTF8ToString;\n\nModule[\"stringToUTF8\"] = stringToUTF8;\n\nModule[\"lengthBytesUTF8\"] = lengthBytesUTF8;\n\nModule[\"AsciiToString\"] = AsciiToString;\n\nModule[\"stringToUTF16\"] = stringToUTF16;\n\nModule[\"loadWebAssemblyModule\"] = loadWebAssemblyModule;\n\nModule[\"LE_HEAP_STORE_I64\"] = LE_HEAP_STORE_I64;\n\n// End runtime exports\n// Begin JS library exports\n// End JS library exports\n// end include: postlibrary.js\nvar ASM_CONSTS = {};\n\n// Imports from the Wasm binary.\nvar _malloc, _calloc, _realloc, _free, _ts_range_edit, _memcmp, _ts_language_symbol_count, _ts_language_state_count, _ts_language_abi_version, _ts_language_name, _ts_language_field_count, _ts_language_next_state, _ts_language_symbol_name, _ts_language_symbol_for_name, _strncmp, _ts_language_symbol_type, _ts_language_field_name_for_id, _ts_lookahead_iterator_new, _ts_lookahead_iterator_delete, _ts_lookahead_iterator_reset_state, _ts_lookahead_iterator_reset, _ts_lookahead_iterator_next, _ts_lookahead_iterator_current_symbol, _ts_point_edit, _ts_parser_delete, _ts_parser_reset, _ts_parser_set_language, _ts_parser_set_included_ranges, _ts_query_new, _ts_query_delete, _iswspace, _iswalnum, _ts_query_pattern_count, _ts_query_capture_count, _ts_query_string_count, _ts_query_capture_name_for_id, _ts_query_capture_quantifier_for_id, _ts_query_string_value_for_id, _ts_query_predicates_for_pattern, _ts_query_start_byte_for_pattern, _ts_query_end_byte_for_pattern, _ts_query_is_pattern_rooted, _ts_query_is_pattern_non_local, _ts_query_is_pattern_guaranteed_at_step, _ts_query_disable_capture, _ts_query_disable_pattern, _ts_tree_copy, _ts_tree_delete, _ts_init, _ts_parser_new_wasm, _ts_parser_enable_logger_wasm, _ts_parser_parse_wasm, _ts_parser_included_ranges_wasm, _ts_language_type_is_named_wasm, _ts_language_type_is_visible_wasm, _ts_language_metadata_wasm, _ts_language_supertypes_wasm, _ts_language_subtypes_wasm, _ts_tree_root_node_wasm, _ts_tree_root_node_with_offset_wasm, _ts_tree_edit_wasm, _ts_tree_included_ranges_wasm, _ts_tree_get_changed_ranges_wasm, _ts_tree_cursor_new_wasm, _ts_tree_cursor_copy_wasm, _ts_tree_cursor_delete_wasm, _ts_tree_cursor_reset_wasm, _ts_tree_cursor_reset_to_wasm, _ts_tree_cursor_goto_first_child_wasm, _ts_tree_cursor_goto_last_child_wasm, _ts_tree_cursor_goto_first_child_for_index_wasm, _ts_tree_cursor_goto_first_child_for_position_wasm, _ts_tree_cursor_goto_next_sibling_wasm, _ts_tree_cursor_goto_previous_sibling_wasm, _ts_tree_cursor_goto_descendant_wasm, _ts_tree_cursor_goto_parent_wasm, _ts_tree_cursor_current_node_type_id_wasm, _ts_tree_cursor_current_node_state_id_wasm, _ts_tree_cursor_current_node_is_named_wasm, _ts_tree_cursor_current_node_is_missing_wasm, _ts_tree_cursor_current_node_id_wasm, _ts_tree_cursor_start_position_wasm, _ts_tree_cursor_end_position_wasm, _ts_tree_cursor_start_index_wasm, _ts_tree_cursor_end_index_wasm, _ts_tree_cursor_current_field_id_wasm, _ts_tree_cursor_current_depth_wasm, _ts_tree_cursor_current_descendant_index_wasm, _ts_tree_cursor_current_node_wasm, _ts_node_symbol_wasm, _ts_node_field_name_for_child_wasm, _ts_node_field_name_for_named_child_wasm, _ts_node_children_by_field_id_wasm, _ts_node_first_child_for_byte_wasm, _ts_node_first_named_child_for_byte_wasm, _ts_node_grammar_symbol_wasm, _ts_node_child_count_wasm, _ts_node_named_child_count_wasm, _ts_node_child_wasm, _ts_node_named_child_wasm, _ts_node_child_by_field_id_wasm, _ts_node_next_sibling_wasm, _ts_node_prev_sibling_wasm, _ts_node_next_named_sibling_wasm, _ts_node_prev_named_sibling_wasm, _ts_node_descendant_count_wasm, _ts_node_parent_wasm, _ts_node_child_with_descendant_wasm, _ts_node_descendant_for_index_wasm, _ts_node_named_descendant_for_index_wasm, _ts_node_descendant_for_position_wasm, _ts_node_named_descendant_for_position_wasm, _ts_node_start_point_wasm, _ts_node_end_point_wasm, _ts_node_start_index_wasm, _ts_node_end_index_wasm, _ts_node_to_string_wasm, _ts_node_children_wasm, _ts_node_named_children_wasm, _ts_node_descendants_of_type_wasm, _ts_node_is_named_wasm, _ts_node_has_changes_wasm, _ts_node_has_error_wasm, _ts_node_is_error_wasm, _ts_node_is_missing_wasm, _ts_node_is_extra_wasm, _ts_node_parse_state_wasm, _ts_node_next_parse_state_wasm, _ts_query_matches_wasm, _ts_query_captures_wasm, _memset, _memcpy, _memmove, _iswalpha, _iswblank, _iswdigit, _iswlower, _iswupper, _iswxdigit, _memchr, _strlen, _strcmp, _strncat, _strncpy, _towlower, _towupper, _setThrew, __emscripten_stack_restore, __emscripten_stack_alloc, _emscripten_stack_get_current, ___wasm_apply_data_relocs;\n\nfunction assignWasmExports(wasmExports) {\n Module[\"_malloc\"] = _malloc = wasmExports[\"malloc\"];\n Module[\"_calloc\"] = _calloc = wasmExports[\"calloc\"];\n Module[\"_realloc\"] = _realloc = wasmExports[\"realloc\"];\n Module[\"_free\"] = _free = wasmExports[\"free\"];\n Module[\"_ts_range_edit\"] = _ts_range_edit = wasmExports[\"ts_range_edit\"];\n Module[\"_memcmp\"] = _memcmp = wasmExports[\"memcmp\"];\n Module[\"_ts_language_symbol_count\"] = _ts_language_symbol_count = wasmExports[\"ts_language_symbol_count\"];\n Module[\"_ts_language_state_count\"] = _ts_language_state_count = wasmExports[\"ts_language_state_count\"];\n Module[\"_ts_language_abi_version\"] = _ts_language_abi_version = wasmExports[\"ts_language_abi_version\"];\n Module[\"_ts_language_name\"] = _ts_language_name = wasmExports[\"ts_language_name\"];\n Module[\"_ts_language_field_count\"] = _ts_language_field_count = wasmExports[\"ts_language_field_count\"];\n Module[\"_ts_language_next_state\"] = _ts_language_next_state = wasmExports[\"ts_language_next_state\"];\n Module[\"_ts_language_symbol_name\"] = _ts_language_symbol_name = wasmExports[\"ts_language_symbol_name\"];\n Module[\"_ts_language_symbol_for_name\"] = _ts_language_symbol_for_name = wasmExports[\"ts_language_symbol_for_name\"];\n Module[\"_strncmp\"] = _strncmp = wasmExports[\"strncmp\"];\n Module[\"_ts_language_symbol_type\"] = _ts_language_symbol_type = wasmExports[\"ts_language_symbol_type\"];\n Module[\"_ts_language_field_name_for_id\"] = _ts_language_field_name_for_id = wasmExports[\"ts_language_field_name_for_id\"];\n Module[\"_ts_lookahead_iterator_new\"] = _ts_lookahead_iterator_new = wasmExports[\"ts_lookahead_iterator_new\"];\n Module[\"_ts_lookahead_iterator_delete\"] = _ts_lookahead_iterator_delete = wasmExports[\"ts_lookahead_iterator_delete\"];\n Module[\"_ts_lookahead_iterator_reset_state\"] = _ts_lookahead_iterator_reset_state = wasmExports[\"ts_lookahead_iterator_reset_state\"];\n Module[\"_ts_lookahead_iterator_reset\"] = _ts_lookahead_iterator_reset = wasmExports[\"ts_lookahead_iterator_reset\"];\n Module[\"_ts_lookahead_iterator_next\"] = _ts_lookahead_iterator_next = wasmExports[\"ts_lookahead_iterator_next\"];\n Module[\"_ts_lookahead_iterator_current_symbol\"] = _ts_lookahead_iterator_current_symbol = wasmExports[\"ts_lookahead_iterator_current_symbol\"];\n Module[\"_ts_point_edit\"] = _ts_point_edit = wasmExports[\"ts_point_edit\"];\n Module[\"_ts_parser_delete\"] = _ts_parser_delete = wasmExports[\"ts_parser_delete\"];\n Module[\"_ts_parser_reset\"] = _ts_parser_reset = wasmExports[\"ts_parser_reset\"];\n Module[\"_ts_parser_set_language\"] = _ts_parser_set_language = wasmExports[\"ts_parser_set_language\"];\n Module[\"_ts_parser_set_included_ranges\"] = _ts_parser_set_included_ranges = wasmExports[\"ts_parser_set_included_ranges\"];\n Module[\"_ts_query_new\"] = _ts_query_new = wasmExports[\"ts_query_new\"];\n Module[\"_ts_query_delete\"] = _ts_query_delete = wasmExports[\"ts_query_delete\"];\n Module[\"_iswspace\"] = _iswspace = wasmExports[\"iswspace\"];\n Module[\"_iswalnum\"] = _iswalnum = wasmExports[\"iswalnum\"];\n Module[\"_ts_query_pattern_count\"] = _ts_query_pattern_count = wasmExports[\"ts_query_pattern_count\"];\n Module[\"_ts_query_capture_count\"] = _ts_query_capture_count = wasmExports[\"ts_query_capture_count\"];\n Module[\"_ts_query_string_count\"] = _ts_query_string_count = wasmExports[\"ts_query_string_count\"];\n Module[\"_ts_query_capture_name_for_id\"] = _ts_query_capture_name_for_id = wasmExports[\"ts_query_capture_name_for_id\"];\n Module[\"_ts_query_capture_quantifier_for_id\"] = _ts_query_capture_quantifier_for_id = wasmExports[\"ts_query_capture_quantifier_for_id\"];\n Module[\"_ts_query_string_value_for_id\"] = _ts_query_string_value_for_id = wasmExports[\"ts_query_string_value_for_id\"];\n Module[\"_ts_query_predicates_for_pattern\"] = _ts_query_predicates_for_pattern = wasmExports[\"ts_query_predicates_for_pattern\"];\n Module[\"_ts_query_start_byte_for_pattern\"] = _ts_query_start_byte_for_pattern = wasmExports[\"ts_query_start_byte_for_pattern\"];\n Module[\"_ts_query_end_byte_for_pattern\"] = _ts_query_end_byte_for_pattern = wasmExports[\"ts_query_end_byte_for_pattern\"];\n Module[\"_ts_query_is_pattern_rooted\"] = _ts_query_is_pattern_rooted = wasmExports[\"ts_query_is_pattern_rooted\"];\n Module[\"_ts_query_is_pattern_non_local\"] = _ts_query_is_pattern_non_local = wasmExports[\"ts_query_is_pattern_non_local\"];\n Module[\"_ts_query_is_pattern_guaranteed_at_step\"] = _ts_query_is_pattern_guaranteed_at_step = wasmExports[\"ts_query_is_pattern_guaranteed_at_step\"];\n Module[\"_ts_query_disable_capture\"] = _ts_query_disable_capture = wasmExports[\"ts_query_disable_capture\"];\n Module[\"_ts_query_disable_pattern\"] = _ts_query_disable_pattern = wasmExports[\"ts_query_disable_pattern\"];\n Module[\"_ts_tree_copy\"] = _ts_tree_copy = wasmExports[\"ts_tree_copy\"];\n Module[\"_ts_tree_delete\"] = _ts_tree_delete = wasmExports[\"ts_tree_delete\"];\n Module[\"_ts_init\"] = _ts_init = wasmExports[\"ts_init\"];\n Module[\"_ts_parser_new_wasm\"] = _ts_parser_new_wasm = wasmExports[\"ts_parser_new_wasm\"];\n Module[\"_ts_parser_enable_logger_wasm\"] = _ts_parser_enable_logger_wasm = wasmExports[\"ts_parser_enable_logger_wasm\"];\n Module[\"_ts_parser_parse_wasm\"] = _ts_parser_parse_wasm = wasmExports[\"ts_parser_parse_wasm\"];\n Module[\"_ts_parser_included_ranges_wasm\"] = _ts_parser_included_ranges_wasm = wasmExports[\"ts_parser_included_ranges_wasm\"];\n Module[\"_ts_language_type_is_named_wasm\"] = _ts_language_type_is_named_wasm = wasmExports[\"ts_language_type_is_named_wasm\"];\n Module[\"_ts_language_type_is_visible_wasm\"] = _ts_language_type_is_visible_wasm = wasmExports[\"ts_language_type_is_visible_wasm\"];\n Module[\"_ts_language_metadata_wasm\"] = _ts_language_metadata_wasm = wasmExports[\"ts_language_metadata_wasm\"];\n Module[\"_ts_language_supertypes_wasm\"] = _ts_language_supertypes_wasm = wasmExports[\"ts_language_supertypes_wasm\"];\n Module[\"_ts_language_subtypes_wasm\"] = _ts_language_subtypes_wasm = wasmExports[\"ts_language_subtypes_wasm\"];\n Module[\"_ts_tree_root_node_wasm\"] = _ts_tree_root_node_wasm = wasmExports[\"ts_tree_root_node_wasm\"];\n Module[\"_ts_tree_root_node_with_offset_wasm\"] = _ts_tree_root_node_with_offset_wasm = wasmExports[\"ts_tree_root_node_with_offset_wasm\"];\n Module[\"_ts_tree_edit_wasm\"] = _ts_tree_edit_wasm = wasmExports[\"ts_tree_edit_wasm\"];\n Module[\"_ts_tree_included_ranges_wasm\"] = _ts_tree_included_ranges_wasm = wasmExports[\"ts_tree_included_ranges_wasm\"];\n Module[\"_ts_tree_get_changed_ranges_wasm\"] = _ts_tree_get_changed_ranges_wasm = wasmExports[\"ts_tree_get_changed_ranges_wasm\"];\n Module[\"_ts_tree_cursor_new_wasm\"] = _ts_tree_cursor_new_wasm = wasmExports[\"ts_tree_cursor_new_wasm\"];\n Module[\"_ts_tree_cursor_copy_wasm\"] = _ts_tree_cursor_copy_wasm = wasmExports[\"ts_tree_cursor_copy_wasm\"];\n Module[\"_ts_tree_cursor_delete_wasm\"] = _ts_tree_cursor_delete_wasm = wasmExports[\"ts_tree_cursor_delete_wasm\"];\n Module[\"_ts_tree_cursor_reset_wasm\"] = _ts_tree_cursor_reset_wasm = wasmExports[\"ts_tree_cursor_reset_wasm\"];\n Module[\"_ts_tree_cursor_reset_to_wasm\"] = _ts_tree_cursor_reset_to_wasm = wasmExports[\"ts_tree_cursor_reset_to_wasm\"];\n Module[\"_ts_tree_cursor_goto_first_child_wasm\"] = _ts_tree_cursor_goto_first_child_wasm = wasmExports[\"ts_tree_cursor_goto_first_child_wasm\"];\n Module[\"_ts_tree_cursor_goto_last_child_wasm\"] = _ts_tree_cursor_goto_last_child_wasm = wasmExports[\"ts_tree_cursor_goto_last_child_wasm\"];\n Module[\"_ts_tree_cursor_goto_first_child_for_index_wasm\"] = _ts_tree_cursor_goto_first_child_for_index_wasm = wasmExports[\"ts_tree_cursor_goto_first_child_for_index_wasm\"];\n Module[\"_ts_tree_cursor_goto_first_child_for_position_wasm\"] = _ts_tree_cursor_goto_first_child_for_position_wasm = wasmExports[\"ts_tree_cursor_goto_first_child_for_position_wasm\"];\n Module[\"_ts_tree_cursor_goto_next_sibling_wasm\"] = _ts_tree_cursor_goto_next_sibling_wasm = wasmExports[\"ts_tree_cursor_goto_next_sibling_wasm\"];\n Module[\"_ts_tree_cursor_goto_previous_sibling_wasm\"] = _ts_tree_cursor_goto_previous_sibling_wasm = wasmExports[\"ts_tree_cursor_goto_previous_sibling_wasm\"];\n Module[\"_ts_tree_cursor_goto_descendant_wasm\"] = _ts_tree_cursor_goto_descendant_wasm = wasmExports[\"ts_tree_cursor_goto_descendant_wasm\"];\n Module[\"_ts_tree_cursor_goto_parent_wasm\"] = _ts_tree_cursor_goto_parent_wasm = wasmExports[\"ts_tree_cursor_goto_parent_wasm\"];\n Module[\"_ts_tree_cursor_current_node_type_id_wasm\"] = _ts_tree_cursor_current_node_type_id_wasm = wasmExports[\"ts_tree_cursor_current_node_type_id_wasm\"];\n Module[\"_ts_tree_cursor_current_node_state_id_wasm\"] = _ts_tree_cursor_current_node_state_id_wasm = wasmExports[\"ts_tree_cursor_current_node_state_id_wasm\"];\n Module[\"_ts_tree_cursor_current_node_is_named_wasm\"] = _ts_tree_cursor_current_node_is_named_wasm = wasmExports[\"ts_tree_cursor_current_node_is_named_wasm\"];\n Module[\"_ts_tree_cursor_current_node_is_missing_wasm\"] = _ts_tree_cursor_current_node_is_missing_wasm = wasmExports[\"ts_tree_cursor_current_node_is_missing_wasm\"];\n Module[\"_ts_tree_cursor_current_node_id_wasm\"] = _ts_tree_cursor_current_node_id_wasm = wasmExports[\"ts_tree_cursor_current_node_id_wasm\"];\n Module[\"_ts_tree_cursor_start_position_wasm\"] = _ts_tree_cursor_start_position_wasm = wasmExports[\"ts_tree_cursor_start_position_wasm\"];\n Module[\"_ts_tree_cursor_end_position_wasm\"] = _ts_tree_cursor_end_position_wasm = wasmExports[\"ts_tree_cursor_end_position_wasm\"];\n Module[\"_ts_tree_cursor_start_index_wasm\"] = _ts_tree_cursor_start_index_wasm = wasmExports[\"ts_tree_cursor_start_index_wasm\"];\n Module[\"_ts_tree_cursor_end_index_wasm\"] = _ts_tree_cursor_end_index_wasm = wasmExports[\"ts_tree_cursor_end_index_wasm\"];\n Module[\"_ts_tree_cursor_current_field_id_wasm\"] = _ts_tree_cursor_current_field_id_wasm = wasmExports[\"ts_tree_cursor_current_field_id_wasm\"];\n Module[\"_ts_tree_cursor_current_depth_wasm\"] = _ts_tree_cursor_current_depth_wasm = wasmExports[\"ts_tree_cursor_current_depth_wasm\"];\n Module[\"_ts_tree_cursor_current_descendant_index_wasm\"] = _ts_tree_cursor_current_descendant_index_wasm = wasmExports[\"ts_tree_cursor_current_descendant_index_wasm\"];\n Module[\"_ts_tree_cursor_current_node_wasm\"] = _ts_tree_cursor_current_node_wasm = wasmExports[\"ts_tree_cursor_current_node_wasm\"];\n Module[\"_ts_node_symbol_wasm\"] = _ts_node_symbol_wasm = wasmExports[\"ts_node_symbol_wasm\"];\n Module[\"_ts_node_field_name_for_child_wasm\"] = _ts_node_field_name_for_child_wasm = wasmExports[\"ts_node_field_name_for_child_wasm\"];\n Module[\"_ts_node_field_name_for_named_child_wasm\"] = _ts_node_field_name_for_named_child_wasm = wasmExports[\"ts_node_field_name_for_named_child_wasm\"];\n Module[\"_ts_node_children_by_field_id_wasm\"] = _ts_node_children_by_field_id_wasm = wasmExports[\"ts_node_children_by_field_id_wasm\"];\n Module[\"_ts_node_first_child_for_byte_wasm\"] = _ts_node_first_child_for_byte_wasm = wasmExports[\"ts_node_first_child_for_byte_wasm\"];\n Module[\"_ts_node_first_named_child_for_byte_wasm\"] = _ts_node_first_named_child_for_byte_wasm = wasmExports[\"ts_node_first_named_child_for_byte_wasm\"];\n Module[\"_ts_node_grammar_symbol_wasm\"] = _ts_node_grammar_symbol_wasm = wasmExports[\"ts_node_grammar_symbol_wasm\"];\n Module[\"_ts_node_child_count_wasm\"] = _ts_node_child_count_wasm = wasmExports[\"ts_node_child_count_wasm\"];\n Module[\"_ts_node_named_child_count_wasm\"] = _ts_node_named_child_count_wasm = wasmExports[\"ts_node_named_child_count_wasm\"];\n Module[\"_ts_node_child_wasm\"] = _ts_node_child_wasm = wasmExports[\"ts_node_child_wasm\"];\n Module[\"_ts_node_named_child_wasm\"] = _ts_node_named_child_wasm = wasmExports[\"ts_node_named_child_wasm\"];\n Module[\"_ts_node_child_by_field_id_wasm\"] = _ts_node_child_by_field_id_wasm = wasmExports[\"ts_node_child_by_field_id_wasm\"];\n Module[\"_ts_node_next_sibling_wasm\"] = _ts_node_next_sibling_wasm = wasmExports[\"ts_node_next_sibling_wasm\"];\n Module[\"_ts_node_prev_sibling_wasm\"] = _ts_node_prev_sibling_wasm = wasmExports[\"ts_node_prev_sibling_wasm\"];\n Module[\"_ts_node_next_named_sibling_wasm\"] = _ts_node_next_named_sibling_wasm = wasmExports[\"ts_node_next_named_sibling_wasm\"];\n Module[\"_ts_node_prev_named_sibling_wasm\"] = _ts_node_prev_named_sibling_wasm = wasmExports[\"ts_node_prev_named_sibling_wasm\"];\n Module[\"_ts_node_descendant_count_wasm\"] = _ts_node_descendant_count_wasm = wasmExports[\"ts_node_descendant_count_wasm\"];\n Module[\"_ts_node_parent_wasm\"] = _ts_node_parent_wasm = wasmExports[\"ts_node_parent_wasm\"];\n Module[\"_ts_node_child_with_descendant_wasm\"] = _ts_node_child_with_descendant_wasm = wasmExports[\"ts_node_child_with_descendant_wasm\"];\n Module[\"_ts_node_descendant_for_index_wasm\"] = _ts_node_descendant_for_index_wasm = wasmExports[\"ts_node_descendant_for_index_wasm\"];\n Module[\"_ts_node_named_descendant_for_index_wasm\"] = _ts_node_named_descendant_for_index_wasm = wasmExports[\"ts_node_named_descendant_for_index_wasm\"];\n Module[\"_ts_node_descendant_for_position_wasm\"] = _ts_node_descendant_for_position_wasm = wasmExports[\"ts_node_descendant_for_position_wasm\"];\n Module[\"_ts_node_named_descendant_for_position_wasm\"] = _ts_node_named_descendant_for_position_wasm = wasmExports[\"ts_node_named_descendant_for_position_wasm\"];\n Module[\"_ts_node_start_point_wasm\"] = _ts_node_start_point_wasm = wasmExports[\"ts_node_start_point_wasm\"];\n Module[\"_ts_node_end_point_wasm\"] = _ts_node_end_point_wasm = wasmExports[\"ts_node_end_point_wasm\"];\n Module[\"_ts_node_start_index_wasm\"] = _ts_node_start_index_wasm = wasmExports[\"ts_node_start_index_wasm\"];\n Module[\"_ts_node_end_index_wasm\"] = _ts_node_end_index_wasm = wasmExports[\"ts_node_end_index_wasm\"];\n Module[\"_ts_node_to_string_wasm\"] = _ts_node_to_string_wasm = wasmExports[\"ts_node_to_string_wasm\"];\n Module[\"_ts_node_children_wasm\"] = _ts_node_children_wasm = wasmExports[\"ts_node_children_wasm\"];\n Module[\"_ts_node_named_children_wasm\"] = _ts_node_named_children_wasm = wasmExports[\"ts_node_named_children_wasm\"];\n Module[\"_ts_node_descendants_of_type_wasm\"] = _ts_node_descendants_of_type_wasm = wasmExports[\"ts_node_descendants_of_type_wasm\"];\n Module[\"_ts_node_is_named_wasm\"] = _ts_node_is_named_wasm = wasmExports[\"ts_node_is_named_wasm\"];\n Module[\"_ts_node_has_changes_wasm\"] = _ts_node_has_changes_wasm = wasmExports[\"ts_node_has_changes_wasm\"];\n Module[\"_ts_node_has_error_wasm\"] = _ts_node_has_error_wasm = wasmExports[\"ts_node_has_error_wasm\"];\n Module[\"_ts_node_is_error_wasm\"] = _ts_node_is_error_wasm = wasmExports[\"ts_node_is_error_wasm\"];\n Module[\"_ts_node_is_missing_wasm\"] = _ts_node_is_missing_wasm = wasmExports[\"ts_node_is_missing_wasm\"];\n Module[\"_ts_node_is_extra_wasm\"] = _ts_node_is_extra_wasm = wasmExports[\"ts_node_is_extra_wasm\"];\n Module[\"_ts_node_parse_state_wasm\"] = _ts_node_parse_state_wasm = wasmExports[\"ts_node_parse_state_wasm\"];\n Module[\"_ts_node_next_parse_state_wasm\"] = _ts_node_next_parse_state_wasm = wasmExports[\"ts_node_next_parse_state_wasm\"];\n Module[\"_ts_query_matches_wasm\"] = _ts_query_matches_wasm = wasmExports[\"ts_query_matches_wasm\"];\n Module[\"_ts_query_captures_wasm\"] = _ts_query_captures_wasm = wasmExports[\"ts_query_captures_wasm\"];\n Module[\"_memset\"] = _memset = wasmExports[\"memset\"];\n Module[\"_memcpy\"] = _memcpy = wasmExports[\"memcpy\"];\n Module[\"_memmove\"] = _memmove = wasmExports[\"memmove\"];\n Module[\"_iswalpha\"] = _iswalpha = wasmExports[\"iswalpha\"];\n Module[\"_iswblank\"] = _iswblank = wasmExports[\"iswblank\"];\n Module[\"_iswdigit\"] = _iswdigit = wasmExports[\"iswdigit\"];\n Module[\"_iswlower\"] = _iswlower = wasmExports[\"iswlower\"];\n Module[\"_iswupper\"] = _iswupper = wasmExports[\"iswupper\"];\n Module[\"_iswxdigit\"] = _iswxdigit = wasmExports[\"iswxdigit\"];\n Module[\"_memchr\"] = _memchr = wasmExports[\"memchr\"];\n Module[\"_strlen\"] = _strlen = wasmExports[\"strlen\"];\n Module[\"_strcmp\"] = _strcmp = wasmExports[\"strcmp\"];\n Module[\"_strncat\"] = _strncat = wasmExports[\"strncat\"];\n Module[\"_strncpy\"] = _strncpy = wasmExports[\"strncpy\"];\n Module[\"_towlower\"] = _towlower = wasmExports[\"towlower\"];\n Module[\"_towupper\"] = _towupper = wasmExports[\"towupper\"];\n _setThrew = wasmExports[\"setThrew\"];\n __emscripten_stack_restore = wasmExports[\"_emscripten_stack_restore\"];\n __emscripten_stack_alloc = wasmExports[\"_emscripten_stack_alloc\"];\n _emscripten_stack_get_current = wasmExports[\"emscripten_stack_get_current\"];\n ___wasm_apply_data_relocs = wasmExports[\"__wasm_apply_data_relocs\"];\n}\n\nvar wasmImports = {\n /** @export */ __heap_base: ___heap_base,\n /** @export */ __indirect_function_table: wasmTable,\n /** @export */ __memory_base: ___memory_base,\n /** @export */ __stack_high: ___stack_high,\n /** @export */ __stack_low: ___stack_low,\n /** @export */ __stack_pointer: ___stack_pointer,\n /** @export */ __table_base: ___table_base,\n /** @export */ _abort_js: __abort_js,\n /** @export */ emscripten_resize_heap: _emscripten_resize_heap,\n /** @export */ fd_close: _fd_close,\n /** @export */ fd_seek: _fd_seek,\n /** @export */ fd_write: _fd_write,\n /** @export */ memory: wasmMemory,\n /** @export */ tree_sitter_log_callback: _tree_sitter_log_callback,\n /** @export */ tree_sitter_parse_callback: _tree_sitter_parse_callback,\n /** @export */ tree_sitter_progress_callback: _tree_sitter_progress_callback,\n /** @export */ tree_sitter_query_progress_callback: _tree_sitter_query_progress_callback\n};\n\n// include: postamble.js\n// === Auto-generated postamble setup entry stuff ===\nfunction callMain(args = []) {\n var entryFunction = resolveGlobalSymbol(\"main\").sym;\n // Main modules can't tell if they have main() at compile time, since it may\n // arrive from a dynamic library.\n if (!entryFunction) return;\n args.unshift(thisProgram);\n var argc = args.length;\n var argv = stackAlloc((argc + 1) * 4);\n var argv_ptr = argv;\n args.forEach(arg => {\n LE_HEAP_STORE_U32(((argv_ptr) >> 2) * 4, stringToUTF8OnStack(arg));\n argv_ptr += 4;\n });\n LE_HEAP_STORE_U32(((argv_ptr) >> 2) * 4, 0);\n try {\n var ret = entryFunction(argc, argv);\n // if we're not running an evented main loop, it's time to exit\n exitJS(ret, /* implicit = */ true);\n return ret;\n } catch (e) {\n return handleException(e);\n }\n}\n\nfunction run(args = arguments_) {\n if (runDependencies > 0) {\n dependenciesFulfilled = run;\n return;\n }\n preRun();\n // a preRun added a dependency, run will be called later\n if (runDependencies > 0) {\n dependenciesFulfilled = run;\n return;\n }\n function doRun() {\n // run may have just been called through dependencies being fulfilled just in this very frame,\n // or while the async setStatus time below was happening\n Module[\"calledRun\"] = true;\n if (ABORT) return;\n initRuntime();\n preMain();\n readyPromiseResolve?.(Module);\n Module[\"onRuntimeInitialized\"]?.();\n var noInitialRun = Module[\"noInitialRun\"] || false;\n if (!noInitialRun) callMain(args);\n postRun();\n }\n if (Module[\"setStatus\"]) {\n Module[\"setStatus\"](\"Running...\");\n setTimeout(() => {\n setTimeout(() => Module[\"setStatus\"](\"\"), 1);\n doRun();\n }, 1);\n } else {\n doRun();\n }\n}\n\nvar wasmExports;\n\n// In modularize mode the generated code is within a factory function so we\n// can use await here (since it's not top-level-await).\nwasmExports = await (createWasm());\n\nrun();\n\n// end include: postamble.js\n// include: postamble_modularize.js\n// In MODULARIZE mode we wrap the generated code in a factory function\n// and return either the Module itself, or a promise of the module.\n// We assign to the `moduleRtn` global here and configure closure to see\n// this as and extern so it won't get minified.\nif (runtimeInitialized) {\n moduleRtn = Module;\n} else {\n // Set up the promise that indicates the Module is initialized\n moduleRtn = new Promise((resolve, reject) => {\n readyPromiseResolve = resolve;\n readyPromiseReject = reject;\n });\n}\n\n\n return moduleRtn;\n}\n\n// Export using a UMD style export, or ES6 exports if selected\nexport default Module;\n\n", "import createModule, { type MainModule } from '../lib/web-tree-sitter';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { type Parser } from './parser';\n\nexport let Module: MainModule | null = null;\n\n/**\n * @internal\n *\n * Initialize the Tree-sitter Wasm module. This should only be called by the {@link Parser} class via {@link Parser.init}.\n */\nexport async function initializeBinding(moduleOptions?: Partial<EmscriptenModule>): Promise<MainModule> {\n return Module ??= await createModule(moduleOptions);\n}\n\n/**\n * @internal\n *\n * Checks if the Tree-sitter Wasm module has been initialized.\n */\nexport function checkModule(): boolean {\n return !!Module;\n}\n", "import { C, INTERNAL, LogCallback, ParseCallback, Range, SIZE_OF_INT, SIZE_OF_RANGE, setModule } from './constants';\nimport { Language } from './language';\nimport { marshalRange, unmarshalRange } from './marshal';\nimport { checkModule, initializeBinding } from './bindings';\nimport { Tree } from './tree';\n\n/**\n * Options for parsing\n *\n * The `includedRanges` property is an array of {@link Range} objects that\n * represent the ranges of text that the parser should include when parsing.\n *\n * The `progressCallback` property is a function that is called periodically\n * during parsing to check whether parsing should be cancelled.\n *\n * See {@link Parser#parse} for more information.\n */\nexport interface ParseOptions {\n /**\n * An array of {@link Range} objects that\n * represent the ranges of text that the parser should include when parsing.\n *\n * This sets the ranges of text that the parser should include when parsing.\n * By default, the parser will always include entire documents. This\n * function allows you to parse only a *portion* of a document but\n * still return a syntax tree whose ranges match up with the document\n * as a whole. You can also pass multiple disjoint ranges.\n * If `ranges` is empty, then the entire document will be parsed.\n * Otherwise, the given ranges must be ordered from earliest to latest\n * in the document, and they must not overlap. That is, the following\n * must hold for all `i` < `length - 1`:\n * ```text\n * ranges[i].end_byte <= ranges[i + 1].start_byte\n * ```\n */\n includedRanges?: Range[];\n\n /**\n * A function that is called periodically during parsing to check\n * whether parsing should be cancelled. If the progress callback returns\n * `true`, then parsing will be cancelled. You can also use this to instrument\n * parsing and check where the parser is at in the document. The progress callback\n * takes a single argument, which is a {@link ParseState} representing the current\n * state of the parser.\n */\n progressCallback?: (state: ParseState) => void;\n}\n\n/**\n * A stateful object that is passed into the progress callback {@link ParseOptions#progressCallback}\n * to provide the current state of the parser.\n */\nexport interface ParseState {\n /** The byte offset in the document that the parser is at. */\n currentOffset: number;\n\n /** Indicates whether the parser has encountered an error during parsing. */\n hasError: boolean;\n}\n\n/**\n * @internal\n *\n * Global variable for transferring data across the FFI boundary\n */\nexport let TRANSFER_BUFFER: number;\n\n/**\n * The latest ABI version that is supported by the current version of the\n * library.\n *\n * When Languages are generated by the Tree-sitter CLI, they are\n * assigned an ABI version number that corresponds to the current CLI version.\n * The Tree-sitter library is generally backwards-compatible with languages\n * generated using older CLI versions, but is not forwards-compatible.\n */\nexport let LANGUAGE_VERSION: number;\n\n/**\n * The earliest ABI version that is supported by the current version of the\n * library.\n */\nexport let MIN_COMPATIBLE_VERSION: number;\n\n/**\n * A stateful object that is used to produce a {@link Tree} based on some\n * source code.\n */\nexport class Parser {\n /** @internal */\n private [0] = 0; // Internal handle for Wasm\n\n /** @internal */\n private [1] = 0; // Internal handle for Wasm\n\n /** @internal */\n private logCallback: LogCallback | null = null;\n\n /** The parser's current language. */\n language: Language | null = null;\n\n /**\n * This must always be called before creating a Parser.\n *\n * You can optionally pass in options to configure the Wasm module, the most common\n * one being `locateFile` to help the module find the `.wasm` file.\n */\n static async init(moduleOptions?: Partial<EmscriptenModule>) {\n setModule(await initializeBinding(moduleOptions));\n TRANSFER_BUFFER = C._ts_init();\n LANGUAGE_VERSION = C.getValue(TRANSFER_BUFFER, 'i32');\n MIN_COMPATIBLE_VERSION = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, 'i32');\n }\n\n /**\n * Create a new parser.\n */\n constructor() {\n this.initialize();\n }\n\n /** @internal */\n initialize() {\n if (!checkModule()) {\n throw new Error(\"cannot construct a Parser before calling `init()`\");\n }\n C._ts_parser_new_wasm();\n this[0] = C.getValue(TRANSFER_BUFFER, 'i32');\n this[1] = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, 'i32');\n }\n\n /** Delete the parser, freeing its resources. */\n delete() {\n C._ts_parser_delete(this[0]);\n C._free(this[1]);\n this[0] = 0;\n this[1] = 0;\n }\n\n /**\n * Set the language that the parser should use for parsing.\n *\n * If the language was not successfully assigned, an error will be thrown.\n * This happens if the language was generated with an incompatible\n * version of the Tree-sitter CLI. Check the language's version using\n * {@link Language#version} and compare it to this library's\n * {@link LANGUAGE_VERSION} and {@link MIN_COMPATIBLE_VERSION} constants.\n */\n setLanguage(language: Language | null): this {\n let address: number;\n if (!language) {\n address = 0;\n this.language = null;\n } else if (language.constructor === Language) {\n address = language[0];\n const version = C._ts_language_abi_version(address);\n if (version < MIN_COMPATIBLE_VERSION || LANGUAGE_VERSION < version) {\n throw new Error(\n `Incompatible language version ${version}. ` +\n `Compatibility range ${MIN_COMPATIBLE_VERSION} through ${LANGUAGE_VERSION}.`\n );\n }\n this.language = language;\n } else {\n throw new Error('Argument must be a Language');\n }\n\n C._ts_parser_set_language(this[0], address);\n return this;\n }\n\n /**\n * Parse a slice of UTF8 text.\n *\n * @param {string | ParseCallback} callback - The UTF8-encoded text to parse or a callback function.\n *\n * @param {Tree | null} [oldTree] - A previous syntax tree parsed from the same document. If the text of the\n * document has changed since `oldTree` was created, then you must edit `oldTree` to match\n * the new text using {@link Tree#edit}.\n *\n * @param {ParseOptions} [options] - Options for parsing the text.\n * This can be used to set the included ranges, or a progress callback.\n *\n * @returns {Tree | null} A {@link Tree} if parsing succeeded, or `null` if:\n * - The parser has not yet had a language assigned with {@link Parser#setLanguage}.\n * - The progress callback returned true.\n */\n parse(\n callback: string | ParseCallback,\n oldTree?: Tree | null,\n options?: ParseOptions,\n ): Tree | null {\n if (typeof callback === 'string') {\n C.currentParseCallback = (index: number) => callback.slice(index);\n } else if (typeof callback === 'function') {\n C.currentParseCallback = callback;\n } else {\n throw new Error('Argument must be a string or a function');\n }\n\n if (options?.progressCallback) {\n C.currentProgressCallback = options.progressCallback;\n } else {\n C.currentProgressCallback = null;\n }\n\n if (this.logCallback) {\n C.currentLogCallback = this.logCallback;\n C._ts_parser_enable_logger_wasm(this[0], 1);\n } else {\n C.currentLogCallback = null;\n C._ts_parser_enable_logger_wasm(this[0], 0);\n }\n\n let rangeCount = 0;\n let rangeAddress = 0;\n if (options?.includedRanges) {\n rangeCount = options.includedRanges.length;\n rangeAddress = C._calloc(rangeCount, SIZE_OF_RANGE);\n let address = rangeAddress;\n for (let i = 0; i < rangeCount; i++) {\n marshalRange(address, options.includedRanges[i]);\n address += SIZE_OF_RANGE;\n }\n }\n\n const treeAddress = C._ts_parser_parse_wasm(\n this[0],\n this[1],\n oldTree ? oldTree[0] : 0,\n rangeAddress,\n rangeCount\n );\n\n if (!treeAddress) {\n C.currentParseCallback = null;\n C.currentLogCallback = null;\n C.currentProgressCallback = null;\n return null;\n }\n\n if (!this.language) {\n throw new Error('Parser must have a language to parse');\n }\n\n const result = new Tree(INTERNAL, treeAddress, this.language, C.currentParseCallback);\n C.currentParseCallback = null;\n C.currentLogCallback = null;\n C.currentProgressCallback = null;\n return result;\n }\n\n /**\n * Instruct the parser to start the next parse from the beginning.\n *\n * If the parser previously failed because of a callback, \n * then by default, it will resume where it left off on the\n * next call to {@link Parser#parse} or other parsing functions.\n * If you don't want to resume, and instead intend to use this parser to\n * parse some other document, you must call `reset` first.\n */\n reset(): void {\n C._ts_parser_reset(this[0]);\n }\n\n /** Get the ranges of text that the parser will include when parsing. */\n getIncludedRanges(): Range[] {\n C._ts_parser_included_ranges_wasm(this[0]);\n const count = C.getValue(TRANSFER_BUFFER, 'i32');\n const buffer = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, 'i32');\n const result = new Array<Range>(count);\n\n if (count > 0) {\n let address = buffer;\n for (let i = 0; i < count; i++) {\n result[i] = unmarshalRange(address);\n address += SIZE_OF_RANGE;\n }\n C._free(buffer);\n }\n\n return result;\n }\n\n /** Set the logging callback that a parser should use during parsing. */\n setLogger(callback: LogCallback | boolean | null): this {\n if (!callback) {\n this.logCallback = null;\n } else if (typeof callback !== 'function') {\n throw new Error('Logger callback must be a function');\n } else {\n this.logCallback = callback;\n }\n return this;\n }\n\n /** Get the parser's current logger. */\n getLogger(): LogCallback | null {\n return this.logCallback;\n }\n}\n", "import { Point, ZERO_POINT, SIZE_OF_INT, C } from './constants';\nimport { Node } from './node';\nimport { marshalNode, unmarshalCaptures } from './marshal';\nimport { TRANSFER_BUFFER } from './parser';\nimport { Language } from './language';\n\nconst PREDICATE_STEP_TYPE_CAPTURE = 1;\n\nconst PREDICATE_STEP_TYPE_STRING = 2;\n\nconst QUERY_WORD_REGEX = /[\\w-]+/g;\n\n/**\n * Options for query execution\n */\nexport interface QueryOptions {\n /** The start position of the range to query */\n startPosition?: Point;\n\n /** The end position of the range to query */\n endPosition?: Point;\n\n /** The start position of the range to query Only the matches that are fully\n * contained within provided range will be returned.\n **/\n startContainingPosition?: Point;\n\n /** The end position of the range to query Only the matches that are fully\n * contained within provided range will be returned.\n **/\n endContainingPosition?: Point;\n\n /** The start index of the range to query */\n startIndex?: number;\n\n /** The end index of the range to query */\n endIndex?: number;\n\n /** The start index of the range to query Only the matches that are fully\n * contained within provided range will be returned.\n **/\n startContainingIndex?: number;\n\n /** The end index of the range to query Only the matches that are fully\n * contained within provided range will be returned.\n **/\n endContainingIndex?: number;\n\n /**\n * The maximum number of in-progress matches for this query.\n * The limit must be > 0 and <= 65536.\n */\n matchLimit?: number;\n\n /**\n * The maximum start depth for a query cursor.\n *\n * This prevents cursors from exploring children nodes at a certain depth.\n * Note if a pattern includes many children, then they will still be\n * checked.\n *\n * The zero max start depth value can be used as a special behavior and\n * it helps to destructure a subtree by staying on a node and using\n * captures for interested parts. Note that the zero max start depth\n * only limit a search depth for a pattern's root node but other nodes\n * that are parts of the pattern may be searched at any depth what\n * defined by the pattern structure.\n *\n * Set to `null` to remove the maximum start depth.\n */\n maxStartDepth?: number;\n\n /**\n * A function that will be called periodically during the execution of the query to check\n * if query execution should be cancelled. You can also use this to instrument query execution\n * and check where the query is at in the document. The progress callback takes a single argument,\n * which is a {@link QueryState} representing the current state of the query.\n */\n progressCallback?: (state: QueryState) => void;\n}\n\n/**\n * A stateful object that is passed into the progress callback {@link QueryOptions#progressCallback}\n * to provide the current state of the query.\n */\nexport interface QueryState {\n /** The byte offset in the document that the query is at. */\n currentOffset: number;\n}\n\n/** A record of key-value pairs associated with a particular pattern in a {@link Query}. */\nexport type QueryProperties = Record<string, string | null>;\n\n/**\n * A predicate that contains an operator and list of operands.\n */\nexport interface QueryPredicate {\n /** The operator of the predicate, like `match?`, `eq?`, `set!`, etc. */\n operator: string;\n\n /** The operands of the predicate, which are either captures or strings. */\n operands: PredicateStep[];\n}\n\n/**\n * A particular {@link Node} that has been captured with a particular name within a\n * {@link Query}.\n */\nexport interface QueryCapture {\n /** The index of the pattern that matched. */\n patternIndex: number;\n\n /** The name of the capture */\n name: string;\n\n /** The captured node */\n node: Node;\n\n /** The properties for predicates declared with the operator `set!`. */\n setProperties?: QueryProperties;\n\n /** The properties for predicates declared with the operator `is?`. */\n assertedProperties?: QueryProperties;\n\n /** The properties for predicates declared with the operator `is-not?`. */\n refutedProperties?: QueryProperties;\n}\n\n/** A match of a {@link Query} to a particular set of {@link Node}s. */\nexport interface QueryMatch {\n /** The index of the pattern that matched. */\n patternIndex: number;\n\n /** The captures associated with the match. */\n captures: QueryCapture[];\n\n /** The properties for predicates declared with the operator `set!`. */\n setProperties?: QueryProperties;\n\n /** The properties for predicates declared with the operator `is?`. */\n assertedProperties?: QueryProperties;\n\n /** The properties for predicates declared with the operator `is-not?`. */\n refutedProperties?: QueryProperties;\n}\n\n/** A quantifier for captures */\nexport const CaptureQuantifier = {\n Zero: 0,\n ZeroOrOne: 1,\n ZeroOrMore: 2,\n One: 3,\n OneOrMore: 4\n} as const;\n\n/** A quantifier for captures */\nexport type CaptureQuantifier = typeof CaptureQuantifier[keyof typeof CaptureQuantifier];\n\n/**\n * Predicates are represented as a single array of steps. There are two\n * types of steps, which correspond to the two legal values for\n * the `type` field:\n *\n * - `CapturePredicateStep` - Steps with this type represent names\n * of captures.\n *\n * - `StringPredicateStep` - Steps with this type represent literal\n * strings.\n */\nexport type PredicateStep = CapturePredicateStep | StringPredicateStep;\n\n/**\n * A step in a predicate that refers to a capture.\n *\n * The `name` field is the name of the capture.\n */\nexport interface CapturePredicateStep { type: 'capture', name: string }\n\n/**\n * A step in a predicate that refers to a string.\n *\n * The `value` field is the string value.\n */\nexport interface StringPredicateStep { type: 'string', value: string }\n\nconst isCaptureStep = (step: PredicateStep): step is Extract<PredicateStep, { type: 'capture' }> =>\n step.type === 'capture';\n\nconst isStringStep = (step: PredicateStep): step is Extract<PredicateStep, { type: 'string' }> =>\n step.type === 'string';\n\n/**\n * @internal\n *\n * A function that checks if a given set of captures matches a particular\n * condition. This is used in the built-in `eq?`, `match?`, and `any-of?`\n * predicates.\n */\nexport type TextPredicate = (captures: QueryCapture[]) => boolean;\n\n/** Error codes returned from tree-sitter query parsing */\nexport const QueryErrorKind = {\n Syntax: 1,\n NodeName: 2,\n FieldName: 3,\n CaptureName: 4,\n PatternStructure: 5,\n} as const;\n\n/** An error that occurred while parsing a query string. */\nexport type QueryErrorKind = typeof QueryErrorKind[keyof typeof QueryErrorKind];\n\n/** Information about a {@link QueryError}. */\nexport interface QueryErrorInfo {\n [QueryErrorKind.NodeName]: { word: string };\n [QueryErrorKind.FieldName]: { word: string };\n [QueryErrorKind.CaptureName]: { word: string };\n [QueryErrorKind.PatternStructure]: { suffix: string };\n [QueryErrorKind.Syntax]: { suffix: string };\n}\n\n/** Error thrown when parsing a tree-sitter query fails */\nexport class QueryError extends Error {\n constructor(\n public kind: QueryErrorKind,\n public info: QueryErrorInfo[typeof kind],\n public index: number,\n public length: number\n ) {\n super(QueryError.formatMessage(kind, info));\n this.name = 'QueryError';\n }\n\n /** Formats an error message based on the error kind and info */\n private static formatMessage(kind: QueryErrorKind, info: QueryErrorInfo[QueryErrorKind]): string {\n switch (kind) {\n case QueryErrorKind.NodeName:\n return `Bad node name '${(info as QueryErrorInfo[2]).word}'`;\n case QueryErrorKind.FieldName:\n return `Bad field name '${(info as QueryErrorInfo[3]).word}'`;\n case QueryErrorKind.CaptureName:\n return `Bad capture name @${(info as QueryErrorInfo[4]).word}`;\n case QueryErrorKind.PatternStructure:\n return `Bad pattern structure at offset ${(info as QueryErrorInfo[5]).suffix}`;\n case QueryErrorKind.Syntax:\n return `Bad syntax at offset ${(info as QueryErrorInfo[1]).suffix}`;\n }\n }\n}\n\n/**\n * Parses the `eq?` and `not-eq?` predicates in a query, and updates the text predicates.\n */\nfunction parseAnyPredicate(\n steps: PredicateStep[],\n index: number,\n operator: string,\n textPredicates: TextPredicate[][],\n) {\n if (steps.length !== 3) {\n throw new Error(\n `Wrong number of arguments to \\`#${operator}\\` predicate. Expected 2, got ${steps.length - 1}`\n );\n }\n\n if (!isCaptureStep(steps[1])) {\n throw new Error(\n `First argument of \\`#${operator}\\` predicate must be a capture. Got \"${steps[1].value}\"`\n );\n }\n\n const isPositive = operator === 'eq?' || operator === 'any-eq?';\n const matchAll = !operator.startsWith('any-');\n\n if (isCaptureStep(steps[2])) {\n const captureName1 = steps[1].name;\n const captureName2 = steps[2].name;\n textPredicates[index].push((captures) => {\n const nodes1: Node[] = [];\n const nodes2: Node[] = [];\n for (const c of captures) {\n if (c.name === captureName1) nodes1.push(c.node);\n if (c.name === captureName2) nodes2.push(c.node);\n }\n const compare = (n1: { text: string }, n2: { text: string }, positive: boolean) => {\n return positive ? n1.text === n2.text : n1.text !== n2.text;\n };\n return matchAll\n ? nodes1.every((n1) => nodes2.some((n2) => compare(n1, n2, isPositive)))\n : nodes1.some((n1) => nodes2.some((n2) => compare(n1, n2, isPositive)));\n });\n } else {\n const captureName = steps[1].name;\n const stringValue = steps[2].value;\n const matches = (n: Node) => n.text === stringValue;\n const doesNotMatch = (n: Node) => n.text !== stringValue;\n textPredicates[index].push((captures) => {\n const nodes = [];\n for (const c of captures) {\n if (c.name === captureName) nodes.push(c.node);\n }\n const test = isPositive ? matches : doesNotMatch;\n return matchAll ? nodes.every(test) : nodes.some(test);\n });\n }\n}\n\n/**\n * Parses the `match?` and `not-match?` predicates in a query, and updates the text predicates.\n */\nfunction parseMatchPredicate(\n steps: PredicateStep[],\n index: number,\n operator: string,\n textPredicates: TextPredicate[][],\n) {\n if (steps.length !== 3) {\n throw new Error(\n `Wrong number of arguments to \\`#${operator}\\` predicate. Expected 2, got ${steps.length - 1}.`,\n );\n }\n\n if (steps[1].type !== 'capture') {\n throw new Error(\n `First argument of \\`#${operator}\\` predicate must be a capture. Got \"${steps[1].value}\".`,\n );\n }\n\n if (steps[2].type !== 'string') {\n throw new Error(\n `Second argument of \\`#${operator}\\` predicate must be a string. Got @${steps[2].name}.`,\n );\n }\n\n const isPositive = operator === 'match?' || operator === 'any-match?';\n const matchAll = !operator.startsWith('any-');\n const captureName = steps[1].name;\n const regex = new RegExp(steps[2].value);\n textPredicates[index].push((captures) => {\n const nodes = [];\n for (const c of captures) {\n if (c.name === captureName) nodes.push(c.node.text);\n }\n const test = (text: string, positive: boolean) => {\n return positive ?\n regex.test(text) :\n !regex.test(text);\n };\n if (nodes.length === 0) return !isPositive;\n return matchAll ?\n nodes.every((text) => test(text, isPositive)) :\n nodes.some((text) => test(text, isPositive));\n });\n}\n\n/**\n * Parses the `any-of?` and `not-any-of?` predicates in a query, and updates the text predicates.\n */\nfunction parseAnyOfPredicate(\n steps: PredicateStep[],\n index: number,\n operator: string,\n textPredicates: TextPredicate[][],\n) {\n if (steps.length < 2) {\n throw new Error(\n `Wrong number of arguments to \\`#${operator}\\` predicate. Expected at least 1. Got ${steps.length - 1}.`,\n );\n }\n\n if (steps[1].type !== 'capture') {\n throw new Error(\n `First argument of \\`#${operator}\\` predicate must be a capture. Got \"${steps[1].value}\".`,\n );\n }\n\n const isPositive = operator === 'any-of?';\n const captureName = steps[1].name;\n\n const stringSteps = steps.slice(2);\n if (!stringSteps.every(isStringStep)) {\n throw new Error(\n `Arguments to \\`#${operator}\\` predicate must be strings.\".`,\n );\n }\n const values = stringSteps.map((s) => s.value);\n\n textPredicates[index].push((captures) => {\n const nodes = [];\n for (const c of captures) {\n if (c.name === captureName) nodes.push(c.node.text);\n }\n if (nodes.length === 0) return !isPositive;\n return nodes.every((text) => values.includes(text)) === isPositive;\n });\n}\n\n/**\n * Parses the `is?` and `is-not?` predicates in a query, and updates the asserted or refuted properties,\n * depending on if the operator is positive or negative.\n */\nfunction parseIsPredicate(\n steps: PredicateStep[],\n index: number,\n operator: string,\n assertedProperties: QueryProperties[],\n refutedProperties: QueryProperties[],\n) {\n if (steps.length < 2 || steps.length > 3) {\n throw new Error(\n `Wrong number of arguments to \\`#${operator}\\` predicate. Expected 1 or 2. Got ${steps.length - 1}.`,\n );\n }\n\n if (!steps.every(isStringStep)) {\n throw new Error(\n `Arguments to \\`#${operator}\\` predicate must be strings.\".`,\n );\n }\n\n const properties = operator === 'is?' ? assertedProperties : refutedProperties;\n if (!properties[index]) properties[index] = {};\n properties[index][steps[1].value] = steps[2]?.value ?? null;\n}\n\n/**\n * Parses the `set!` directive in a query, and updates the set properties.\n */\nfunction parseSetDirective(\n steps: PredicateStep[],\n index: number,\n setProperties: QueryProperties[],\n) {\n if (steps.length < 2 || steps.length > 3) {\n throw new Error(`Wrong number of arguments to \\`#set!\\` predicate. Expected 1 or 2. Got ${steps.length - 1}.`);\n }\n if (!steps.every(isStringStep)) {\n throw new Error(`Arguments to \\`#set!\\` predicate must be strings.\".`);\n }\n if (!setProperties[index]) setProperties[index] = {};\n setProperties[index][steps[1].value] = steps[2]?.value ?? null;\n}\n\n/**\n * Parses the predicate at a given step in a pattern, and updates the appropriate\n * predicates or properties.\n */\nfunction parsePattern(\n index: number,\n stepType: number,\n stepValueId: number,\n captureNames: string[],\n stringValues: string[],\n steps: PredicateStep[],\n textPredicates: TextPredicate[][],\n predicates: QueryPredicate[][],\n setProperties: QueryProperties[],\n assertedProperties: QueryProperties[],\n refutedProperties: QueryProperties[],\n) {\n if (stepType === PREDICATE_STEP_TYPE_CAPTURE) {\n const name = captureNames[stepValueId];\n steps.push({ type: 'capture', name });\n } else if (stepType === PREDICATE_STEP_TYPE_STRING) {\n steps.push({ type: 'string', value: stringValues[stepValueId] });\n } else if (steps.length > 0) {\n if (steps[0].type !== 'string') {\n throw new Error('Predicates must begin with a literal value');\n }\n\n const operator = steps[0].value;\n switch (operator) {\n case 'any-not-eq?':\n case 'not-eq?':\n case 'any-eq?':\n case 'eq?':\n parseAnyPredicate(steps, index, operator, textPredicates);\n break;\n\n case 'any-not-match?':\n case 'not-match?':\n case 'any-match?':\n case 'match?':\n parseMatchPredicate(steps, index, operator, textPredicates);\n break;\n\n case 'not-any-of?':\n case 'any-of?':\n parseAnyOfPredicate(steps, index, operator, textPredicates);\n break;\n\n case 'is?':\n case 'is-not?':\n parseIsPredicate(steps, index, operator, assertedProperties, refutedProperties);\n break;\n\n case 'set!':\n parseSetDirective(steps, index, setProperties);\n break;\n\n default:\n predicates[index].push({ operator, operands: steps.slice(1) });\n }\n\n steps.length = 0;\n }\n}\n\nexport class Query {\n /** @internal */\n private [0] = 0; // Internal handle for Wasm\n\n /** @internal */\n private exceededMatchLimit: boolean;\n\n /** @internal */\n private textPredicates: TextPredicate[][];\n\n /** The names of the captures used in the query. */\n readonly captureNames: string[];\n\n /** The quantifiers of the captures used in the query. */\n readonly captureQuantifiers: CaptureQuantifier[][];\n\n /**\n * The other user-defined predicates associated with the given index.\n *\n * This includes predicates with operators other than:\n * - `match?`\n * - `eq?` and `not-eq?`\n * - `any-of?` and `not-any-of?`\n * - `is?` and `is-not?`\n * - `set!`\n */\n readonly predicates: QueryPredicate[][];\n\n /** The properties for predicates with the operator `set!`. */\n readonly setProperties: QueryProperties[];\n\n /** The properties for predicates with the operator `is?`. */\n readonly assertedProperties: QueryProperties[];\n\n /** The properties for predicates with the operator `is-not?`. */\n readonly refutedProperties: QueryProperties[];\n\n /** The maximum number of in-progress matches for this cursor. */\n matchLimit?: number;\n\n /**\n * Create a new query from a string containing one or more S-expression\n * patterns.\n *\n * The query is associated with a particular language, and can only be run\n * on syntax nodes parsed with that language. References to Queries can be\n * shared between multiple threads.\n *\n * @link {@see https://tree-sitter.github.io/tree-sitter/using-parsers/queries}\n */\n constructor(language: Language, source: string) {\n const sourceLength = C.lengthBytesUTF8(source);\n const sourceAddress = C._malloc(sourceLength + 1);\n C.stringToUTF8(source, sourceAddress, sourceLength + 1);\n const address = C._ts_query_new(\n language[0],\n sourceAddress,\n sourceLength,\n TRANSFER_BUFFER,\n TRANSFER_BUFFER + SIZE_OF_INT\n );\n\n if (!address) {\n const errorId = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, 'i32') as QueryErrorKind;\n const errorByte = C.getValue(TRANSFER_BUFFER, 'i32');\n const errorIndex = C.UTF8ToString(sourceAddress, errorByte).length;\n const suffix = source.slice(errorIndex, errorIndex + 100).split('\\n')[0];\n const word = suffix.match(QUERY_WORD_REGEX)?.[0] ?? '';\n C._free(sourceAddress);\n\n switch (errorId) {\n case QueryErrorKind.Syntax:\n throw new QueryError(QueryErrorKind.Syntax, { suffix: `${errorIndex}: '${suffix}'...` }, errorIndex, 0);\n case QueryErrorKind.NodeName:\n throw new QueryError(errorId, { word }, errorIndex, word.length);\n case QueryErrorKind.FieldName:\n throw new QueryError(errorId, { word }, errorIndex, word.length);\n case QueryErrorKind.CaptureName:\n throw new QueryError(errorId, { word }, errorIndex, word.length);\n case QueryErrorKind.PatternStructure:\n throw new QueryError(errorId, { suffix: `${errorIndex}: '${suffix}'...` }, errorIndex, 0);\n }\n }\n\n const stringCount = C._ts_query_string_count(address);\n const captureCount = C._ts_query_capture_count(address);\n const patternCount = C._ts_query_pattern_count(address);\n const captureNames = new Array<string>(captureCount);\n const captureQuantifiers = new Array<CaptureQuantifier[]>(patternCount);\n const stringValues = new Array<string>(stringCount);\n\n // Fill in the capture names\n for (let i = 0; i < captureCount; i++) {\n const nameAddress = C._ts_query_capture_name_for_id(\n address,\n i,\n TRANSFER_BUFFER\n );\n const nameLength = C.getValue(TRANSFER_BUFFER, 'i32');\n captureNames[i] = C.UTF8ToString(nameAddress, nameLength);\n }\n\n // Fill in the capture quantifiers\n for (let i = 0; i < patternCount; i++) {\n const captureQuantifiersArray = new Array<CaptureQuantifier>(captureCount);\n for (let j = 0; j < captureCount; j++) {\n const quantifier = C._ts_query_capture_quantifier_for_id(address, i, j);\n captureQuantifiersArray[j] = quantifier as CaptureQuantifier;\n }\n captureQuantifiers[i] = captureQuantifiersArray;\n }\n\n // Fill in the string values\n for (let i = 0; i < stringCount; i++) {\n const valueAddress = C._ts_query_string_value_for_id(\n address,\n i,\n TRANSFER_BUFFER\n );\n const nameLength = C.getValue(TRANSFER_BUFFER, 'i32');\n stringValues[i] = C.UTF8ToString(valueAddress, nameLength);\n }\n\n const setProperties = new Array<QueryProperties>(patternCount);\n const assertedProperties = new Array<QueryProperties>(patternCount);\n const refutedProperties = new Array<QueryProperties>(patternCount);\n const predicates = new Array<QueryPredicate[]>(patternCount);\n const textPredicates = new Array<TextPredicate[]>(patternCount);\n\n // Parse the predicates, and add the appropriate predicates or properties\n for (let i = 0; i < patternCount; i++) {\n const predicatesAddress = C._ts_query_predicates_for_pattern(address, i, TRANSFER_BUFFER);\n const stepCount = C.getValue(TRANSFER_BUFFER, 'i32');\n\n predicates[i] = [];\n textPredicates[i] = [];\n\n const steps = new Array<PredicateStep>();\n\n let stepAddress = predicatesAddress;\n for (let j = 0; j < stepCount; j++) {\n const stepType = C.getValue(stepAddress, 'i32');\n stepAddress += SIZE_OF_INT;\n\n const stepValueId = C.getValue(stepAddress, 'i32');\n stepAddress += SIZE_OF_INT;\n\n parsePattern(\n i,\n stepType,\n stepValueId,\n captureNames,\n stringValues,\n steps,\n textPredicates,\n predicates,\n setProperties,\n assertedProperties,\n refutedProperties,\n );\n }\n\n Object.freeze(textPredicates[i]);\n Object.freeze(predicates[i]);\n Object.freeze(setProperties[i]);\n Object.freeze(assertedProperties[i]);\n Object.freeze(refutedProperties[i]);\n }\n\n C._free(sourceAddress);\n\n\n this[0] = address;\n this.captureNames = captureNames;\n this.captureQuantifiers = captureQuantifiers;\n this.textPredicates = textPredicates;\n this.predicates = predicates;\n this.setProperties = setProperties;\n this.assertedProperties = assertedProperties;\n this.refutedProperties = refutedProperties;\n this.exceededMatchLimit = false;\n }\n\n /** Delete the query, freeing its resources. */\n delete(): void {\n C._ts_query_delete(this[0]);\n this[0] = 0;\n }\n\n /**\n * Iterate over all of the matches in the order that they were found.\n *\n * Each match contains the index of the pattern that matched, and a list of\n * captures. Because multiple patterns can match the same set of nodes,\n * one match may contain captures that appear *before* some of the\n * captures from a previous match.\n *\n * @param {Node} node - The node to execute the query on.\n *\n * @param {QueryOptions} options - Options for query execution.\n */\n matches(\n node: Node,\n options: QueryOptions = {}\n ): QueryMatch[] {\n const startPosition = options.startPosition ?? ZERO_POINT;\n const endPosition = options.endPosition ?? ZERO_POINT;\n const startIndex = options.startIndex ?? 0;\n const endIndex = options.endIndex ?? 0;\n const startContainingPosition = options.startContainingPosition ?? ZERO_POINT;\n const endContainingPosition = options.endContainingPosition ?? ZERO_POINT;\n const startContainingIndex = options.startContainingIndex ?? 0;\n const endContainingIndex = options.endContainingIndex ?? 0;\n const matchLimit = options.matchLimit ?? 0xFFFFFFFF;\n const maxStartDepth = options.maxStartDepth ?? 0xFFFFFFFF;\n const progressCallback = options.progressCallback;\n\n if (typeof matchLimit !== 'number') {\n throw new Error('Arguments must be numbers');\n }\n this.matchLimit = matchLimit;\n\n if (endIndex !== 0 && startIndex > endIndex) {\n throw new Error('`startIndex` cannot be greater than `endIndex`');\n }\n\n if (endPosition !== ZERO_POINT && (\n startPosition.row > endPosition.row ||\n (startPosition.row === endPosition.row && startPosition.column > endPosition.column)\n )) {\n throw new Error('`startPosition` cannot be greater than `endPosition`');\n }\n\n if (endContainingIndex !== 0 && startContainingIndex > endContainingIndex) {\n throw new Error('`startContainingIndex` cannot be greater than `endContainingIndex`');\n }\n\n if (endContainingPosition !== ZERO_POINT && (\n startContainingPosition.row > endContainingPosition.row ||\n (startContainingPosition.row === endContainingPosition.row &&\n startContainingPosition.column > endContainingPosition.column)\n )) {\n throw new Error('`startContainingPosition` cannot be greater than `endContainingPosition`');\n }\n\n if (progressCallback) {\n C.currentQueryProgressCallback = progressCallback;\n }\n\n marshalNode(node);\n\n C._ts_query_matches_wasm(\n this[0],\n node.tree[0],\n startPosition.row,\n startPosition.column,\n endPosition.row,\n endPosition.column,\n startIndex,\n endIndex,\n startContainingPosition.row,\n startContainingPosition.column,\n endContainingPosition.row,\n endContainingPosition.column,\n startContainingIndex,\n endContainingIndex,\n matchLimit,\n maxStartDepth,\n );\n\n const rawCount = C.getValue(TRANSFER_BUFFER, 'i32');\n const startAddress = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, 'i32');\n const didExceedMatchLimit = C.getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, 'i32');\n const result = new Array<QueryMatch>(rawCount);\n this.exceededMatchLimit = Boolean(didExceedMatchLimit);\n\n let filteredCount = 0;\n let address = startAddress;\n for (let i = 0; i < rawCount; i++) {\n const patternIndex = C.getValue(address, 'i32');\n address += SIZE_OF_INT;\n const captureCount = C.getValue(address, 'i32');\n address += SIZE_OF_INT;\n\n const captures = new Array<QueryCapture>(captureCount);\n address = unmarshalCaptures(this, node.tree, address, patternIndex, captures);\n\n if (this.textPredicates[patternIndex].every((p) => p(captures))) {\n result[filteredCount] = { patternIndex, captures };\n const setProperties = this.setProperties[patternIndex];\n result[filteredCount].setProperties = setProperties;\n const assertedProperties = this.assertedProperties[patternIndex];\n result[filteredCount].assertedProperties = assertedProperties;\n const refutedProperties = this.refutedProperties[patternIndex];\n result[filteredCount].refutedProperties = refutedProperties;\n filteredCount++;\n }\n }\n result.length = filteredCount;\n\n C._free(startAddress);\n C.currentQueryProgressCallback = null;\n return result;\n }\n\n /**\n * Iterate over all of the individual captures in the order that they\n * appear.\n *\n * This is useful if you don't care about which pattern matched, and just\n * want a single, ordered sequence of captures.\n *\n * @param {Node} node - The node to execute the query on.\n *\n * @param {QueryOptions} options - Options for query execution.\n */\n captures(\n node: Node,\n options: QueryOptions = {}\n ): QueryCapture[] {\n const startPosition = options.startPosition ?? ZERO_POINT;\n const endPosition = options.endPosition ?? ZERO_POINT;\n const startIndex = options.startIndex ?? 0;\n const endIndex = options.endIndex ?? 0;\n const startContainingPosition = options.startContainingPosition ?? ZERO_POINT;\n const endContainingPosition = options.endContainingPosition ?? ZERO_POINT;\n const startContainingIndex = options.startContainingIndex ?? 0;\n const endContainingIndex = options.endContainingIndex ?? 0;\n const matchLimit = options.matchLimit ?? 0xFFFFFFFF;\n const maxStartDepth = options.maxStartDepth ?? 0xFFFFFFFF;\n const progressCallback = options.progressCallback;\n\n if (typeof matchLimit !== 'number') {\n throw new Error('Arguments must be numbers');\n }\n this.matchLimit = matchLimit;\n\n if (endIndex !== 0 && startIndex > endIndex) {\n throw new Error('`startIndex` cannot be greater than `endIndex`');\n }\n\n if (endPosition !== ZERO_POINT && (\n startPosition.row > endPosition.row ||\n (startPosition.row === endPosition.row && startPosition.column > endPosition.column)\n )) {\n throw new Error('`startPosition` cannot be greater than `endPosition`');\n }\n\n if (endContainingIndex !== 0 && startContainingIndex > endContainingIndex) {\n throw new Error('`startContainingIndex` cannot be greater than `endContainingIndex`');\n }\n\n if (endContainingPosition !== ZERO_POINT && (\n startContainingPosition.row > endContainingPosition.row ||\n (startContainingPosition.row === endContainingPosition.row &&\n startContainingPosition.column > endContainingPosition.column)\n )) {\n throw new Error('`startContainingPosition` cannot be greater than `endContainingPosition`');\n }\n\n if (progressCallback) {\n C.currentQueryProgressCallback = progressCallback;\n }\n\n marshalNode(node);\n\n C._ts_query_captures_wasm(\n this[0],\n node.tree[0],\n startPosition.row,\n startPosition.column,\n endPosition.row,\n endPosition.column,\n startIndex,\n endIndex,\n startContainingPosition.row,\n startContainingPosition.column,\n endContainingPosition.row,\n endContainingPosition.column,\n startContainingIndex,\n endContainingIndex,\n matchLimit,\n maxStartDepth,\n );\n\n const count = C.getValue(TRANSFER_BUFFER, 'i32');\n const startAddress = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, 'i32');\n const didExceedMatchLimit = C.getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, 'i32');\n const result = new Array<QueryCapture>();\n this.exceededMatchLimit = Boolean(didExceedMatchLimit);\n\n const captures = new Array<QueryCapture>();\n let address = startAddress;\n for (let i = 0; i < count; i++) {\n const patternIndex = C.getValue(address, 'i32');\n address += SIZE_OF_INT;\n const captureCount = C.getValue(address, 'i32');\n address += SIZE_OF_INT;\n const captureIndex = C.getValue(address, 'i32');\n address += SIZE_OF_INT;\n\n captures.length = captureCount;\n address = unmarshalCaptures(this, node.tree, address, patternIndex, captures);\n\n if (this.textPredicates[patternIndex].every(p => p(captures))) {\n const capture = captures[captureIndex];\n const setProperties = this.setProperties[patternIndex];\n capture.setProperties = setProperties;\n const assertedProperties = this.assertedProperties[patternIndex];\n capture.assertedProperties = assertedProperties;\n const refutedProperties = this.refutedProperties[patternIndex];\n capture.refutedProperties = refutedProperties;\n result.push(capture);\n }\n }\n\n C._free(startAddress);\n C.currentQueryProgressCallback = null;\n return result;\n }\n\n /** Get the predicates for a given pattern. */\n predicatesForPattern(patternIndex: number): QueryPredicate[] {\n return this.predicates[patternIndex];\n }\n\n /**\n * Disable a certain capture within a query.\n *\n * This prevents the capture from being returned in matches, and also\n * avoids any resource usage associated with recording the capture.\n */\n disableCapture(captureName: string): void {\n const captureNameLength = C.lengthBytesUTF8(captureName);\n const captureNameAddress = C._malloc(captureNameLength + 1);\n C.stringToUTF8(captureName, captureNameAddress, captureNameLength + 1);\n C._ts_query_disable_capture(this[0], captureNameAddress, captureNameLength);\n C._free(captureNameAddress);\n }\n\n /**\n * Disable a certain pattern within a query.\n *\n * This prevents the pattern from matching, and also avoids any resource\n * usage associated with the pattern. This throws an error if the pattern\n * index is out of bounds.\n */\n disablePattern(patternIndex: number): void {\n if (patternIndex >= this.predicates.length) {\n throw new Error(\n `Pattern index is ${patternIndex} but the pattern count is ${this.predicates.length}`\n );\n }\n C._ts_query_disable_pattern(this[0], patternIndex);\n }\n\n /**\n * Check if, on its last execution, this cursor exceeded its maximum number\n * of in-progress matches.\n */\n didExceedMatchLimit(): boolean {\n return this.exceededMatchLimit;\n }\n\n /** Get the byte offset where the given pattern starts in the query's source. */\n startIndexForPattern(patternIndex: number): number {\n if (patternIndex >= this.predicates.length) {\n throw new Error(\n `Pattern index is ${patternIndex} but the pattern count is ${this.predicates.length}`\n );\n }\n return C._ts_query_start_byte_for_pattern(this[0], patternIndex);\n }\n\n /** Get the byte offset where the given pattern ends in the query's source. */\n endIndexForPattern(patternIndex: number): number {\n if (patternIndex >= this.predicates.length) {\n throw new Error(\n `Pattern index is ${patternIndex} but the pattern count is ${this.predicates.length}`\n );\n }\n return C._ts_query_end_byte_for_pattern(this[0], patternIndex);\n }\n\n /** Get the number of patterns in the query. */\n patternCount(): number {\n return C._ts_query_pattern_count(this[0]);\n }\n\n /** Get the index for a given capture name. */\n captureIndexForName(captureName: string): number {\n return this.captureNames.indexOf(captureName);\n }\n\n /** Check if a given pattern within a query has a single root node. */\n isPatternRooted(patternIndex: number): boolean {\n return C._ts_query_is_pattern_rooted(this[0], patternIndex) === 1;\n }\n\n /** Check if a given pattern within a query has a single root node. */\n isPatternNonLocal(patternIndex: number): boolean {\n return C._ts_query_is_pattern_non_local(this[0], patternIndex) === 1;\n }\n\n /**\n * Check if a given step in a query is 'definite'.\n *\n * A query step is 'definite' if its parent pattern will be guaranteed to\n * match successfully once it reaches the step.\n */\n isPatternGuaranteedAtStep(byteIndex: number): boolean {\n return C._ts_query_is_pattern_guaranteed_at_step(this[0], byteIndex) === 1;\n }\n}\n", "import type { Completion } from \"@codemirror/autocomplete\";\nimport { snippetCompletion } from \"@codemirror/autocomplete\";\n\nimport { todayAsString } from \"../format.ts\";\n\nexport const beancount_snippets: () => readonly Completion[] = () => {\n const today = todayAsString();\n return [\n snippetCompletion(\n `${today} #{*} \"#{}\" \"#{}\"\\n #{Account:A} #{Amount}\\n #{Account:B}`,\n {\n label: `${today} * transaction`,\n },\n ),\n ];\n};\n", "import type {\n Completion,\n CompletionResult,\n CompletionSource,\n} from \"@codemirror/autocomplete\";\nimport { syntaxTree } from \"@codemirror/language\";\nimport { get as store_get } from \"svelte/store\";\n\nimport { accounts, currencies, links, payees, tags } from \"../stores/index.ts\";\nimport { beancount_snippets } from \"./beancount-snippets.ts\";\n\nconst undated_directives = [\"option\", \"plugin\", \"include\"];\nconst dated_directives = [\n \"*\",\n \"open\",\n \"close\",\n \"custom\",\n \"commodity\",\n \"balance\",\n \"pad\",\n \"note\",\n \"document\",\n \"price\",\n \"event\",\n \"query\",\n];\n\n/** Get Completion objects from strings. */\nconst opts = (s: readonly string[]): Completion[] =>\n s.map((label) => ({ label }));\n\n/** Generate completion result list for codemirror from strings. */\nconst res = (s: readonly string[], from: number): CompletionResult => ({\n options: opts(s),\n from,\n});\n\nexport const beancount_completion: CompletionSource = (context) => {\n const tag = context.matchBefore(/#[A-Za-z0-9\\-_/.]*/);\n if (tag) {\n return {\n options: opts(store_get(tags)),\n from: tag.from + 1,\n validFor: /\\S+/,\n };\n }\n\n const link = context.matchBefore(/\\^[A-Za-z0-9\\-_/.]*/);\n if (link) {\n return {\n options: opts(store_get(links)),\n from: link.from + 1,\n validFor: /\\S+/,\n };\n }\n\n const indented = context.matchBefore(/^\\s+\\S+/);\n if (indented) {\n const indentation = indented.text.length - indented.text.trimStart().length;\n return {\n options: opts(store_get(accounts)),\n from: indented.from + indentation,\n validFor: /\\S+/,\n };\n }\n\n const line = context.state.doc.lineAt(context.pos);\n if (context.matchBefore(/\\d+/)) {\n return { options: beancount_snippets(), from: line.from };\n }\n\n const currentWord = context.matchBefore(/\\S*/);\n if (currentWord?.from === line.from && line.length > 0) {\n return {\n options: opts(undated_directives),\n from: line.from,\n validFor: /\\S+/,\n };\n }\n\n const tree = syntaxTree(context.state);\n const before = tree.resolve(context.pos, -1);\n // Node types of the last 4 nodes.\n const nodeTypesBefore = [\n before.name,\n before.prevSibling?.name,\n before.prevSibling?.prevSibling?.name,\n before.prevSibling?.prevSibling?.prevSibling?.name,\n ];\n type T = string | string[];\n // Check whether the previous nodes (up to 4) match the given types.\n const match = (...types: [T] | [T, T] | [T, T, T] | [T, T, T, T]): boolean =>\n types.every((t, i) => {\n const nodeType = nodeTypesBefore[i];\n return typeof t === \"string\"\n ? nodeType === t\n : t.some((n) => nodeType === n);\n });\n\n // complete payee after transaction flag.\n if (match(\"string\", \"flag\")) {\n return res(store_get(payees), before.from + 1);\n }\n\n // complete directive names after a date.\n if (match(\"keyword\", \"date\")) {\n return res(dated_directives, before.from);\n }\n\n if (\n // account directly after one of these directives:\n match(\n [\"ERROR\", \"account\"],\n [\"BALANCE\", \"CLOSE\", \"OPEN\", \"PAD\", \"NOTE\", \"DOCUMENT\"],\n \"date\",\n ) ||\n // padding account\n match([\"ERROR\", \"account\"], \"account\", \"PAD\", \"date\")\n ) {\n return res(store_get(accounts), before.from);\n }\n\n if (\n // complete currencies after a number.\n match(\"ERROR\", \"number\") ||\n // account currency\n match([\"ERROR\", \"currency\"], \"account\", \"OPEN\", \"date\") ||\n // price or commodity currency\n match([\"ERROR\", \"currency\"], [\"COMMODITY\", \"PRICE\"], \"date\")\n ) {\n return res(store_get(currencies), before.from);\n }\n\n return null;\n};\n", "import { foldService } from \"@codemirror/language\";\n\nconst MAXDEPTH = 100;\n\nfunction headerLevel(line: string): number {\n const match = /^\\*+/.exec(line);\n return match?.[0]?.length ?? MAXDEPTH;\n}\n\nexport const beancount_fold = foldService.of(({ doc }, lineStart, lineEnd) => {\n const startLine = doc.lineAt(lineStart);\n const totalLines = doc.lines;\n const level = headerLevel(startLine.text);\n if (level === MAXDEPTH) {\n return null;\n }\n let lineNo = startLine.number;\n let end = startLine.to;\n while (lineNo < totalLines) {\n lineNo += 1;\n const line = doc.line(lineNo);\n if (headerLevel(line.text) <= level) {\n break;\n }\n end = line.to;\n }\n return { from: lineEnd, to: end };\n});\n", "import type { Command } from \"@codemirror/view\";\n\nimport { put_format_source } from \"../api/index.ts\";\nimport { notify_err } from \"../notifications.ts\";\nimport { replace_contents } from \"./editor-transactions.ts\";\n\nexport const beancount_format: Command = (cm) => {\n put_format_source({ source: cm.state.sliceDoc() }).then(\n (data) => {\n cm.dispatch(replace_contents(cm.state, data));\n },\n (error: unknown) => {\n notify_err(error, (err) => `Formatting source failed: ${err.message}`);\n },\n );\n return true;\n};\n", "import { indentService } from \"@codemirror/language\";\n\nexport const beancount_indent = indentService.of((context, pos) => {\n const textAfterPos = context.textAfterPos(pos);\n if (/^\\s*\\d\\d\\d\\d/.exec(textAfterPos)) {\n // Lines starting with a date should not be indented.\n return 0;\n }\n const line = context.state.doc.lineAt(pos);\n if (/^\\s+\\S+/.exec(line.text) ?? /^\\d\\d\\d\\d/.exec(line.text)) {\n // The previous (or this one?) line was indented.\n return context.unit;\n }\n return 0;\n});\n", "/**\n * Use a tree-sitter parser to generate Lezer parse tree.s\n *\n * To be able to reuse the existing tree-sitter grammar and parser for the Fava editor,\n * this module provides functionality to translate between a tree-sitter parse tree and\n * a Lezer one.\n */\n\nimport { DocInput } from \"@codemirror/language\";\nimport type { Text } from \"@codemirror/state\";\nimport type {\n Input,\n NodePropSource,\n PartialParse,\n TreeFragment,\n} from \"@lezer/common\";\nimport { NodeProp, NodeType, Parser, Tree } from \"@lezer/common\";\nimport { styleTags, tags } from \"@lezer/highlight\";\nimport type {\n Parser as TSParser,\n Tree as TSTree,\n TreeCursor as TSTreeCursor,\n} from \"web-tree-sitter\";\nimport { Edit as TSEdit } from \"web-tree-sitter\";\n\nimport type { NonEmptyArray } from \"../lib/array.ts\";\nimport { is_non_empty, last_element } from \"../lib/array.ts\";\nimport { assert, log_error } from \"../log.ts\";\n\n/** The Lezer NodeType for error nodes. */\nconst error = NodeType.define({\n id: 65535,\n name: \"ERROR\",\n error: true,\n props: [styleTags({ ERROR: tags.invalid })],\n});\n\n// Since we need to pass points (row, column) to some tree-sitter APIs but\n// we usually do not have this information, pass this dummy point. Should work\n// as long as we do not use any of the APIs returning points:\n// https://github.com/tree-sitter/tree-sitter/issues/445\nconst dummyPosition = Object.freeze({ row: 0, column: 0 });\n\n/** Get a TS edit for the three byte offsets with dummy row/column-offsets. */\nfunction ts_edit(\n startIndex: number,\n oldEndIndex: number,\n newEndIndex: number,\n): TSEdit {\n return new TSEdit({\n startIndex,\n oldEndIndex,\n newEndIndex,\n startPosition: dummyPosition,\n oldEndPosition: dummyPosition,\n newEndPosition: dummyPosition,\n });\n}\n\n/** This node prop is used to store the TS tree on the root node of the Lezer tree for reuse. */\nconst TS_TREE_PROP = new NodeProp<TSTree>({ perNode: true });\n\nclass TSParserError extends Error {}\n\nclass InvalidRangeError extends TSParserError {\n constructor() {\n super(\"Only one range spanning the whole document is supported.\");\n }\n}\n\nclass MissingLanguageError extends TSParserError {\n constructor() {\n super(\"Parser is missing language.\");\n }\n}\n\n/** Information about a change between an old parse and a new one. */\ninterface ChangeDetails {\n /** The edit (to simplify things, we reduce it to a single change) */\n edit: TSEdit;\n /** The old Lezer syntax tree (not adjusted for edit). */\n old_tree: Tree;\n /** The TS tree, adjusted for the edit - is used to extend the edit for safe reuse of the Lezer tree. */\n edited_old_ts_tree: TSTree;\n}\n\n/** Deduce a TSParser.Edit from the given Lezer TreeFragments. */\nexport function input_edit_for_fragments(\n fragments: NonEmptyArray<TreeFragment>,\n input_length: number,\n): TSEdit | null {\n const [fragment] = fragments;\n const { tree } = fragment;\n\n if (!fragments.every((f) => f.tree === tree)) {\n log_error(\"expect fragments to all have the same tree\", fragments);\n return null;\n }\n\n if (fragments.length === 1) {\n return fragment.offset === 0\n ? ts_edit(fragment.to - 1, tree.length, input_length)\n : ts_edit(0, fragment.from + fragment.offset + 1, fragment.from + 1);\n }\n\n const before =\n [...fragments].reverse().find((f) => !f.openStart && f.openEnd) ?? fragment;\n const after =\n fragments.find((f) => f.openStart && !f.openEnd) ?? last_element(fragments);\n\n const from = before.to;\n const { offset } = after;\n const newEndIndex = after.from;\n const oldEndIndex = newEndIndex + offset;\n\n return ts_edit(from - 1, oldEndIndex + 1, newEndIndex + 1);\n}\n\n/**\n * A parse can to be started for the same document multiple times.\n *\n * Since we only do full parses, we can reuse these trees here.\n */\nconst PARSE_CACHE = new WeakMap<Text, Tree>();\n\n/**\n * This does not support any partial parsing since tree-sitter does not either.\n *\n * It tries to reuse any existing trees (as passed indirectly via fragments) to\n * allow for a faster incremental parse.\n */\nclass Parse implements PartialParse {\n readonly ts_parser: TSParser;\n readonly node_types: NodeType[];\n readonly input: Input;\n readonly fragments: readonly TreeFragment[];\n readonly ranges: readonly { from: number; to: number }[];\n stoppedAt: number | null = null;\n parsedPos = 0;\n\n constructor(\n ts_parser: TSParser,\n node_types: NodeType[],\n input: Input,\n fragments: readonly TreeFragment[],\n ranges: readonly { from: number; to: number }[],\n ) {\n this.ts_parser = ts_parser;\n this.node_types = node_types;\n this.input = input;\n this.fragments = fragments;\n this.ranges = ranges;\n if (\n ranges.length !== 1 ||\n ranges[0]?.from !== 0 ||\n ranges[0].to !== input.length\n ) {\n throw new InvalidRangeError();\n }\n }\n\n /** Walk over the given node and its children, recursively creating Trees. */\n private get_tree_for_ts_cursor(ts_cursor: TSTreeCursor): Tree {\n const { nodeTypeId, startIndex, endIndex } = ts_cursor;\n const node_type = this.node_types[nodeTypeId] ?? error;\n const children: Tree[] = [];\n const positions: number[] = [];\n\n if (ts_cursor.gotoFirstChild()) {\n do {\n positions.push(ts_cursor.startIndex - startIndex);\n children.push(this.get_tree_for_ts_cursor(ts_cursor));\n } while (ts_cursor.gotoNextSibling());\n ts_cursor.gotoParent();\n }\n\n return new Tree(node_type, children, positions, endIndex - startIndex);\n }\n\n /**\n * Walk over the given node and its children, recursively creating Trees.\n *\n * Tries to reuse parts of an old tree.\n */\n private get_tree_for_ts_cursor_reuse(\n ts_cursor: TSTreeCursor,\n edit: TSEdit,\n old_tree: Tree,\n ): Tree {\n const { nodeTypeId, startIndex, endIndex } = ts_cursor;\n const node_type = this.node_types[nodeTypeId] ?? error;\n const children: Tree[] = [];\n const positions: number[] = [];\n\n if (ts_cursor.gotoFirstChild()) {\n let ended = false;\n const old_children = old_tree.children;\n\n // First, we add all children that end before the edit.\n let child_index = 0;\n while (!ended && ts_cursor.endIndex < edit.startIndex) {\n positions.push(ts_cursor.startIndex - startIndex);\n children.push(old_children[child_index] as Tree);\n child_index += 1;\n ended = !ts_cursor.gotoNextSibling();\n }\n\n // If there is a node that completely covers the edit, we want to pass\n // the old tree for the node down so that parts can be reused.\n if (\n ts_cursor.startIndex < edit.startIndex &&\n edit.newEndIndex < ts_cursor.endIndex\n ) {\n const old_child = old_children[child_index] as Tree | undefined;\n if (old_child) {\n positions.push(ts_cursor.startIndex - startIndex);\n children.push(\n this.get_tree_for_ts_cursor_reuse(ts_cursor, edit, old_child),\n );\n ended = !ts_cursor.gotoNextSibling();\n }\n }\n\n // Now/alternatively, we add all children contained in/touching the edit.\n while (!ended && ts_cursor.startIndex < edit.newEndIndex) {\n positions.push(ts_cursor.startIndex - startIndex);\n children.push(this.get_tree_for_ts_cursor(ts_cursor));\n ended = !ts_cursor.gotoNextSibling();\n }\n\n // Finally, we add the children after the edit.\n // We first count them and add their positions and push the trees after that.\n let children_after_edit = 0;\n while (!ended) {\n positions.push(ts_cursor.startIndex - startIndex);\n children_after_edit += 1;\n ended = !ts_cursor.gotoNextSibling();\n }\n if (children_after_edit > 0) {\n children.push(...(old_children.slice(-children_after_edit) as Tree[]));\n }\n ts_cursor.gotoParent();\n }\n\n return new Tree(node_type, children, positions, endIndex - startIndex);\n }\n\n /** Convert the tree-sitter Tree to a Lezer tree, possibly reusing parts of an old one. */\n private convert_tree(\n ts_tree: TSTree,\n change: Pick<ChangeDetails, \"edit\" | \"old_tree\"> | null,\n ): Tree {\n const ts_tree_cursor = ts_tree.rootNode.walk();\n const tree = change\n ? this.get_tree_for_ts_cursor_reuse(\n ts_tree_cursor,\n change.edit,\n change.old_tree,\n )\n : this.get_tree_for_ts_cursor(ts_tree_cursor);\n const tree_with_ts_tree_prop = new Tree(\n tree.type,\n tree.children,\n tree.positions,\n tree.length,\n [[TS_TREE_PROP, ts_tree]],\n );\n return tree_with_ts_tree_prop;\n }\n\n /** Gather information about the changes from a previous parse. */\n private static change_details(\n fragments: readonly TreeFragment[],\n input_length: number,\n ): ChangeDetails | null {\n if (!is_non_empty(fragments)) {\n return null;\n }\n const edit = input_edit_for_fragments(fragments, input_length);\n const old_tree = fragments[0].tree;\n const edited_old_ts_tree = old_tree.prop(TS_TREE_PROP)?.copy();\n\n if (edit) {\n if (!edited_old_ts_tree) {\n log_error(\"expected old tree when there is an edit\");\n return null;\n }\n assert(\n input_length - old_tree.length === edit.newEndIndex - edit.oldEndIndex,\n \"expect offset to match change in text length\",\n );\n edited_old_ts_tree.edit(edit);\n assert(\n edited_old_ts_tree.rootNode.endIndex === input_length,\n \"expect edited old tree to match text length\",\n );\n return { edit, old_tree, edited_old_ts_tree };\n }\n\n return null;\n }\n\n /**\n * Extend the changed range using the TS getChangedRanges function.\n *\n * Outside this extended range, nodes from the old tree can be reused since they\n * will have the exact same stack of containing nodes (possibly offset after the edit).\n */\n private static extend_change(\n change: ChangeDetails,\n ts_tree: TSTree,\n ): Pick<ChangeDetails, \"edit\" | \"old_tree\"> | null {\n const { edit, edited_old_ts_tree } = change;\n const changed_ranges = edited_old_ts_tree.getChangedRanges(ts_tree);\n if (!is_non_empty(changed_ranges)) {\n return change;\n }\n const newEndIndex = Math.max(\n edit.newEndIndex,\n last_element(changed_ranges).endIndex,\n );\n const extended_edit = ts_edit(\n Math.min(edit.startIndex, changed_ranges[0].startIndex),\n newEndIndex + (edit.oldEndIndex - edit.newEndIndex),\n newEndIndex,\n );\n return {\n edit: extended_edit,\n old_tree: change.old_tree,\n };\n }\n\n advance(): Tree | null {\n const { fragments, input, stoppedAt, ts_parser } = this;\n const text = input.read(0, stoppedAt ?? input.length);\n const input_length = text.length;\n\n const cm_text = input instanceof DocInput ? input.doc : null;\n if (cm_text) {\n const cached = PARSE_CACHE.get(cm_text);\n if (cached) {\n return cached;\n }\n }\n\n const change = Parse.change_details(fragments, input_length);\n let ts_tree = ts_parser.parse(text, change?.edited_old_ts_tree);\n if (ts_tree?.rootNode.endIndex !== input_length) {\n log_error(\n \"Mismatch between tree (%s) and document (%s) lengths; reparsing\",\n ts_tree?.rootNode.endIndex,\n input_length,\n );\n ts_tree = ts_parser.parse(text);\n }\n if (ts_tree == null) {\n return null;\n }\n const extended_change = change\n ? Parse.extend_change(change, ts_tree)\n : null;\n\n // Convert the Lezer tree to a tree-sitter tree.\n const tree = this.convert_tree(ts_tree, extended_change);\n this.parsedPos = input_length;\n if (cm_text) {\n PARSE_CACHE.set(cm_text, tree);\n }\n\n return tree;\n }\n\n stopAt(pos: number): void {\n this.stoppedAt = pos;\n }\n}\n\n/**\n * A parser using a tree-sitter parser to create Lezer trees.\n *\n * @param ts_parser - The tree-sitter parser (with a language loaded) to use.\n * @param props - Node props to assign to the node types.\n * @param top_node - The name of the node type that is the top node in the TS grammar.\n */\nexport class LezerTSParser extends Parser {\n /** The Lezer NodeTypes - all node types from the TS grammar with props assigned. */\n private node_types: NodeType[];\n readonly ts_parser: TSParser;\n\n constructor(ts_parser: TSParser, props: NodePropSource[], top_node: string) {\n super();\n this.ts_parser = ts_parser;\n\n const { language } = ts_parser;\n if (language == null) {\n throw new MissingLanguageError();\n }\n this.node_types = language.types.map((name, id) =>\n NodeType.define({ id, name, props, top: name === top_node }),\n );\n }\n\n createParse(\n input: Input,\n fragments: readonly TreeFragment[],\n ranges: readonly { from: number; to: number }[],\n ): PartialParse {\n return new Parse(this.ts_parser, this.node_types, input, fragments, ranges);\n }\n}\n", "import {\n defineLanguageFacet,\n Language,\n languageDataProp,\n LanguageSupport,\n syntaxHighlighting,\n} from \"@codemirror/language\";\nimport { highlightTrailingWhitespace, keymap } from \"@codemirror/view\";\nimport { styleTags, tags } from \"@lezer/highlight\";\nimport { Language as TSLanguage, Parser as TSParser } from \"web-tree-sitter\";\nimport ts_wasm from \"web-tree-sitter/web-tree-sitter.wasm\";\n\nimport { beancount_completion } from \"./beancount-autocomplete.ts\";\nimport { beancount_fold } from \"./beancount-fold.ts\";\nimport { beancount_format } from \"./beancount-format.ts\";\nimport { beancount_highlight } from \"./beancount-highlight.ts\";\nimport { beancount_indent } from \"./beancount-indent.ts\";\n// WASM build of tree-sitter grammar from https://github.com/yagebu/tree-sitter-beancount\nimport ts_beancount_wasm from \"./tree-sitter-beancount.wasm\";\nimport { LezerTSParser } from \"./tree-sitter-parser.ts\";\n\n/** Import the tree-sitter and Beancount language WASM files and initialise the parser. */\nasync function load_beancount_parser(): Promise<TSParser> {\n const ts = import.meta.resolve(ts_wasm);\n const ts_beancount = import.meta.resolve(ts_beancount_wasm);\n await TSParser.init({ locateFile: () => ts });\n const lang = await TSLanguage.load(ts_beancount);\n const parser = new TSParser();\n parser.setLanguage(lang);\n return parser;\n}\n\nconst beancount_language_facet = defineLanguageFacet();\nconst beancount_language_support_extensions = [\n beancount_fold,\n syntaxHighlighting(beancount_highlight),\n beancount_indent,\n keymap.of([{ key: \"Control-d\", mac: \"Meta-d\", run: beancount_format }]),\n beancount_language_facet.of({\n autocomplete: beancount_completion,\n commentTokens: { line: \";\" },\n indentOnInput: /^\\s+\\d\\d\\d\\d/,\n }),\n highlightTrailingWhitespace(),\n];\n\n/** The node props that allow for highlighting/coloring of the code. */\nconst props = [\n styleTags({\n account: tags.className,\n currency: tags.unit,\n date: tags.special(tags.number),\n string: tags.string,\n \"BALANCE CLOSE COMMODITY CUSTOM DOCUMENT EVENT NOTE OPEN PAD PRICE TRANSACTION QUERY\":\n tags.keyword,\n \"tag link\": tags.labelName,\n number: tags.number,\n key: tags.propertyName,\n bool: tags.bool,\n \"PUSHTAG POPTAG PUSHMETA POPMETA OPTION PLUGIN INCLUDE\": tags.standard(\n tags.string,\n ),\n }),\n languageDataProp.add((type) =>\n type.isTop ? beancount_language_facet : undefined,\n ),\n];\n\nconst ts_parser = await load_beancount_parser();\n\nexport const beancount_language_support = new LanguageSupport(\n new Language(\n beancount_language_facet,\n new LezerTSParser(ts_parser, props, \"beancount_file\"),\n [],\n \"beancount\",\n ),\n beancount_language_support_extensions,\n);\n", "import type { ViewUpdate } from \"@codemirror/view\";\nimport { ViewPlugin } from \"@codemirror/view\";\n\n/**\n * This CodeMirror view plugin creates a ruler at (before) the given column.\n */\nexport const ruler_plugin = (\n column: number,\n): ViewPlugin<{\n update(update: ViewUpdate): void;\n destroy(): void;\n}> =>\n ViewPlugin.define((view) => {\n const ruler = view.dom.appendChild(document.createElement(\"div\"));\n ruler.style.position = \"absolute\";\n ruler.style.borderRight = \"1px dotted black\";\n ruler.style.height = \"100%\";\n ruler.style.opacity = \"0.5\";\n ruler.style.pointerEvents = \"none\";\n\n const updatePosition = () => {\n const firstLine = view.contentDOM.querySelector(\".cm-line\");\n if (firstLine) {\n const { paddingLeft } = getComputedStyle(firstLine);\n const domRect = view.dom.getBoundingClientRect();\n const contentDOMRect = view.contentDOM.getBoundingClientRect();\n // We need to add the width of the gutter (line numbers etc.) since\n // our ruler is positioned absolutely within the whole editor.\n const gutterWidth = contentDOMRect.x - domRect.x;\n const offset = column * view.defaultCharacterWidth + gutterWidth;\n ruler.style.width = paddingLeft;\n ruler.style.left = `${offset.toString()}px`;\n }\n };\n\n view.requestMeasure({ read: updatePosition });\n\n return {\n update(update) {\n if (update.viewportChanged || update.geometryChanged) {\n view.requestMeasure({ read: updatePosition });\n }\n },\n\n destroy() {\n ruler.remove();\n },\n };\n });\n", "import {\n defaultHighlightStyle,\n indentUnit,\n syntaxHighlighting,\n} from \"@codemirror/language\";\nimport { EditorState } from \"@codemirror/state\";\nimport type { KeyBinding } from \"@codemirror/view\";\nimport { EditorView, keymap } from \"@codemirror/view\";\n\nimport { base_extensions } from \"./base-extensions.ts\";\nimport { beancount_highlight } from \"./beancount-highlight.ts\";\nimport { beancount_language_support } from \"./beancount-language.ts\";\nimport { ruler_plugin } from \"./ruler.ts\";\n\nexport { beancount_format } from \"./beancount-format.ts\";\nexport {\n replace_contents,\n scroll_to_line,\n set_errors,\n} from \"./editor-transactions.ts\";\nexport { toggleComment } from \"@codemirror/commands\";\nexport { foldAll, unfoldAll } from \"@codemirror/language\";\n\nexport function init_textarea(el: HTMLTextAreaElement): void {\n const editor = new EditorView({\n doc: el.value,\n extensions: [\n beancount_language_support,\n syntaxHighlighting(defaultHighlightStyle),\n EditorState.readOnly.of(true),\n ],\n });\n el.parentNode?.insertBefore(editor.dom, el);\n el.style.display = \"none\";\n}\n\n/**\n * A Beancount editor.\n */\nexport function init_beancount_editor(\n value: string,\n onDocChanges: (s: EditorState) => void,\n commands: KeyBinding[],\n $indent: number,\n $currency_column: number,\n): EditorView {\n return new EditorView({\n doc: value,\n extensions: [\n beancount_language_support,\n indentUnit.of(\" \".repeat($indent)),\n ...($currency_column ? [ruler_plugin($currency_column - 1)] : []),\n keymap.of(commands),\n EditorView.updateListener.of((update) => {\n if (update.docChanged) {\n onDocChanges(update.state);\n }\n }),\n base_extensions,\n syntaxHighlighting(beancount_highlight),\n ],\n });\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAM,sBAAsB,eAAe,OAAO;AAAA,EACvD;AAAA;AAAA,IAEE,KAAKA,MAAK,QAAQA,MAAK,MAAM;AAAA,IAC7B,OAAO;AAAA,EACT;AAAA,EACA;AAAA;AAAA,IAEE,KAAKA,MAAK;AAAA,IACV,OAAO;AAAA,EACT;AAAA,EACA;AAAA;AAAA,IAEE,KAAKA,MAAK;AAAA,IACV,OAAO;AAAA,EACT;AAAA,EACA;AAAA;AAAA,IAEE,KAAKA,MAAK,QAAQA,MAAK,WAAW;AAAA,IAClC,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,cAAc;AAAA,IACd,YAAY;AAAA,EACd;AAAA,EACA;AAAA;AAAA,IAEE,KAAKA,MAAK;AAAA,IACV,OAAO;AAAA,EACT;AAAA,EACA;AAAA;AAAA,IAEE,KAAKA,MAAK;AAAA,IACV,YAAY;AAAA,IACZ,OAAO;AAAA,EACT;AAAA,EACA;AAAA;AAAA,IAEE,KAAKA,MAAK,SAASA,MAAK,MAAM;AAAA,IAC9B,OAAO;AAAA,EACT;AAAA,EACA;AAAA;AAAA,IAEE,KAAKA,MAAK;AAAA,IACV,OAAO;AAAA,EACT;AAAA,EACA;AAAA;AAAA,IAEE,KAAKA,MAAK;AAAA,IACV,OAAO;AAAA,EACT;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A,IACpB,KAAK;AAAA,IACL,YAAY;AAAA,MACV;AAAA,MACA,WAAW,GAAG,IAAI,OAAO,OAAO,CAAC;AAAA,MACjC,GAAI,mBAAmB,CAAC,aAAa,mBAAmB,CAAC,CAAC,IAAI,CAAC;AAAA,MAC/D,OAAO,GAAG,QAAQ;AAAA,MAClB,WAAW,eAAe,GAAG,CAAC,WAAW;AACvC,YAAI,OAAO,YAAY;AACrB,uBAAa,OAAO,KAAK;AAAA,QAC3B;AAAA,MACF,CAAC;AAAA,MACD;AAAA,MACA,mBAAmB,mBAAmB;AAAA,IACxC;AAAA,EACF,CAAC;AACH;",
6
+ "names": ["tags", "module", "Tree", "i", "start", "Language", "name", "binary", "fs", "body", "Module", "instance", "metadata", "result", "info", "count", "flags", "handle", "func", "err", "memoryBase", "args", "rtn", "res", "libName", "localScope", "wasmExports", "Parser", "i", "error", "err", "tags", "ts_parser", "props", "name", "web_tree_sitter_default", "Parser", "Language", "tags"]
7
+ }