@willbooster/web-tree-sitter 24.0.2 → 24.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["src/constants.ts", "src/finalization_registry.ts", "src/tree_cursor.ts", "src/tree.ts", "src/node.ts", "src/marshal.ts", "src/language.ts", "lib/web-tree-sitter.mjs", "src/bindings.ts", "src/parser.ts"],
4
- "sourcesContent": ["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_INT = 4;\n\n/** @internal */\nexport const SIZE_OF_NODE = 9 * 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 */\n// eslint-disable-next-line @typescript-eslint/no-invalid-void-type -- A callback may record progress without returning a cancellation decision.\nexport type ProgressCallback = (progress: ParseState) => boolean | void;\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", "export function newFinalizer<T>(handler: (value: T) => void): FinalizationRegistry<T> | undefined {\n try {\n return new FinalizationRegistry(handler);\n } catch(e) {\n console.error('Unsupported FinalizationRegistry:', e);\n return;\n }\n}\n", "import { INTERNAL, Internal, assertInternal, Point, C } from './constants';\nimport { marshalNode, unmarshalNode, unmarshalPoint } from './marshal';\nimport { Node } from './node';\nimport { TRANSFER_BUFFER } from './parser';\nimport { getCallbackText, Tree } from './tree';\nimport { newFinalizer } from './finalization_registry';\n\nconst finalizer = newFinalizer((address: number) => {\n C._ts_tree_cursor_delete_wasm(address);\n});\n\n/** A stateful object for walking a syntax {@link Tree} efficiently. */\nexport class TreeCursor {\n /** @internal */\n private [0] = 0; // Internal handle for Wasm\n\n /** @internal */\n private tree: Tree;\n\n /** @internal */\n private _nodeTypeId = 0;\n\n /** @internal */\n private _fieldId = 0;\n\n /** @internal */\n private _startIndex = 0;\n\n /** @internal */\n private _endIndex = 0;\n\n /** @internal */\n private _flags = 0;\n\n /** @internal */\n constructor(internal: Internal, tree: Tree, address: number) {\n assertInternal(internal);\n this[0] = address;\n this.tree = tree;\n this.readNodeCache();\n finalizer?.register(this, address, this);\n }\n\n /** Creates a deep copy of the tree cursor. This allocates new memory. */\n copy(): TreeCursor {\n const address = C._ts_tree_cursor_copy_wasm(this[0]);\n return new TreeCursor(INTERNAL, this.tree, address);\n }\n\n /** Delete the tree cursor, freeing its resources. */\n delete(): void {\n finalizer?.unregister(this);\n C._ts_tree_cursor_delete_wasm(this[0]);\n this[0] = 0;\n }\n\n /** Get the tree cursor's current {@link Node}. */\n get currentNode(): Node {\n C._ts_tree_cursor_current_node_wasm(this[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 return this._fieldId;\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._fieldId] ?? null;\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 return C._wb_ts_tree_cursor_current_depth(this[0]) >>> 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 return C._wb_ts_tree_cursor_current_descendant_index(this[0]) >>> 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 return this._nodeTypeId;\n }\n\n /** Get the id of the cursor's current node. */\n get nodeId(): number {\n return C._ts_tree_cursor_current_node_id_wasm(this[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 return (this._flags & 1) !== 0;\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 return (this._flags & 2) !== 0;\n }\n\n /** Get the string content of the cursor's current node. */\n get nodeText(): string {\n const { textSource } = this.tree;\n return typeof textSource === 'string'\n ? textSource.slice(this._startIndex, this._endIndex)\n : getCallbackText(textSource, this._startIndex, this._endIndex, this.startPosition);\n }\n\n /** Get the start position of the cursor's current node. */\n get startPosition(): Point {\n C._ts_tree_cursor_start_position_wasm(this[0]);\n return unmarshalPoint(TRANSFER_BUFFER);\n }\n\n /** Get the end position of the cursor's current node. */\n get endPosition(): Point {\n C._ts_tree_cursor_end_position_wasm(this[0]);\n return unmarshalPoint(TRANSFER_BUFFER);\n }\n\n /** Get the start index of the cursor's current node. */\n get startIndex(): number {\n return this._startIndex;\n }\n\n /** Get the end index of the cursor's current node. */\n get endIndex(): number {\n return this._endIndex;\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 if (!C._ts_tree_cursor_goto_first_child_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\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 if (!C._ts_tree_cursor_goto_last_child_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\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 if (!C._ts_tree_cursor_goto_parent_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\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 if (!C._ts_tree_cursor_goto_next_sibling_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\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 if (!C._ts_tree_cursor_goto_previous_sibling_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\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 C._ts_tree_cursor_goto_descendant_wasm(this[0], goalDescendantIndex);\n this.readNodeCache();\n }\n\n /**\n * Move this cursor to the first child of its current node that contains or\n * starts after the given index.\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 if (!C._ts_tree_cursor_goto_first_child_for_index_wasm(this[0], goalIndex)) return false;\n this.readNodeCache();\n return true;\n }\n\n /**\n * Move this cursor to the first child of its current node that contains or\n * starts after the given position.\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 gotoFirstChildForPosition(goalPosition: Point): boolean {\n if (\n !C._ts_tree_cursor_goto_first_child_for_position_wasm(\n this[0],\n goalPosition.row,\n goalPosition.column,\n )\n ) {\n return false;\n }\n this.readNodeCache();\n return true;\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 this.tree = node.tree;\n C._ts_tree_cursor_reset_wasm(this[0], node.tree[0]);\n this.readNodeCache();\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 if (this[0] === cursor[0]) return;\n this.tree = cursor.tree;\n C._ts_tree_cursor_reset_to_wasm(this[0], cursor[0]);\n this.readNodeCache();\n }\n\n /** @internal */\n private readNodeCache(): void {\n const base = TRANSFER_BUFFER >>> 2;\n const heap = C.HEAPU32;\n this._nodeTypeId = heap[base];\n this._fieldId = heap[base + 1];\n this._startIndex = heap[base + 2];\n this._endIndex = heap[base + 3];\n this._flags = heap[base + 4];\n }\n}\n", "import { INTERNAL, Internal, assertInternal, ParseCallback, Point, Range, SIZE_OF_NODE, SIZE_OF_INT, C } from './constants';\nimport { Language } from './language';\nimport { Node } from './node';\nimport { TreeCursor } from './tree_cursor';\nimport { marshalPoint, unmarshalNode, unmarshalRanges } from './marshal';\nimport { TRANSFER_BUFFER } from './parser';\nimport { newFinalizer } from './finalization_registry';\n\n/** @internal */\nexport function getCallbackText(\n textSource: ParseCallback,\n startIndex: number,\n endIndex: number,\n startPosition: Point,\n): string {\n const length = endIndex - startIndex;\n let result = textSource(startIndex, startPosition);\n if (result) {\n startIndex += result.length;\n while (startIndex < endIndex) {\n const string = textSource(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\nconst finalizer = newFinalizer((address: number) => {\n C._wb_ts_tree_delete(address);\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 textSource: string | 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, textSource: string | ParseCallback) {\n assertInternal(internal);\n this[0] = address;\n this.language = language;\n this.textSource = textSource;\n finalizer?.register(this, address, this);\n }\n\n /** Create a shallow copy of the syntax tree. This is very fast. */\n copy(): Tree {\n const address = C._wb_ts_tree_copy(this[0]);\n return new Tree(INTERNAL, address, this.language, this.textSource);\n }\n\n /** Delete the syntax tree, freeing its resources. */\n delete(): void {\n finalizer?.unregister(this);\n C._wb_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.HEAP32[address >>> 2] = offsetBytes;\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 /** Create a new {@link TreeCursor} starting from the root of the tree. */\n walk(): TreeCursor {\n C._ts_tree_root_node_wasm(this[0]);\n const address = C._ts_tree_cursor_new_wasm(this[0]);\n return new TreeCursor(INTERNAL, this, address);\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 return unmarshalRanges();\n }\n}\n", "import { INTERNAL, Internal, assertInternal, SIZE_OF_INT, SIZE_OF_NODE, SIZE_OF_POINT, ZERO_POINT, isPoint, C, Point } from './constants';\nimport { getCallbackText, Tree } from './tree';\nimport { TreeCursor } from './tree_cursor';\nimport { Language } from './language';\nimport { marshalNode, marshalPoint, unmarshalNode, unmarshalNodeArray } from './marshal';\nimport { TRANSFER_BUFFER } from './parser';\n\nconst EMPTY_SYMBOLS = new Uint32Array(0);\nconst symbolsByTypeCache = new WeakMap<Language, Map<string, Uint32Array>>();\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 _endIndex: number;\n\n /** @internal */\n private _endRow: number;\n\n /** @internal */\n private _endColumn: number;\n\n /** @internal */\n private _flags: number;\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 endIndex,\n endRow,\n endColumn,\n flags,\n }: {\n id: number;\n tree: Tree;\n startIndex: number;\n startPosition: Point;\n other: number;\n endIndex: number;\n endRow: number;\n endColumn: number;\n flags: 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 this._endIndex = endIndex;\n this._endRow = endRow;\n this._endColumn = endColumn;\n this._flags = flags;\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.\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 return this._flags & 0xffff;\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._flags & 0xffff] || '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 return (this._flags & 0x10000) !== 0;\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 return (this._flags & 0x20000) !== 0;\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 return (this._flags & 0x100000) !== 0;\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 return (this._flags & 0x40000) !== 0;\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 return (this._flags & 0x80000) !== 0;\n }\n\n /** Get the byte index where this node ends. */\n get endIndex(): number {\n return this._endIndex;\n }\n\n /** Get the position where this node ends. */\n get endPosition(): Point {\n return { row: this._endRow, column: this._endColumn };\n }\n\n /** Get the string content of this node. */\n get text(): string {\n const { textSource } = this.tree;\n return typeof textSource === 'string'\n ? textSource.slice(this.startIndex, this._endIndex)\n : getCallbackText(textSource, this.startIndex, this._endIndex, this.startPosition);\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 return unmarshalNodeArray(this.tree, true);\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.HEAP32[address >>> 2] = index;\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.HEAP32[address >>> 2] = index;\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 this._children = unmarshalNodeArray(this.tree);\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 this._namedChildren = unmarshalNodeArray(this.tree);\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 const symbols = symbolsForTypes(this.tree.language, types);\n if (symbols.length === 0) return [];\n\n const symbolsAddress = C._malloc(SIZE_OF_INT * symbols.length);\n C.HEAPU32.set(symbols, symbolsAddress >>> 2);\n\n marshalNode(this);\n const pointAddress = TRANSFER_BUFFER + SIZE_OF_NODE;\n marshalPoint(pointAddress, startPosition);\n marshalPoint(pointAddress + SIZE_OF_POINT, endPosition);\n C._ts_node_descendants_of_type_wasm(\n this.tree[0],\n symbolsAddress,\n symbols.length,\n );\n\n const result = unmarshalNodeArray(this.tree, true);\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 if (descendant.tree !== this.tree) return 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 base = (TRANSFER_BUFFER + SIZE_OF_NODE) >>> 2;\n const heap = C.HEAP32;\n heap[base] = start;\n heap[base + 1] = end;\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 base = (TRANSFER_BUFFER + SIZE_OF_NODE) >>> 2;\n const heap = C.HEAP32;\n heap[base] = start;\n heap[base + 1] = end;\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 const address = C._ts_tree_cursor_new_wasm(this.tree[0]);\n return new TreeCursor(INTERNAL, this.tree, address);\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._ts_free_wasm(address);\n return result;\n }\n}\n\nfunction symbolsForTypes(language: Language, types: string | string[]): Uint32Array {\n const byType = symbolsByTypeForLanguage(language);\n if (typeof types === 'string') {\n return byType.get(types) ?? EMPTY_SYMBOLS;\n }\n if (types.length === 0) return EMPTY_SYMBOLS;\n if (types.length === 1) {\n return byType.get(types[0]) ?? EMPTY_SYMBOLS;\n }\n return collectSymbolsForTypes(byType, types);\n}\n\nfunction symbolsByTypeForLanguage(language: Language): Map<string, Uint32Array> {\n let cached = symbolsByTypeCache.get(language);\n if (!cached) {\n cached = buildSymbolsByType(language.types);\n symbolsByTypeCache.set(language, cached);\n }\n return cached;\n}\n\nfunction buildSymbolsByType(typesBySymbol: (string | undefined)[]): Map<string, Uint32Array> {\n const grouped = new Map<string, number[]>();\n for (let i = 0, n = typesBySymbol.length; i < n; i++) {\n const type = typesBySymbol[i];\n if (type !== undefined) {\n let list = grouped.get(type);\n if (!list) {\n list = [];\n grouped.set(type, list);\n }\n list.push(i);\n }\n }\n // `symbols_contain` in tree-sitter.c expects ascending symbols, and\n // ts_builtin_sym_error is -1, which is UINT16_MAX.\n const errorSymbols = grouped.get('ERROR');\n if (errorSymbols) {\n if (errorSymbols[errorSymbols.length - 1] !== 65535) {\n errorSymbols.push(65535);\n }\n } else {\n grouped.set('ERROR', [65535]);\n }\n const result = new Map<string, Uint32Array>();\n for (const [type, list] of grouped) {\n result.set(type, Uint32Array.from(list));\n }\n return result;\n}\n\nfunction collectSymbolsForTypes(byType: Map<string, Uint32Array>, types: string[]): Uint32Array {\n const symbols: number[] = [];\n for (const type of new Set(types)) {\n const matches = byType.get(type);\n if (matches) {\n for (const symbol of matches) symbols.push(symbol);\n }\n }\n if (symbols.length === 0) return EMPTY_SYMBOLS;\n return Uint32Array.from(symbols).sort();\n}\n", "import { INTERNAL, Point, Range, SIZE_OF_NODE, SIZE_OF_RANGE, C } from './constants';\nimport { Node } from './node';\nimport { Tree } from './tree';\nimport { TRANSFER_BUFFER } from './parser';\nimport { LanguageMetadata } from './language';\n\n/**\n * @internal\n *\n * Marshals a {@link Node} to the transfer buffer.\n */\nexport function marshalNode(node: Node, index = 0): void {\n const base = (TRANSFER_BUFFER + index * SIZE_OF_NODE) >>> 2;\n const heap = C.HEAP32;\n heap[base] = node.id;\n heap[base + 1] = node.startIndex;\n heap[base + 2] = node.startPosition.row;\n heap[base + 3] = node.startPosition.column;\n heap[base + 4] = node[0];\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 base = address >>> 2;\n const heap = C.HEAP32;\n const id = heap[base];\n if (id === 0) return null;\n\n const heapU32 = C.HEAPU32;\n return new Node(INTERNAL, {\n id,\n tree,\n startIndex: heapU32[base + 1],\n startPosition: { row: heapU32[base + 2], column: heapU32[base + 3] },\n other: heap[base + 4],\n endIndex: heapU32[base + 5],\n endRow: heapU32[base + 6],\n endColumn: heapU32[base + 7],\n flags: heapU32[base + 8],\n });\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 const base = address >>> 2;\n const heap = C.HEAP32;\n heap[base] = point.row;\n heap[base + 1] = point.column;\n}\n\n/**\n * @internal\n *\n * Unmarshals a {@link Point} from the transfer buffer.\n */\nexport function unmarshalPoint(address: number): Point {\n const base = address >>> 2;\n const heap = C.HEAPU32;\n return {\n row: heap[base],\n column: heap[base + 1],\n };\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 const base = address >>> 2;\n const heap = C.HEAP32;\n heap[base] = range.startPosition.row;\n heap[base + 1] = range.startPosition.column;\n heap[base + 2] = range.endPosition.row;\n heap[base + 3] = range.endPosition.column;\n heap[base + 4] = range.startIndex;\n heap[base + 5] = range.endIndex;\n}\n\n/**\n * @internal\n *\n * Unmarshals a {@link Range} from the transfer buffer.\n */\nexport function unmarshalRange(address: number): Range {\n const base = address >>> 2;\n const heap = C.HEAPU32;\n return {\n startPosition: { row: heap[base], column: heap[base + 1] },\n endPosition: { row: heap[base + 2], column: heap[base + 3] },\n startIndex: heap[base + 4],\n endIndex: heap[base + 5],\n };\n}\n\n/**\n * @internal\n *\n * Unmarshals a {@link LanguageMetadata} from the transfer buffer.\n */\nexport function unmarshalLanguageMetadata(address: number): LanguageMetadata {\n const base = address >>> 2;\n const heap = C.HEAP32;\n return {\n major_version: heap[base],\n minor_version: heap[base + 1],\n patch_version: heap[base + 2],\n };\n}\n\n/** @internal */\nexport function unmarshalSymbols(): number[] {\n const base = TRANSFER_BUFFER >>> 2;\n const count = C.HEAPU32[base];\n const buffer = C.HEAPU32[base + 1];\n const result = new Array<number>(count);\n if (count > 0) {\n const symbolBase = buffer >>> 1;\n const heapU16 = C.HEAPU16;\n for (let i = 0; i < count; i++) {\n result[i] = heapU16[symbolBase + i];\n }\n }\n return result;\n}\n\n/** @internal */\nexport function unmarshalRanges(useTsFree = true): Range[] {\n return unmarshalArray(SIZE_OF_RANGE, unmarshalRange, useTsFree);\n}\n\n/** @internal */\nexport function unmarshalNodeArray(tree: Tree, useTsFree = false): Node[] {\n return unmarshalArray(SIZE_OF_NODE, (address) => unmarshalNode(tree, address)!, useTsFree);\n}\n\nfunction unmarshalArray<T>(\n stride: number,\n readItem: (address: number) => T,\n useTsFree: boolean,\n): T[] {\n const base = TRANSFER_BUFFER >>> 2;\n const count = C.HEAPU32[base];\n const buffer = C.HEAP32[base + 1];\n const result = new Array<T>(count);\n for (let i = 0, address = buffer; i < count; i++, address += stride) {\n result[i] = readItem(address);\n }\n if (buffer) {\n if (useTsFree) C._ts_free_wasm(buffer);\n else C._free(buffer);\n }\n return result;\n}\n", "import { C, INTERNAL, Internal, assertInternal, SIZE_OF_INT } from './constants';\nimport { unmarshalLanguageMetadata, unmarshalSymbols } 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\ntype LanguageWasmExports = Record<string, () => number>;\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._wb_ts_language_symbol_count(this[0]));\n for (let i = 0, n = this.types.length; i < n; i++) {\n if (C._wb_ts_language_symbol_type(this[0], i) < 2) {\n this.types[i] = C.UTF8ToString(C._wb_ts_language_symbol_name(this[0], i));\n }\n }\n this.fields = new Array<string>(C._wb_ts_language_field_count(this[0]) + 1);\n for (let i = 0, n = this.fields.length; i < n; i++) {\n const fieldName = C._wb_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._wb_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._wb_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.HEAP32[TRANSFER_BUFFER >>> 2];\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._wb_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._wb_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._wb_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._wb_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 return unmarshalSymbols();\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 return unmarshalSymbols();\n }\n\n /**\n * Load a language from a WebAssembly module.\n * The module can be provided as a path to a file, a `URL` to a file, a\n * buffer, or a precompiled `WebAssembly.Module`. In Cloudflare Workers, which\n * do not allow compiling Wasm at run time, pass the imported `.wasm` module.\n */\n static async load(input: string | URL | Uint8Array | WebAssembly.Module): Promise<Language> {\n let binary: Uint8Array | WebAssembly.Module;\n if (input instanceof Uint8Array || input instanceof WebAssembly.Module) {\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 return loadFromWasmExports(mod, { sync: false });\n }\n\n /**\n * Load a language synchronously from a pre-compiled WebAssembly module.\n * Use this when the host environment provides a `WebAssembly.Module` directly.\n */\n static loadSync(wasmModule: WebAssembly.Module): Language {\n const mod = C.loadWebAssemblyModule(wasmModule, { loadAsync: false });\n return loadFromWasmExports(mod, { sync: true });\n }\n}\n\n// Outside the class, since a private member in the declarations would make the ES module and the CommonJS copies of\n// `typeof Language` incompatible with each other.\nfunction loadFromWasmExports(mod: LanguageWasmExports, { sync }: { sync: boolean }): Language {\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.${sync ? 'loadSync' : 'load'} failed: no language function found in Wasm file`);\n }\n const languageAddress = mod[functionName]();\n return new Language(INTERNAL, languageAddress);\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.currentProgressCallback = null;\n\nModule.currentLogCallback = null;\n\nModule.currentParseCallback = null;\n\nModule.treeSitterSetMemoryLimit = function(maxBytes) {\n if (!maxBytes) {\n if (Module.treeSitterOriginalMemoryGrow) {\n wasmMemory.grow = Module.treeSitterOriginalMemoryGrow;\n Module.treeSitterOriginalMemoryGrow = null;\n }\n return true;\n }\n if (wasmMemory.buffer.byteLength > maxBytes) return false;\n if (Module.treeSitterOriginalMemoryGrow) return false;\n Module.treeSitterOriginalMemoryGrow = wasmMemory.grow;\n wasmMemory.grow = function(pages) {\n if (wasmMemory.buffer.byteLength + pages * 65536 > maxBytes) {\n throw new RangeError(\"Parse memory limit exceeded\");\n }\n return Module.treeSitterOriginalMemoryGrow.call(wasmMemory, pages);\n };\n return true;\n};\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\nvar runtimeInitialized = false;\n\nfunction updateMemoryViews() {\n var b = wasmMemory.buffer;\n HEAP8 = new Int8Array(b);\n HEAP16 = new Int16Array(b);\n 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 HEAPF32 = new Float32Array(b);\n HEAPF64 = new Float64Array(b);\n HEAP64 = new BigInt64Array(b);\n HEAPU64 = new BigUint64Array(b);\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\"] || 524288;\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 const scannerAllocators = {malloc: wasmExports.ts_scanner_malloc_wasm, calloc: wasmExports.ts_scanner_calloc_wasm, realloc: wasmExports.ts_scanner_realloc_wasm}; Object.assign(wasmImports, scannerAllocators); updateGOT(scannerAllocators, true); 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 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;\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\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 = 82176;\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\": 53,\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 HEAPU32[(((handle) + (12)) >> 2)] = memoryBase;\n HEAP32[(((handle) + (16)) >> 2)] = metadata.memorySize;\n HEAPU32[(((handle) + (20)) >> 2)] = tableBase;\n HEAP32[(((handle) + (24)) >> 2)] = 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 = await WebAssembly.instantiate(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 = HEAPU32[(((handle) + (28)) >> 2)];\n var dataSize = HEAPU32[(((handle) + (32)) >> 2)];\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\nvar ___memory_base = new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": false\n}, 1024);\n\nvar ___stack_high = 82176;\n\nvar ___stack_low = 16640;\n\nvar ___stack_pointer = new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": true\n}, 82176);\n\nvar ___table_base = new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": false\n}, 1);\n\nvar runtimeKeepaliveCounter = 0;\n\nvar __emscripten_runtime_keepalive_clear = () => {\n noExitRuntime = false;\n runtimeKeepaliveCounter = 0;\n};\n\n__emscripten_runtime_keepalive_clear.sig = \"v\";\n\nvar __emscripten_throw_longjmp = () => {\n throw Infinity;\n};\n\n__emscripten_throw_longjmp.sig = \"v\";\n\nvar timers = {};\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 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/** @suppress {duplicate } */ /** @param {boolean|number=} implicit */ var exitJS = (status, implicit) => {\n EXITSTATUS = status;\n _proc_exit(status);\n};\n\nvar _exit = exitJS;\n\n_exit.sig = \"vi\";\n\nvar maybeExit = () => {\n if (!keepRuntimeAlive()) {\n try {\n _exit(EXITSTATUS);\n } catch (e) {\n handleException(e);\n }\n }\n};\n\nvar callUserCallback = func => {\n if (ABORT) {\n return;\n }\n try {\n func();\n maybeExit();\n } catch (e) {\n handleException(e);\n }\n};\n\nvar _emscripten_get_now = () => performance.now();\n\n_emscripten_get_now.sig = \"d\";\n\nvar __setitimer_js = (which, timeout_ms) => {\n // First, clear any existing timer.\n if (timers[which]) {\n clearTimeout(timers[which].id);\n delete timers[which];\n }\n // A timeout of zero simply cancels the current timeout so we have nothing\n // more to do.\n if (!timeout_ms) return 0;\n var id = setTimeout(() => {\n delete timers[which];\n callUserCallback(() => __emscripten_timeout(which, _emscripten_get_now()));\n }, timeout_ms);\n timers[which] = {\n id,\n timeout_ms\n };\n return 0;\n};\n\n__setitimer_js.sig = \"iid\";\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 + 0 / 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\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, maxCodeUnits, index, row, column, lengthAddress) {\n const source = Module.currentParseCallback;\n const isString = typeof source === \"string\";\n const chunk = isString ? source : source(index, {\n row,\n column\n });\n const offset = isString ? index : 0;\n const remaining = typeof chunk === \"string\" ? chunk.length - offset : 0;\n if (remaining <= 0) {\n HEAP32[lengthAddress >>> 2] = 0;\n return;\n }\n let count = remaining < maxCodeUnits ? remaining : maxCodeUnits;\n if (count < remaining && count > 1) {\n const last = chunk.charCodeAt(offset + count - 1);\n if (last >= 55296 && last <= 56319) count--;\n }\n const base = inputBufferAddress >>> 1;\n for (let i = 0; i < count; i++) {\n HEAPU16[base + i] = chunk.charCodeAt(offset + i);\n }\n HEAP32[lengthAddress >>> 2] = count;\n}\n\nfunction _tree_sitter_progress_callback(currentOffset, hasError) {\n if (Module.currentProgressCallback) {\n return Module.currentProgressCallback({\n currentOffset,\n hasError: hasError !== 0\n }) === true;\n }\n return false;\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\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[\"UTF8ToString\"] = UTF8ToString;\n\nModule[\"stringToUTF8\"] = stringToUTF8;\n\nModule[\"lengthBytesUTF8\"] = lengthBytesUTF8;\n\nModule[\"AsciiToString\"] = AsciiToString;\n\nModule[\"loadWebAssemblyModule\"] = loadWebAssemblyModule;\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 _free, _wb_ts_language_symbol_count, _wb_ts_language_state_count, _wb_ts_language_abi_version, _wb_ts_language_name, _wb_ts_language_field_count, _wb_ts_language_symbol_name, _wb_ts_language_symbol_for_name, _strncmp, _strlen, _wb_ts_language_symbol_type, _wb_ts_language_field_name_for_id, _memcmp, _wb_ts_parser_delete, _wb_ts_parser_set_language, _wb_ts_parser_reset, _wb_ts_tree_cursor_current_descendant_index, _wb_ts_tree_cursor_current_depth, _wb_ts_tree_copy, _wb_ts_tree_delete, _malloc, _calloc, _realloc, _ts_init, _ts_free_wasm, _ts_scanner_malloc_wasm, _ts_scanner_calloc_wasm, _ts_scanner_realloc_wasm, _ts_parser_new_wasm, _ts_parser_enable_logger_wasm, _ts_parser_parse_wasm, _ts_parser_parse_limited_wasm, _ts_parser_last_parse_operations_wasm, _ts_parser_abort_limited_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_included_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_id_wasm, _ts_tree_cursor_start_position_wasm, _ts_tree_cursor_end_position_wasm, _ts_tree_cursor_current_node_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_to_string_wasm, _ts_node_children_wasm, _ts_node_named_children_wasm, _ts_node_descendants_of_type_wasm, _memcpy, _memmove, _memset, _iswalnum, _iswalpha, _iswblank, _iswdigit, _iswlower, _iswpunct, _iswspace, _iswupper, _iswxdigit, _memchr, __emscripten_timeout, _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[\"_free\"] = _free = wasmExports[\"free\"];\n Module[\"_wb_ts_language_symbol_count\"] = _wb_ts_language_symbol_count = wasmExports[\"wb_ts_language_symbol_count\"];\n Module[\"_wb_ts_language_state_count\"] = _wb_ts_language_state_count = wasmExports[\"wb_ts_language_state_count\"];\n Module[\"_wb_ts_language_abi_version\"] = _wb_ts_language_abi_version = wasmExports[\"wb_ts_language_abi_version\"];\n Module[\"_wb_ts_language_name\"] = _wb_ts_language_name = wasmExports[\"wb_ts_language_name\"];\n Module[\"_wb_ts_language_field_count\"] = _wb_ts_language_field_count = wasmExports[\"wb_ts_language_field_count\"];\n Module[\"_wb_ts_language_symbol_name\"] = _wb_ts_language_symbol_name = wasmExports[\"wb_ts_language_symbol_name\"];\n Module[\"_wb_ts_language_symbol_for_name\"] = _wb_ts_language_symbol_for_name = wasmExports[\"wb_ts_language_symbol_for_name\"];\n Module[\"_strncmp\"] = _strncmp = wasmExports[\"strncmp\"];\n Module[\"_strlen\"] = _strlen = wasmExports[\"strlen\"];\n Module[\"_wb_ts_language_symbol_type\"] = _wb_ts_language_symbol_type = wasmExports[\"wb_ts_language_symbol_type\"];\n Module[\"_wb_ts_language_field_name_for_id\"] = _wb_ts_language_field_name_for_id = wasmExports[\"wb_ts_language_field_name_for_id\"];\n Module[\"_memcmp\"] = _memcmp = wasmExports[\"memcmp\"];\n Module[\"_wb_ts_parser_delete\"] = _wb_ts_parser_delete = wasmExports[\"wb_ts_parser_delete\"];\n Module[\"_wb_ts_parser_set_language\"] = _wb_ts_parser_set_language = wasmExports[\"wb_ts_parser_set_language\"];\n Module[\"_wb_ts_parser_reset\"] = _wb_ts_parser_reset = wasmExports[\"wb_ts_parser_reset\"];\n Module[\"_wb_ts_tree_cursor_current_descendant_index\"] = _wb_ts_tree_cursor_current_descendant_index = wasmExports[\"wb_ts_tree_cursor_current_descendant_index\"];\n Module[\"_wb_ts_tree_cursor_current_depth\"] = _wb_ts_tree_cursor_current_depth = wasmExports[\"wb_ts_tree_cursor_current_depth\"];\n Module[\"_wb_ts_tree_copy\"] = _wb_ts_tree_copy = wasmExports[\"wb_ts_tree_copy\"];\n Module[\"_wb_ts_tree_delete\"] = _wb_ts_tree_delete = wasmExports[\"wb_ts_tree_delete\"];\n Module[\"_malloc\"] = _malloc = wasmExports[\"malloc\"];\n Module[\"_calloc\"] = _calloc = wasmExports[\"calloc\"];\n Module[\"_realloc\"] = _realloc = wasmExports[\"realloc\"];\n Module[\"_ts_init\"] = _ts_init = wasmExports[\"ts_init\"];\n Module[\"_ts_free_wasm\"] = _ts_free_wasm = wasmExports[\"ts_free_wasm\"];\n Module[\"_ts_scanner_malloc_wasm\"] = _ts_scanner_malloc_wasm = wasmExports[\"ts_scanner_malloc_wasm\"];\n Module[\"_ts_scanner_calloc_wasm\"] = _ts_scanner_calloc_wasm = wasmExports[\"ts_scanner_calloc_wasm\"];\n Module[\"_ts_scanner_realloc_wasm\"] = _ts_scanner_realloc_wasm = wasmExports[\"ts_scanner_realloc_wasm\"];\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_parse_limited_wasm\"] = _ts_parser_parse_limited_wasm = wasmExports[\"ts_parser_parse_limited_wasm\"];\n Module[\"_ts_parser_last_parse_operations_wasm\"] = _ts_parser_last_parse_operations_wasm = wasmExports[\"ts_parser_last_parse_operations_wasm\"];\n Module[\"_ts_parser_abort_limited_wasm\"] = _ts_parser_abort_limited_wasm = wasmExports[\"ts_parser_abort_limited_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_included_ranges_wasm\"] = _ts_tree_included_ranges_wasm = wasmExports[\"ts_tree_included_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_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_current_node_wasm\"] = _ts_tree_cursor_current_node_wasm = wasmExports[\"ts_tree_cursor_current_node_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_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[\"_memcpy\"] = _memcpy = wasmExports[\"memcpy\"];\n Module[\"_memmove\"] = _memmove = wasmExports[\"memmove\"];\n Module[\"_memset\"] = _memset = wasmExports[\"memset\"];\n Module[\"_iswalnum\"] = _iswalnum = wasmExports[\"iswalnum\"];\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[\"_iswpunct\"] = _iswpunct = wasmExports[\"iswpunct\"];\n Module[\"_iswspace\"] = _iswspace = wasmExports[\"iswspace\"];\n Module[\"_iswupper\"] = _iswupper = wasmExports[\"iswupper\"];\n Module[\"_iswxdigit\"] = _iswxdigit = wasmExports[\"iswxdigit\"];\n Module[\"_memchr\"] = _memchr = wasmExports[\"memchr\"];\n __emscripten_timeout = wasmExports[\"_emscripten_timeout\"];\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 */ _emscripten_runtime_keepalive_clear: __emscripten_runtime_keepalive_clear,\n /** @export */ _emscripten_throw_longjmp: __emscripten_throw_longjmp,\n /** @export */ _setitimer_js: __setitimer_js,\n /** @export */ emscripten_resize_heap: _emscripten_resize_heap,\n /** @export */ invoke_i,\n /** @export */ invoke_iii,\n /** @export */ invoke_iiij,\n /** @export */ invoke_vi,\n /** @export */ invoke_viii,\n /** @export */ invoke_vij,\n /** @export */ memory: wasmMemory,\n /** @export */ proc_exit: _proc_exit,\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};\n\nfunction invoke_iii(index, a1, a2) {\n var sp = stackSave();\n try {\n return getWasmTableEntry(index)(a1, a2);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\nfunction invoke_vi(index, a1) {\n var sp = stackSave();\n try {\n getWasmTableEntry(index)(a1);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\nfunction invoke_i(index) {\n var sp = stackSave();\n try {\n return getWasmTableEntry(index)();\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\nfunction invoke_vij(index, a1, a2) {\n var sp = stackSave();\n try {\n getWasmTableEntry(index)(a1, a2);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\nfunction invoke_viii(index, a1, a2, a3) {\n var sp = stackSave();\n try {\n getWasmTableEntry(index)(a1, a2, a3);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\nfunction invoke_iiij(index, a1, a2, a3) {\n var sp = stackSave();\n try {\n return getWasmTableEntry(index)(a1, a2, a3);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\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 HEAPU32[((argv_ptr) >> 2)] = stringToUTF8OnStack(arg);\n argv_ptr += 4;\n });\n HEAPU32[((argv_ptr) >> 2)] = 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/** Options for {@link Parser.init}. */\nexport interface ParserInitOptions extends Partial<EmscriptenModule> {\n /**\n * The precompiled `web-tree-sitter.wasm` module. Pass it where compiling Wasm from bytes at run time is not\n * allowed, such as in Cloudflare Workers, which provide an imported `.wasm` file as a `WebAssembly.Module`.\n */\n wasmModule?: WebAssembly.Module;\n\n /** The memory imported by `web-tree-sitter.wasm`. */\n wasmMemory?: WebAssembly.Memory;\n}\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(options?: ParserInitOptions): Promise<MainModule> {\n if (Module) return Module;\n const { wasmModule, ...moduleOptions } = options ?? {};\n if (!wasmModule) return Module ??= await createModule(moduleOptions);\n\n // Emscripten gives `instantiateWasm` no way to report a failure, so its initialization would never settle;\n // the failure is raced against it instead.\n const instantiationFailure = new Promise<never>((_, reject) => {\n moduleOptions.instantiateWasm = (imports, receiveInstance) => {\n WebAssembly.instantiate(wasmModule, imports)\n .then((instance) => {\n // Emscripten reads the dynamic-linking metadata from the module passed with the instance, so both are passed.\n (receiveInstance as (instance: WebAssembly.Instance, module: WebAssembly.Module) => void)(instance, wasmModule);\n })\n .catch(reject);\n return {};\n };\n });\n return Module ??= await Promise.race([createModule(moduleOptions), instantiationFailure]);\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_RANGE, setModule } from './constants';\nimport { Language } from './language';\nimport { marshalRange, unmarshalRanges } from './marshal';\nimport { checkModule, initializeBinding, type ParserInitOptions } from './bindings';\nimport { Tree } from './tree';\nimport { newFinalizer } from './finalization_registry';\n\nconst TWO_POW_32 = 0x1_0000_0000;\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 // eslint-disable-next-line @typescript-eslint/no-invalid-void-type -- A callback may record progress without returning a cancellation decision.\n progressCallback?: (state: ParseState) => boolean | void;\n\n /**\n * The maximum size of Wasm memory during this parse, in bytes. Reaching it\n * cancels the parse. Memory is shared by all parsers and does not shrink, so\n * a parse also returns `null` when memory already exceeds this limit.\n */\n maxMemoryBytes?: number;\n\n /**\n * The maximum number of parse operations allowed during this parse. Exceeding\n * it cancels the parse and resets the parser.\n */\n maxOperations?: number;\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 the current version of the library supports. The\n * CLI of this fork assigns it to each generated language. Its upper 16 bits\n * (`0x5742`, \"WB\") tag the fork and its lower 16 bits count the fork's ABI\n * revisions, so that it never equals an ABI version of upstream Tree-sitter:\n * the library rejects languages generated by upstream's CLI, and upstream's\n * library rejects languages generated by this fork's CLI.\n */\nexport let LANGUAGE_VERSION: number;\n\n/**\n * The earliest ABI version that is supported by the current version of the\n * library. Scanners of the latest version may read the input in units, which\n * earlier libraries do not offer.\n */\nexport let MIN_COMPATIBLE_VERSION: number;\n\n/**\n * @internal\n *\n * Throws unless the CLI of this fork generated the language.\n */\nexport function assertSupportedLanguage(language: Language): void {\n const version = C._wb_ts_language_abi_version(language[0]);\n if (version < MIN_COMPATIBLE_VERSION || version > LANGUAGE_VERSION) {\n throw new Error(\n `Incompatible language version 0x${(version >>> 0).toString(16)}. ` +\n `Expected 0x${MIN_COMPATIBLE_VERSION.toString(16)} to 0x${LANGUAGE_VERSION.toString(16)}.`\n );\n }\n}\n\nconst finalizer = newFinalizer((addresses: number[]) => {\n C._wb_ts_parser_delete(addresses[0]);\n C._free(addresses[1]);\n});\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 /** @internal */\n private loggerEnabled = false;\n\n /** The parser's current language. */\n language: Language | null = null;\n\n /** The number of parse operations executed by the most recent {@link Parser#parse} call. */\n lastParseOperations = 0;\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. In Cloudflare Workers,\n * pass the imported `web-tree-sitter.wasm` module as `wasmModule` instead.\n */\n static async init(options?: ParserInitOptions) {\n setModule(await initializeBinding(options));\n TRANSFER_BUFFER = C._ts_init();\n const base = TRANSFER_BUFFER >>> 2;\n LANGUAGE_VERSION = C.HEAP32[base];\n MIN_COMPATIBLE_VERSION = C.HEAP32[base + 1];\n }\n\n /**\n * Create a new parser.\n */\n constructor() {\n this.initialize();\n finalizer?.register(this, [this[0], this[1]], this);\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 const base = TRANSFER_BUFFER >>> 2;\n this[0] = C.HEAP32[base];\n this[1] = C.HEAP32[base + 1];\n this.loggerEnabled = false;\n }\n\n /** Delete the parser, freeing its resources. */\n delete() {\n finalizer?.unregister(this);\n C._wb_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#abiVersion}; this library accepts versions from\n * {@link MIN_COMPATIBLE_VERSION} to {@link LANGUAGE_VERSION}.\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 assertSupportedLanguage(language);\n this.language = language;\n } else {\n throw new Error('Argument must be a Language');\n }\n\n C._wb_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 {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 * - The memory limit was reached or the operation limit was exceeded.\n */\n parse(\n callback: string | ParseCallback,\n options?: ParseOptions,\n ): Tree | null {\n const maxMemoryBytes = validateMemoryLimit(options?.maxMemoryBytes);\n const maxOperations = validateOperationLimit(options?.maxOperations);\n if (typeof callback !== 'string' && typeof callback !== 'function') {\n throw new Error('Argument must be a string or a function');\n }\n\n const progressCallback = options?.progressCallback ?? null;\n C.currentParseCallback = callback;\n C.currentProgressCallback = progressCallback;\n this.syncLogger();\n this.lastParseOperations = 0;\n\n try {\n const treeAddress = this.runParse(options, maxMemoryBytes, maxOperations);\n if (!treeAddress) return null;\n if (!this.language) throw new Error('Parser must have a language to parse');\n return new Tree(INTERNAL, treeAddress, this.language, callback);\n } finally {\n clearCallbacks();\n }\n }\n\n /** @internal */\n private syncLogger(): void {\n if (this.logCallback) {\n C.currentLogCallback = this.logCallback;\n if (!this.loggerEnabled) {\n C._ts_parser_enable_logger_wasm(this[0], 1);\n this.loggerEnabled = true;\n }\n } else {\n C.currentLogCallback = null;\n if (this.loggerEnabled) {\n C._ts_parser_enable_logger_wasm(this[0], 0);\n this.loggerEnabled = false;\n }\n }\n }\n\n /** @internal */\n private runParse(\n options: ParseOptions | undefined,\n maxMemoryBytes: number | undefined,\n maxOperations: number | undefined,\n ): number {\n if (maxMemoryBytes !== undefined && !C.treeSitterSetMemoryLimit(maxMemoryBytes)) {\n return 0;\n }\n try {\n const [rangeAddress, rangeCount] = prepareRanges(options?.includedRanges);\n if (rangeCount && !rangeAddress) return 0;\n marshalParseInputs(maxOperations, rangeAddress, rangeCount, options?.progressCallback ? 1 : 0);\n try {\n return maxMemoryBytes === undefined\n ? this.executeOrdinaryParse()\n : this.executeLimitedParse();\n } finally {\n this.lastParseOperations = unmarshalOperationCount();\n }\n } finally {\n if (maxMemoryBytes !== undefined) C.treeSitterSetMemoryLimit(0);\n }\n }\n\n /** @internal */\n private executeOrdinaryParse(): number {\n try {\n return C._ts_parser_parse_wasm(this[0], this[1]);\n } catch (error) {\n C._ts_parser_last_parse_operations_wasm(this[0]);\n throw error;\n }\n }\n\n /** @internal */\n private executeLimitedParse(): number {\n try {\n return C._ts_parser_parse_limited_wasm(this[0], this[1]);\n } catch (error) {\n C._ts_parser_abort_limited_wasm();\n throw error;\n }\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._wb_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 return unmarshalRanges(false);\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\nfunction validateMemoryLimit(maxMemoryBytes?: number): number | undefined {\n if (maxMemoryBytes !== undefined &&\n (!Number.isSafeInteger(maxMemoryBytes) || maxMemoryBytes <= 0 || maxMemoryBytes > 0x7fffffff)) {\n throw new RangeError('maxMemoryBytes must be a positive integer no greater than 2147483647');\n }\n return maxMemoryBytes;\n}\n\nfunction validateOperationLimit(maxOperations?: number): number | undefined {\n if (maxOperations !== undefined && (!Number.isSafeInteger(maxOperations) || maxOperations <= 0)) {\n throw new RangeError('maxOperations must be a positive safe integer');\n }\n return maxOperations;\n}\n\nfunction prepareRanges(ranges?: Range[]): [number, number] {\n if (!ranges?.length) return [0, 0];\n const rangeAddress = C._calloc(ranges.length, SIZE_OF_RANGE);\n if (!rangeAddress) return [0, ranges.length];\n try {\n let address = rangeAddress;\n for (const range of ranges) {\n marshalRange(address, range);\n address += SIZE_OF_RANGE;\n }\n return [rangeAddress, ranges.length];\n } catch (error) {\n C._free(rangeAddress);\n throw error;\n }\n}\n\nfunction marshalParseInputs(\n maxOperations: number | undefined,\n rangeAddress: number,\n rangeCount: number,\n hasProgressCallback: number,\n): void {\n const base = TRANSFER_BUFFER >>> 2;\n const heapU32 = C.HEAPU32;\n heapU32[base] = maxOperations === undefined ? 0 : maxOperations >>> 0;\n heapU32[base + 1] = maxOperations === undefined ? 0 : Math.floor(maxOperations / TWO_POW_32) >>> 0;\n heapU32[base + 2] = rangeAddress;\n heapU32[base + 3] = rangeCount;\n heapU32[base + 4] = hasProgressCallback;\n}\n\nfunction unmarshalOperationCount(): number {\n const base = TRANSFER_BUFFER >>> 2;\n const heapU32 = C.HEAPU32;\n return heapU32[base] + heapU32[base + 1] * TWO_POW_32;\n}\n\nfunction clearCallbacks(): void {\n C.currentParseCallback = null;\n C.currentLogCallback = null;\n C.currentProgressCallback = null;\n}\n"],
5
- "mappings": "AAoCO,IAAMA,EAAc,EAGdC,EAAe,EAAID,EAGnBE,EAAgB,EAAIF,EAGpBG,EAAgB,EAAIH,EAAc,EAAIE,EAGtCE,EAAoB,CAAE,IAAK,EAAG,OAAQ,CAAE,EAsBxCC,EAAW,OAAO,UAAU,EAMlC,SAASC,EAAeC,EAAmC,CAChE,GAAIA,IAAMF,EAAU,MAAM,IAAI,MAAM,qBAAqB,CAC3D,CAGO,SAASG,EAAQC,EAA+B,CACrD,MACE,CAAC,CAACA,GACF,OAAQA,EAAO,KAAQ,UACvB,OAAQA,EAAO,QAAW,QAE9B,CAOO,SAASC,EAAUC,EAAoB,CAC5CC,EAAID,CACN,CAQO,IAAIC,ECxGJ,SAASC,EAAgBC,EAAkE,CAChG,GAAI,CACF,OAAO,IAAI,qBAAqBA,CAAO,CACzC,OAAQC,EAAG,CACT,QAAQ,MAAM,oCAAqCA,CAAC,EACpD,MACF,CACF,CCAA,IAAMC,EAAYC,EAAcC,GAAoB,CAClDC,EAAE,4BAA4BD,CAAO,CACvC,CAAC,EAGYE,EAAN,MAAMC,CAAW,CAEb,EAAK,EAGN,KAGA,YAAc,EAGd,SAAW,EAGX,YAAc,EAGd,UAAY,EAGZ,OAAS,EAGjB,YAAYC,EAAoBC,EAAYL,EAAiB,CAC3DM,EAAeF,CAAQ,EACvB,KAAK,CAAC,EAAIJ,EACV,KAAK,KAAOK,EACZ,KAAK,cAAc,EACnBP,GAAW,SAAS,KAAME,EAAS,IAAI,CACzC,CAGA,MAAmB,CACjB,I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AIf,EAC7C,CAEA,SAAS4B,IAAuB,CAC9BrB,EAAE,qBAAuB,KACzBA,EAAE,mBAAqB,KACvBA,EAAE,wBAA0B,IAC9B",
4
+ "sourcesContent": ["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_INT = 4;\n\n/** @internal */\nexport const SIZE_OF_NODE = 9 * 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 */\n// eslint-disable-next-line @typescript-eslint/no-invalid-void-type -- A callback may record progress without returning a cancellation decision.\nexport type ProgressCallback = (progress: ParseState) => boolean | void;\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", "export function newFinalizer<T>(handler: (value: T) => void): FinalizationRegistry<T> | undefined {\n try {\n return new FinalizationRegistry(handler);\n } catch(e) {\n console.error('Unsupported FinalizationRegistry:', e);\n return;\n }\n}\n", "import { INTERNAL, Internal, assertInternal, Point, C } from './constants';\nimport { marshalNode, unmarshalNode, unmarshalPoint } from './marshal';\nimport { Node } from './node';\nimport { TRANSFER_BUFFER } from './parser';\nimport { getCallbackText, Tree } from './tree';\nimport { newFinalizer } from './finalization_registry';\n\nconst finalizer = newFinalizer((address: number) => {\n C._ts_tree_cursor_delete_wasm(address);\n});\n\n/** A stateful object for walking a syntax {@link Tree} efficiently. */\nexport class TreeCursor {\n /** @internal */\n private [0] = 0; // Internal handle for Wasm\n\n /** @internal */\n private tree: Tree;\n\n /** @internal */\n private _nodeTypeId = 0;\n\n /** @internal */\n private _fieldId = 0;\n\n /** @internal */\n private _startIndex = 0;\n\n /** @internal */\n private _endIndex = 0;\n\n /** @internal */\n private _flags = 0;\n\n /** @internal */\n constructor(internal: Internal, tree: Tree, address: number) {\n assertInternal(internal);\n this[0] = address;\n this.tree = tree;\n this.readNodeCache();\n finalizer?.register(this, address, this);\n }\n\n /** Creates a deep copy of the tree cursor. This allocates new memory. */\n copy(): TreeCursor {\n const address = C._ts_tree_cursor_copy_wasm(this[0]);\n return new TreeCursor(INTERNAL, this.tree, address);\n }\n\n /** Delete the tree cursor, freeing its resources. */\n delete(): void {\n finalizer?.unregister(this);\n C._ts_tree_cursor_delete_wasm(this[0]);\n this[0] = 0;\n }\n\n /** Get the tree cursor's current {@link Node}. */\n get currentNode(): Node {\n C._ts_tree_cursor_current_node_wasm(this[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 return this._fieldId;\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._fieldId] ?? null;\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 return C._wb_ts_tree_cursor_current_depth(this[0]) >>> 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 return C._wb_ts_tree_cursor_current_descendant_index(this[0]) >>> 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 return this._nodeTypeId;\n }\n\n /** Get the id of the cursor's current node. */\n get nodeId(): number {\n return C._ts_tree_cursor_current_node_id_wasm(this[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 return (this._flags & 1) !== 0;\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 return (this._flags & 2) !== 0;\n }\n\n /** Get the string content of the cursor's current node. */\n get nodeText(): string {\n const { textSource } = this.tree;\n return typeof textSource === 'string'\n ? textSource.slice(this._startIndex, this._endIndex)\n : getCallbackText(textSource, this._startIndex, this._endIndex, this.startPosition);\n }\n\n /** Get the start position of the cursor's current node. */\n get startPosition(): Point {\n C._ts_tree_cursor_start_position_wasm(this[0]);\n return unmarshalPoint(TRANSFER_BUFFER);\n }\n\n /** Get the end position of the cursor's current node. */\n get endPosition(): Point {\n C._ts_tree_cursor_end_position_wasm(this[0]);\n return unmarshalPoint(TRANSFER_BUFFER);\n }\n\n /** Get the start index of the cursor's current node. */\n get startIndex(): number {\n return this._startIndex;\n }\n\n /** Get the end index of the cursor's current node. */\n get endIndex(): number {\n return this._endIndex;\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 if (!C._ts_tree_cursor_goto_first_child_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\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 if (!C._ts_tree_cursor_goto_last_child_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\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 if (!C._ts_tree_cursor_goto_parent_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\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 if (!C._ts_tree_cursor_goto_next_sibling_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\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 if (!C._ts_tree_cursor_goto_previous_sibling_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\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 C._ts_tree_cursor_goto_descendant_wasm(this[0], goalDescendantIndex);\n this.readNodeCache();\n }\n\n /**\n * Move this cursor to the first child of its current node that contains or\n * starts after the given index.\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 if (!C._ts_tree_cursor_goto_first_child_for_index_wasm(this[0], goalIndex)) return false;\n this.readNodeCache();\n return true;\n }\n\n /**\n * Move this cursor to the first child of its current node that contains or\n * starts after the given position.\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 gotoFirstChildForPosition(goalPosition: Point): boolean {\n if (\n !C._ts_tree_cursor_goto_first_child_for_position_wasm(\n this[0],\n goalPosition.row,\n goalPosition.column,\n )\n ) {\n return false;\n }\n this.readNodeCache();\n return true;\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 this.tree = node.tree;\n C._ts_tree_cursor_reset_wasm(this[0], node.tree[0]);\n this.readNodeCache();\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 if (this[0] === cursor[0]) return;\n this.tree = cursor.tree;\n C._ts_tree_cursor_reset_to_wasm(this[0], cursor[0]);\n this.readNodeCache();\n }\n\n /** @internal */\n private readNodeCache(): void {\n const base = TRANSFER_BUFFER >>> 2;\n const heap = C.HEAPU32;\n this._nodeTypeId = heap[base];\n this._fieldId = heap[base + 1];\n this._startIndex = heap[base + 2];\n this._endIndex = heap[base + 3];\n this._flags = heap[base + 4];\n }\n}\n", "import { INTERNAL, Internal, assertInternal, ParseCallback, Point, Range, SIZE_OF_NODE, SIZE_OF_INT, C } from './constants';\nimport { Language } from './language';\nimport { Node } from './node';\nimport { TreeCursor } from './tree_cursor';\nimport { marshalPoint, unmarshalNode, unmarshalRanges } from './marshal';\nimport { TRANSFER_BUFFER } from './parser';\nimport { newFinalizer } from './finalization_registry';\n\n/** @internal */\nexport function getCallbackText(\n textSource: ParseCallback,\n startIndex: number,\n endIndex: number,\n startPosition: Point,\n): string {\n const length = endIndex - startIndex;\n let result = textSource(startIndex, startPosition);\n if (result) {\n startIndex += result.length;\n while (startIndex < endIndex) {\n const string = textSource(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\nconst finalizer = newFinalizer((address: number) => {\n C._wb_ts_tree_delete(address);\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 textSource: string | 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, textSource: string | ParseCallback) {\n assertInternal(internal);\n this[0] = address;\n this.language = language;\n this.textSource = textSource;\n finalizer?.register(this, address, this);\n }\n\n /** Create a shallow copy of the syntax tree. This is very fast. */\n copy(): Tree {\n const address = C._wb_ts_tree_copy(this[0]);\n return new Tree(INTERNAL, address, this.language, this.textSource);\n }\n\n /** Delete the syntax tree, freeing its resources. */\n delete(): void {\n finalizer?.unregister(this);\n C._wb_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.HEAP32[address >>> 2] = offsetBytes;\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 /** Create a new {@link TreeCursor} starting from the root of the tree. */\n walk(): TreeCursor {\n C._ts_tree_root_node_wasm(this[0]);\n const address = C._ts_tree_cursor_new_wasm(this[0]);\n return new TreeCursor(INTERNAL, this, address);\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 return unmarshalRanges();\n }\n}\n", "import { INTERNAL, Internal, assertInternal, SIZE_OF_INT, SIZE_OF_NODE, SIZE_OF_POINT, ZERO_POINT, isPoint, C, Point } from './constants';\nimport { getCallbackText, Tree } from './tree';\nimport { TreeCursor } from './tree_cursor';\nimport { Language } from './language';\nimport { marshalNode, marshalPoint, unmarshalNode, unmarshalNodeArray } from './marshal';\nimport { TRANSFER_BUFFER } from './parser';\n\nconst EMPTY_SYMBOLS = new Uint32Array(0);\nconst symbolsByTypeCache = new WeakMap<Language, Map<string, Uint32Array>>();\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 _endIndex: number;\n\n /** @internal */\n private _endRow: number;\n\n /** @internal */\n private _endColumn: number;\n\n /** @internal */\n private _flags: number;\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 endIndex,\n endRow,\n endColumn,\n flags,\n }: {\n id: number;\n tree: Tree;\n startIndex: number;\n startPosition: Point;\n other: number;\n endIndex: number;\n endRow: number;\n endColumn: number;\n flags: 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 this._endIndex = endIndex;\n this._endRow = endRow;\n this._endColumn = endColumn;\n this._flags = flags;\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.\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 return this._flags & 0xffff;\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._flags & 0xffff] || '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 return (this._flags & 0x10000) !== 0;\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 return (this._flags & 0x20000) !== 0;\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 return (this._flags & 0x100000) !== 0;\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 return (this._flags & 0x40000) !== 0;\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 return (this._flags & 0x80000) !== 0;\n }\n\n /** Get the byte index where this node ends. */\n get endIndex(): number {\n return this._endIndex;\n }\n\n /** Get the position where this node ends. */\n get endPosition(): Point {\n return { row: this._endRow, column: this._endColumn };\n }\n\n /** Get the string content of this node. */\n get text(): string {\n const { textSource } = this.tree;\n return typeof textSource === 'string'\n ? textSource.slice(this.startIndex, this._endIndex)\n : getCallbackText(textSource, this.startIndex, this._endIndex, this.startPosition);\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 return unmarshalNodeArray(this.tree, true);\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.HEAP32[address >>> 2] = index;\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.HEAP32[address >>> 2] = index;\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 this._children = unmarshalNodeArray(this.tree);\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 this._namedChildren = unmarshalNodeArray(this.tree);\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 const symbols = symbolsForTypes(this.tree.language, types);\n if (symbols.length === 0) return [];\n\n const symbolsAddress = C._malloc(SIZE_OF_INT * symbols.length);\n C.HEAPU32.set(symbols, symbolsAddress >>> 2);\n\n marshalNode(this);\n const pointAddress = TRANSFER_BUFFER + SIZE_OF_NODE;\n marshalPoint(pointAddress, startPosition);\n marshalPoint(pointAddress + SIZE_OF_POINT, endPosition);\n C._ts_node_descendants_of_type_wasm(\n this.tree[0],\n symbolsAddress,\n symbols.length,\n );\n\n const result = unmarshalNodeArray(this.tree, true);\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 if (descendant.tree !== this.tree) return 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 base = (TRANSFER_BUFFER + SIZE_OF_NODE) >>> 2;\n const heap = C.HEAP32;\n heap[base] = start;\n heap[base + 1] = end;\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 base = (TRANSFER_BUFFER + SIZE_OF_NODE) >>> 2;\n const heap = C.HEAP32;\n heap[base] = start;\n heap[base + 1] = end;\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 const address = C._ts_tree_cursor_new_wasm(this.tree[0]);\n return new TreeCursor(INTERNAL, this.tree, address);\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._ts_free_wasm(address);\n return result;\n }\n}\n\nfunction symbolsForTypes(language: Language, types: string | string[]): Uint32Array {\n const byType = symbolsByTypeForLanguage(language);\n if (typeof types === 'string') {\n return byType.get(types) ?? EMPTY_SYMBOLS;\n }\n if (types.length === 0) return EMPTY_SYMBOLS;\n if (types.length === 1) {\n return byType.get(types[0]) ?? EMPTY_SYMBOLS;\n }\n return collectSymbolsForTypes(byType, types);\n}\n\nfunction symbolsByTypeForLanguage(language: Language): Map<string, Uint32Array> {\n let cached = symbolsByTypeCache.get(language);\n if (!cached) {\n cached = buildSymbolsByType(language.types);\n symbolsByTypeCache.set(language, cached);\n }\n return cached;\n}\n\nfunction buildSymbolsByType(typesBySymbol: (string | undefined)[]): Map<string, Uint32Array> {\n const grouped = new Map<string, number[]>();\n for (let i = 0, n = typesBySymbol.length; i < n; i++) {\n const type = typesBySymbol[i];\n if (type !== undefined) {\n let list = grouped.get(type);\n if (!list) {\n list = [];\n grouped.set(type, list);\n }\n list.push(i);\n }\n }\n // `symbols_contain` in tree-sitter.c expects ascending symbols, and\n // ts_builtin_sym_error is -1, which is UINT16_MAX.\n const errorSymbols = grouped.get('ERROR');\n if (errorSymbols) {\n if (errorSymbols[errorSymbols.length - 1] !== 65535) {\n errorSymbols.push(65535);\n }\n } else {\n grouped.set('ERROR', [65535]);\n }\n const result = new Map<string, Uint32Array>();\n for (const [type, list] of grouped) {\n result.set(type, Uint32Array.from(list));\n }\n return result;\n}\n\nfunction collectSymbolsForTypes(byType: Map<string, Uint32Array>, types: string[]): Uint32Array {\n const symbols: number[] = [];\n for (const type of new Set(types)) {\n const matches = byType.get(type);\n if (matches) {\n for (const symbol of matches) symbols.push(symbol);\n }\n }\n if (symbols.length === 0) return EMPTY_SYMBOLS;\n return Uint32Array.from(symbols).sort();\n}\n", "import { INTERNAL, Point, Range, SIZE_OF_NODE, SIZE_OF_RANGE, C } from './constants';\nimport { Node } from './node';\nimport { Tree } from './tree';\nimport { TRANSFER_BUFFER } from './parser';\nimport { LanguageMetadata } from './language';\n\n/**\n * @internal\n *\n * Marshals a {@link Node} to the transfer buffer.\n */\nexport function marshalNode(node: Node, index = 0): void {\n const base = (TRANSFER_BUFFER + index * SIZE_OF_NODE) >>> 2;\n const heap = C.HEAP32;\n heap[base] = node.id;\n heap[base + 1] = node.startIndex;\n heap[base + 2] = node.startPosition.row;\n heap[base + 3] = node.startPosition.column;\n heap[base + 4] = node[0];\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 base = address >>> 2;\n const heap = C.HEAP32;\n const id = heap[base];\n if (id === 0) return null;\n\n const heapU32 = C.HEAPU32;\n return new Node(INTERNAL, {\n id,\n tree,\n startIndex: heapU32[base + 1],\n startPosition: { row: heapU32[base + 2], column: heapU32[base + 3] },\n other: heap[base + 4],\n endIndex: heapU32[base + 5],\n endRow: heapU32[base + 6],\n endColumn: heapU32[base + 7],\n flags: heapU32[base + 8],\n });\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 const base = address >>> 2;\n const heap = C.HEAP32;\n heap[base] = point.row;\n heap[base + 1] = point.column;\n}\n\n/**\n * @internal\n *\n * Unmarshals a {@link Point} from the transfer buffer.\n */\nexport function unmarshalPoint(address: number): Point {\n const base = address >>> 2;\n const heap = C.HEAPU32;\n return {\n row: heap[base],\n column: heap[base + 1],\n };\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 const base = address >>> 2;\n const heap = C.HEAP32;\n heap[base] = range.startPosition.row;\n heap[base + 1] = range.startPosition.column;\n heap[base + 2] = range.endPosition.row;\n heap[base + 3] = range.endPosition.column;\n heap[base + 4] = range.startIndex;\n heap[base + 5] = range.endIndex;\n}\n\n/**\n * @internal\n *\n * Unmarshals a {@link Range} from the transfer buffer.\n */\nexport function unmarshalRange(address: number): Range {\n const base = address >>> 2;\n const heap = C.HEAPU32;\n return {\n startPosition: { row: heap[base], column: heap[base + 1] },\n endPosition: { row: heap[base + 2], column: heap[base + 3] },\n startIndex: heap[base + 4],\n endIndex: heap[base + 5],\n };\n}\n\n/**\n * @internal\n *\n * Unmarshals a {@link LanguageMetadata} from the transfer buffer.\n */\nexport function unmarshalLanguageMetadata(address: number): LanguageMetadata {\n const base = address >>> 2;\n const heap = C.HEAP32;\n return {\n major_version: heap[base],\n minor_version: heap[base + 1],\n patch_version: heap[base + 2],\n };\n}\n\n/** @internal */\nexport function unmarshalSymbols(): number[] {\n const base = TRANSFER_BUFFER >>> 2;\n const count = C.HEAPU32[base];\n const buffer = C.HEAPU32[base + 1];\n const result = new Array<number>(count);\n if (count > 0) {\n const symbolBase = buffer >>> 1;\n const heapU16 = C.HEAPU16;\n for (let i = 0; i < count; i++) {\n result[i] = heapU16[symbolBase + i];\n }\n }\n return result;\n}\n\n/** @internal */\nexport function unmarshalRanges(useTsFree = true): Range[] {\n return unmarshalArray(SIZE_OF_RANGE, unmarshalRange, useTsFree);\n}\n\n/** @internal */\nexport function unmarshalNodeArray(tree: Tree, useTsFree = false): Node[] {\n return unmarshalArray(SIZE_OF_NODE, (address) => unmarshalNode(tree, address)!, useTsFree);\n}\n\nfunction unmarshalArray<T>(\n stride: number,\n readItem: (address: number) => T,\n useTsFree: boolean,\n): T[] {\n const base = TRANSFER_BUFFER >>> 2;\n const count = C.HEAPU32[base];\n const buffer = C.HEAP32[base + 1];\n const result = new Array<T>(count);\n for (let i = 0, address = buffer; i < count; i++, address += stride) {\n result[i] = readItem(address);\n }\n if (buffer) {\n if (useTsFree) C._ts_free_wasm(buffer);\n else C._free(buffer);\n }\n return result;\n}\n", "import { C, INTERNAL, Internal, assertInternal, SIZE_OF_INT } from './constants';\nimport { unmarshalLanguageMetadata, unmarshalSymbols } 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\ntype LanguageWasmExports = Record<string, () => number>;\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._wb_ts_language_symbol_count(this[0]));\n for (let i = 0, n = this.types.length; i < n; i++) {\n if (C._wb_ts_language_symbol_type(this[0], i) < 2) {\n this.types[i] = C.UTF8ToString(C._wb_ts_language_symbol_name(this[0], i));\n }\n }\n this.fields = new Array<string>(C._wb_ts_language_field_count(this[0]) + 1);\n for (let i = 0, n = this.fields.length; i < n; i++) {\n const fieldName = C._wb_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._wb_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._wb_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.HEAP32[TRANSFER_BUFFER >>> 2];\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._wb_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._wb_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._wb_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._wb_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 return unmarshalSymbols();\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 return unmarshalSymbols();\n }\n\n /**\n * Load a language from a WebAssembly module.\n * The module can be provided as a path to a file, a `URL` to a file, a\n * buffer, or a precompiled `WebAssembly.Module`. In Cloudflare Workers, which\n * do not allow compiling Wasm at run time, pass the imported `.wasm` module.\n */\n static async load(input: string | URL | Uint8Array | WebAssembly.Module): Promise<Language> {\n let binary: Uint8Array | WebAssembly.Module;\n if (input instanceof Uint8Array || input instanceof WebAssembly.Module) {\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 return loadFromWasmExports(mod, { sync: false });\n }\n\n /**\n * Load a language synchronously from a pre-compiled WebAssembly module.\n * Use this when the host environment provides a `WebAssembly.Module` directly.\n */\n static loadSync(wasmModule: WebAssembly.Module): Language {\n const mod = C.loadWebAssemblyModule(wasmModule, { loadAsync: false });\n return loadFromWasmExports(mod, { sync: true });\n }\n}\n\n// Outside the class, since a private member in the declarations would make the ES module and the CommonJS copies of\n// `typeof Language` incompatible with each other.\nfunction loadFromWasmExports(mod: LanguageWasmExports, { sync }: { sync: boolean }): Language {\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.${sync ? 'loadSync' : 'load'} failed: no language function found in Wasm file`);\n }\n const languageAddress = mod[functionName]();\n return new Language(INTERNAL, languageAddress);\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.currentProgressCallback = null;\n\nModule.currentLogCallback = null;\n\nModule.currentParseCallback = null;\n\nModule.treeSitterSetMemoryLimit = function(maxBytes) {\n if (!maxBytes) {\n if (Module.treeSitterOriginalMemoryGrow) {\n wasmMemory.grow = Module.treeSitterOriginalMemoryGrow;\n Module.treeSitterOriginalMemoryGrow = null;\n }\n return true;\n }\n if (wasmMemory.buffer.byteLength > maxBytes) return false;\n if (Module.treeSitterOriginalMemoryGrow) return false;\n Module.treeSitterOriginalMemoryGrow = wasmMemory.grow;\n wasmMemory.grow = function(pages) {\n if (wasmMemory.buffer.byteLength + pages * 65536 > maxBytes) {\n throw new RangeError(\"Parse memory limit exceeded\");\n }\n return Module.treeSitterOriginalMemoryGrow.call(wasmMemory, pages);\n };\n return true;\n};\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\nvar runtimeInitialized = false;\n\nfunction updateMemoryViews() {\n var b = wasmMemory.buffer;\n HEAP8 = new Int8Array(b);\n HEAP16 = new Int16Array(b);\n 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 HEAPF32 = new Float32Array(b);\n HEAPF64 = new Float64Array(b);\n HEAP64 = new BigInt64Array(b);\n HEAPU64 = new BigUint64Array(b);\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\"] || 524288;\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 const scannerAllocators = {malloc: wasmExports.ts_scanner_malloc_wasm, calloc: wasmExports.ts_scanner_calloc_wasm, realloc: wasmExports.ts_scanner_realloc_wasm}; Object.assign(wasmImports, scannerAllocators); updateGOT(scannerAllocators, true); 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 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;\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\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 = 82176;\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\": 53,\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 HEAPU32[(((handle) + (12)) >> 2)] = memoryBase;\n HEAP32[(((handle) + (16)) >> 2)] = metadata.memorySize;\n HEAPU32[(((handle) + (20)) >> 2)] = tableBase;\n HEAP32[(((handle) + (24)) >> 2)] = 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 = await WebAssembly.instantiate(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 = HEAPU32[(((handle) + (28)) >> 2)];\n var dataSize = HEAPU32[(((handle) + (32)) >> 2)];\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\nvar ___memory_base = new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": false\n}, 1024);\n\nvar ___stack_high = 82176;\n\nvar ___stack_low = 16640;\n\nvar ___stack_pointer = new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": true\n}, 82176);\n\nvar ___table_base = new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": false\n}, 1);\n\nvar runtimeKeepaliveCounter = 0;\n\nvar __emscripten_runtime_keepalive_clear = () => {\n noExitRuntime = false;\n runtimeKeepaliveCounter = 0;\n};\n\n__emscripten_runtime_keepalive_clear.sig = \"v\";\n\nvar __emscripten_throw_longjmp = () => {\n throw Infinity;\n};\n\n__emscripten_throw_longjmp.sig = \"v\";\n\nvar timers = {};\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 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/** @suppress {duplicate } */ /** @param {boolean|number=} implicit */ var exitJS = (status, implicit) => {\n EXITSTATUS = status;\n _proc_exit(status);\n};\n\nvar _exit = exitJS;\n\n_exit.sig = \"vi\";\n\nvar maybeExit = () => {\n if (!keepRuntimeAlive()) {\n try {\n _exit(EXITSTATUS);\n } catch (e) {\n handleException(e);\n }\n }\n};\n\nvar callUserCallback = func => {\n if (ABORT) {\n return;\n }\n try {\n func();\n maybeExit();\n } catch (e) {\n handleException(e);\n }\n};\n\nvar _emscripten_get_now = () => performance.now();\n\n_emscripten_get_now.sig = \"d\";\n\nvar __setitimer_js = (which, timeout_ms) => {\n // First, clear any existing timer.\n if (timers[which]) {\n clearTimeout(timers[which].id);\n delete timers[which];\n }\n // A timeout of zero simply cancels the current timeout so we have nothing\n // more to do.\n if (!timeout_ms) return 0;\n var id = setTimeout(() => {\n delete timers[which];\n callUserCallback(() => __emscripten_timeout(which, _emscripten_get_now()));\n }, timeout_ms);\n timers[which] = {\n id,\n timeout_ms\n };\n return 0;\n};\n\n__setitimer_js.sig = \"iid\";\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 + 0 / 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\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, maxCodeUnits, index, row, column, lengthAddress) {\n const source = Module.currentParseCallback;\n const isString = typeof source === \"string\";\n const chunk = isString ? source : source(index, {\n row,\n column\n });\n const offset = isString ? index : 0;\n const remaining = typeof chunk === \"string\" ? chunk.length - offset : 0;\n if (remaining <= 0) {\n HEAP32[lengthAddress >>> 2] = 0;\n return;\n }\n let count = remaining < maxCodeUnits ? remaining : maxCodeUnits;\n if (count < remaining && count > 1) {\n const last = chunk.charCodeAt(offset + count - 1);\n if (last >= 55296 && last <= 56319) count--;\n }\n const base = inputBufferAddress >>> 1;\n for (let i = 0; i < count; i++) {\n HEAPU16[base + i] = chunk.charCodeAt(offset + i);\n }\n HEAP32[lengthAddress >>> 2] = count;\n}\n\nfunction _tree_sitter_progress_callback(currentOffset, hasError) {\n if (Module.currentProgressCallback) {\n return Module.currentProgressCallback({\n currentOffset,\n hasError: hasError !== 0\n }) === true;\n }\n return false;\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\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[\"UTF8ToString\"] = UTF8ToString;\n\nModule[\"stringToUTF8\"] = stringToUTF8;\n\nModule[\"lengthBytesUTF8\"] = lengthBytesUTF8;\n\nModule[\"AsciiToString\"] = AsciiToString;\n\nModule[\"loadWebAssemblyModule\"] = loadWebAssemblyModule;\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 _free, _wb_ts_language_symbol_count, _wb_ts_language_state_count, _wb_ts_language_abi_version, _wb_ts_language_name, _wb_ts_language_field_count, _wb_ts_language_symbol_name, _wb_ts_language_symbol_for_name, _strncmp, _strlen, _wb_ts_language_symbol_type, _wb_ts_language_field_name_for_id, _memcmp, _wb_ts_parser_delete, _wb_ts_parser_set_language, _wb_ts_parser_reset, _wb_ts_tree_cursor_current_descendant_index, _wb_ts_tree_cursor_current_depth, _wb_ts_tree_copy, _wb_ts_tree_delete, _malloc, _calloc, _realloc, _ts_init, _ts_free_wasm, _ts_scanner_malloc_wasm, _ts_scanner_calloc_wasm, _ts_scanner_realloc_wasm, _ts_parser_new_wasm, _ts_parser_enable_logger_wasm, _ts_parser_parse_wasm, _ts_parser_parse_limited_wasm, _ts_parser_last_parse_operations_wasm, _ts_parser_abort_limited_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_included_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_id_wasm, _ts_tree_cursor_start_position_wasm, _ts_tree_cursor_end_position_wasm, _ts_tree_cursor_current_node_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_to_string_wasm, _ts_node_children_wasm, _ts_node_named_children_wasm, _ts_node_descendants_of_type_wasm, _memcpy, _memmove, _memset, _iswalnum, _iswalpha, _iswblank, _iswdigit, _iswlower, _iswpunct, _iswspace, _iswupper, _iswxdigit, _memchr, __emscripten_timeout, _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[\"_free\"] = _free = wasmExports[\"free\"];\n Module[\"_wb_ts_language_symbol_count\"] = _wb_ts_language_symbol_count = wasmExports[\"wb_ts_language_symbol_count\"];\n Module[\"_wb_ts_language_state_count\"] = _wb_ts_language_state_count = wasmExports[\"wb_ts_language_state_count\"];\n Module[\"_wb_ts_language_abi_version\"] = _wb_ts_language_abi_version = wasmExports[\"wb_ts_language_abi_version\"];\n Module[\"_wb_ts_language_name\"] = _wb_ts_language_name = wasmExports[\"wb_ts_language_name\"];\n Module[\"_wb_ts_language_field_count\"] = _wb_ts_language_field_count = wasmExports[\"wb_ts_language_field_count\"];\n Module[\"_wb_ts_language_symbol_name\"] = _wb_ts_language_symbol_name = wasmExports[\"wb_ts_language_symbol_name\"];\n Module[\"_wb_ts_language_symbol_for_name\"] = _wb_ts_language_symbol_for_name = wasmExports[\"wb_ts_language_symbol_for_name\"];\n Module[\"_strncmp\"] = _strncmp = wasmExports[\"strncmp\"];\n Module[\"_strlen\"] = _strlen = wasmExports[\"strlen\"];\n Module[\"_wb_ts_language_symbol_type\"] = _wb_ts_language_symbol_type = wasmExports[\"wb_ts_language_symbol_type\"];\n Module[\"_wb_ts_language_field_name_for_id\"] = _wb_ts_language_field_name_for_id = wasmExports[\"wb_ts_language_field_name_for_id\"];\n Module[\"_memcmp\"] = _memcmp = wasmExports[\"memcmp\"];\n Module[\"_wb_ts_parser_delete\"] = _wb_ts_parser_delete = wasmExports[\"wb_ts_parser_delete\"];\n Module[\"_wb_ts_parser_set_language\"] = _wb_ts_parser_set_language = wasmExports[\"wb_ts_parser_set_language\"];\n Module[\"_wb_ts_parser_reset\"] = _wb_ts_parser_reset = wasmExports[\"wb_ts_parser_reset\"];\n Module[\"_wb_ts_tree_cursor_current_descendant_index\"] = _wb_ts_tree_cursor_current_descendant_index = wasmExports[\"wb_ts_tree_cursor_current_descendant_index\"];\n Module[\"_wb_ts_tree_cursor_current_depth\"] = _wb_ts_tree_cursor_current_depth = wasmExports[\"wb_ts_tree_cursor_current_depth\"];\n Module[\"_wb_ts_tree_copy\"] = _wb_ts_tree_copy = wasmExports[\"wb_ts_tree_copy\"];\n Module[\"_wb_ts_tree_delete\"] = _wb_ts_tree_delete = wasmExports[\"wb_ts_tree_delete\"];\n Module[\"_malloc\"] = _malloc = wasmExports[\"malloc\"];\n Module[\"_calloc\"] = _calloc = wasmExports[\"calloc\"];\n Module[\"_realloc\"] = _realloc = wasmExports[\"realloc\"];\n Module[\"_ts_init\"] = _ts_init = wasmExports[\"ts_init\"];\n Module[\"_ts_free_wasm\"] = _ts_free_wasm = wasmExports[\"ts_free_wasm\"];\n Module[\"_ts_scanner_malloc_wasm\"] = _ts_scanner_malloc_wasm = wasmExports[\"ts_scanner_malloc_wasm\"];\n Module[\"_ts_scanner_calloc_wasm\"] = _ts_scanner_calloc_wasm = wasmExports[\"ts_scanner_calloc_wasm\"];\n Module[\"_ts_scanner_realloc_wasm\"] = _ts_scanner_realloc_wasm = wasmExports[\"ts_scanner_realloc_wasm\"];\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_parse_limited_wasm\"] = _ts_parser_parse_limited_wasm = wasmExports[\"ts_parser_parse_limited_wasm\"];\n Module[\"_ts_parser_last_parse_operations_wasm\"] = _ts_parser_last_parse_operations_wasm = wasmExports[\"ts_parser_last_parse_operations_wasm\"];\n Module[\"_ts_parser_abort_limited_wasm\"] = _ts_parser_abort_limited_wasm = wasmExports[\"ts_parser_abort_limited_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_included_ranges_wasm\"] = _ts_tree_included_ranges_wasm = wasmExports[\"ts_tree_included_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_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_current_node_wasm\"] = _ts_tree_cursor_current_node_wasm = wasmExports[\"ts_tree_cursor_current_node_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_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[\"_memcpy\"] = _memcpy = wasmExports[\"memcpy\"];\n Module[\"_memmove\"] = _memmove = wasmExports[\"memmove\"];\n Module[\"_memset\"] = _memset = wasmExports[\"memset\"];\n Module[\"_iswalnum\"] = _iswalnum = wasmExports[\"iswalnum\"];\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[\"_iswpunct\"] = _iswpunct = wasmExports[\"iswpunct\"];\n Module[\"_iswspace\"] = _iswspace = wasmExports[\"iswspace\"];\n Module[\"_iswupper\"] = _iswupper = wasmExports[\"iswupper\"];\n Module[\"_iswxdigit\"] = _iswxdigit = wasmExports[\"iswxdigit\"];\n Module[\"_memchr\"] = _memchr = wasmExports[\"memchr\"];\n __emscripten_timeout = wasmExports[\"_emscripten_timeout\"];\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 */ _emscripten_runtime_keepalive_clear: __emscripten_runtime_keepalive_clear,\n /** @export */ _emscripten_throw_longjmp: __emscripten_throw_longjmp,\n /** @export */ _setitimer_js: __setitimer_js,\n /** @export */ emscripten_resize_heap: _emscripten_resize_heap,\n /** @export */ invoke_i,\n /** @export */ invoke_iii,\n /** @export */ invoke_iiij,\n /** @export */ invoke_vi,\n /** @export */ invoke_viii,\n /** @export */ invoke_vij,\n /** @export */ memory: wasmMemory,\n /** @export */ proc_exit: _proc_exit,\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};\n\nfunction invoke_iii(index, a1, a2) {\n var sp = stackSave();\n try {\n return getWasmTableEntry(index)(a1, a2);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\nfunction invoke_vi(index, a1) {\n var sp = stackSave();\n try {\n getWasmTableEntry(index)(a1);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\nfunction invoke_i(index) {\n var sp = stackSave();\n try {\n return getWasmTableEntry(index)();\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\nfunction invoke_vij(index, a1, a2) {\n var sp = stackSave();\n try {\n getWasmTableEntry(index)(a1, a2);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\nfunction invoke_viii(index, a1, a2, a3) {\n var sp = stackSave();\n try {\n getWasmTableEntry(index)(a1, a2, a3);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\nfunction invoke_iiij(index, a1, a2, a3) {\n var sp = stackSave();\n try {\n return getWasmTableEntry(index)(a1, a2, a3);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\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 HEAPU32[((argv_ptr) >> 2)] = stringToUTF8OnStack(arg);\n argv_ptr += 4;\n });\n HEAPU32[((argv_ptr) >> 2)] = 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/** Options for {@link Parser.init}. */\nexport interface ParserInitOptions extends Partial<EmscriptenModule> {\n /**\n * The precompiled `web-tree-sitter.wasm` module. Pass it where compiling Wasm from bytes at run time is not\n * allowed, such as in Cloudflare Workers, which provide an imported `.wasm` file as a `WebAssembly.Module`.\n */\n wasmModule?: WebAssembly.Module;\n\n /** The memory imported by `web-tree-sitter.wasm`. */\n wasmMemory?: WebAssembly.Memory;\n}\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(options?: ParserInitOptions): Promise<MainModule> {\n if (Module) return Module;\n const { wasmModule, ...moduleOptions } = options ?? {};\n if (!wasmModule) return Module ??= await createModule(moduleOptions);\n\n // Emscripten gives `instantiateWasm` no way to report a failure, so its initialization would never settle;\n // the failure is raced against it instead.\n const instantiationFailure = new Promise<never>((_, reject) => {\n moduleOptions.instantiateWasm = (imports, receiveInstance) => {\n WebAssembly.instantiate(wasmModule, imports)\n .then((instance) => {\n // Emscripten reads the dynamic-linking metadata from the module passed with the instance, so both are passed.\n (receiveInstance as (instance: WebAssembly.Instance, module: WebAssembly.Module) => void)(instance, wasmModule);\n })\n .catch(reject);\n return {};\n };\n });\n return Module ??= await Promise.race([createModule(moduleOptions), instantiationFailure]);\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_RANGE, setModule } from './constants';\nimport { Language } from './language';\nimport { marshalRange, unmarshalRanges } from './marshal';\nimport { checkModule, initializeBinding, type ParserInitOptions } from './bindings';\nimport { Tree } from './tree';\nimport { newFinalizer } from './finalization_registry';\n\nconst TWO_POW_32 = 0x1_0000_0000;\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 // eslint-disable-next-line @typescript-eslint/no-invalid-void-type -- A callback may record progress without returning a cancellation decision.\n progressCallback?: (state: ParseState) => boolean | void;\n\n /**\n * The maximum size of Wasm memory during this parse, in bytes. Reaching it\n * cancels the parse. Memory is shared by all parsers and does not shrink, so\n * a parse also returns `null` when memory already exceeds this limit.\n */\n maxMemoryBytes?: number;\n\n /**\n * The maximum number of parse operations allowed during this parse. Exceeding\n * it cancels the parse and resets the parser.\n */\n maxOperations?: number;\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 the current version of the library supports.\n * The upper 16 bits of each generated language ABI\n * (`0x5742`, \"WB\") tag the fork and its lower 16 bits count the fork's ABI\n * revisions, so that it never equals an ABI version of upstream Tree-sitter:\n * the library rejects languages generated by upstream's CLI, and upstream's\n * library rejects languages generated by this fork's CLI.\n */\nexport let LANGUAGE_VERSION: number;\n\n/**\n * The earliest ABI version that is supported by the current version of the\n * library. External scanners can read input in units starting at ABI 0x5742000e.\n */\nexport let MIN_COMPATIBLE_VERSION: number;\n\n/**\n * @internal\n *\n * Throws unless the CLI of this fork generated the language.\n */\nexport function assertSupportedLanguage(language: Language): void {\n const version = C._wb_ts_language_abi_version(language[0]);\n if (version < MIN_COMPATIBLE_VERSION || version > LANGUAGE_VERSION) {\n throw new Error(\n `Incompatible language version 0x${(version >>> 0).toString(16)}. ` +\n `Expected 0x${MIN_COMPATIBLE_VERSION.toString(16)} to 0x${LANGUAGE_VERSION.toString(16)}.`\n );\n }\n}\n\nconst finalizer = newFinalizer((addresses: number[]) => {\n C._wb_ts_parser_delete(addresses[0]);\n C._free(addresses[1]);\n});\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 /** @internal */\n private loggerEnabled = false;\n\n /** The parser's current language. */\n language: Language | null = null;\n\n /** The number of parse operations executed by the most recent {@link Parser#parse} call. */\n lastParseOperations = 0;\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. In Cloudflare Workers,\n * pass the imported `web-tree-sitter.wasm` module as `wasmModule` instead.\n */\n static async init(options?: ParserInitOptions) {\n setModule(await initializeBinding(options));\n TRANSFER_BUFFER = C._ts_init();\n const base = TRANSFER_BUFFER >>> 2;\n LANGUAGE_VERSION = C.HEAP32[base];\n MIN_COMPATIBLE_VERSION = C.HEAP32[base + 1];\n }\n\n /**\n * Create a new parser.\n */\n constructor() {\n this.initialize();\n finalizer?.register(this, [this[0], this[1]], this);\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 const base = TRANSFER_BUFFER >>> 2;\n this[0] = C.HEAP32[base];\n this[1] = C.HEAP32[base + 1];\n this.loggerEnabled = false;\n }\n\n /** Delete the parser, freeing its resources. */\n delete() {\n finalizer?.unregister(this);\n C._wb_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#abiVersion}; this library accepts versions from\n * {@link MIN_COMPATIBLE_VERSION} to {@link LANGUAGE_VERSION}.\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 assertSupportedLanguage(language);\n this.language = language;\n } else {\n throw new Error('Argument must be a Language');\n }\n\n C._wb_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 {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 * - The memory limit was reached or the operation limit was exceeded.\n */\n parse(\n callback: string | ParseCallback,\n options?: ParseOptions,\n ): Tree | null {\n const maxMemoryBytes = validateMemoryLimit(options?.maxMemoryBytes);\n const maxOperations = validateOperationLimit(options?.maxOperations);\n if (typeof callback !== 'string' && typeof callback !== 'function') {\n throw new Error('Argument must be a string or a function');\n }\n\n const progressCallback = options?.progressCallback ?? null;\n C.currentParseCallback = callback;\n C.currentProgressCallback = progressCallback;\n this.syncLogger();\n this.lastParseOperations = 0;\n\n try {\n const treeAddress = this.runParse(options, maxMemoryBytes, maxOperations);\n if (!treeAddress) return null;\n if (!this.language) throw new Error('Parser must have a language to parse');\n return new Tree(INTERNAL, treeAddress, this.language, callback);\n } finally {\n clearCallbacks();\n }\n }\n\n /** @internal */\n private syncLogger(): void {\n if (this.logCallback) {\n C.currentLogCallback = this.logCallback;\n if (!this.loggerEnabled) {\n C._ts_parser_enable_logger_wasm(this[0], 1);\n this.loggerEnabled = true;\n }\n } else {\n C.currentLogCallback = null;\n if (this.loggerEnabled) {\n C._ts_parser_enable_logger_wasm(this[0], 0);\n this.loggerEnabled = false;\n }\n }\n }\n\n /** @internal */\n private runParse(\n options: ParseOptions | undefined,\n maxMemoryBytes: number | undefined,\n maxOperations: number | undefined,\n ): number {\n if (maxMemoryBytes !== undefined && !C.treeSitterSetMemoryLimit(maxMemoryBytes)) {\n return 0;\n }\n try {\n const [rangeAddress, rangeCount] = prepareRanges(options?.includedRanges);\n if (rangeCount && !rangeAddress) return 0;\n marshalParseInputs(maxOperations, rangeAddress, rangeCount, options?.progressCallback ? 1 : 0);\n try {\n return maxMemoryBytes === undefined\n ? this.executeOrdinaryParse()\n : this.executeLimitedParse();\n } finally {\n this.lastParseOperations = unmarshalOperationCount();\n }\n } finally {\n if (maxMemoryBytes !== undefined) C.treeSitterSetMemoryLimit(0);\n }\n }\n\n /** @internal */\n private executeOrdinaryParse(): number {\n try {\n return C._ts_parser_parse_wasm(this[0], this[1]);\n } catch (error) {\n C._ts_parser_last_parse_operations_wasm(this[0]);\n throw error;\n }\n }\n\n /** @internal */\n private executeLimitedParse(): number {\n try {\n return C._ts_parser_parse_limited_wasm(this[0], this[1]);\n } catch (error) {\n C._ts_parser_abort_limited_wasm();\n throw error;\n }\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._wb_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 return unmarshalRanges(false);\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\nfunction validateMemoryLimit(maxMemoryBytes?: number): number | undefined {\n if (maxMemoryBytes !== undefined &&\n (!Number.isSafeInteger(maxMemoryBytes) || maxMemoryBytes <= 0 || maxMemoryBytes > 0x7fffffff)) {\n throw new RangeError('maxMemoryBytes must be a positive integer no greater than 2147483647');\n }\n return maxMemoryBytes;\n}\n\nfunction validateOperationLimit(maxOperations?: number): number | undefined {\n if (maxOperations !== undefined && (!Number.isSafeInteger(maxOperations) || maxOperations <= 0)) {\n throw new RangeError('maxOperations must be a positive safe integer');\n }\n return maxOperations;\n}\n\nfunction prepareRanges(ranges?: Range[]): [number, number] {\n if (!ranges?.length) return [0, 0];\n const rangeAddress = C._calloc(ranges.length, SIZE_OF_RANGE);\n if (!rangeAddress) return [0, ranges.length];\n try {\n let address = rangeAddress;\n for (const range of ranges) {\n marshalRange(address, range);\n address += SIZE_OF_RANGE;\n }\n return [rangeAddress, ranges.length];\n } catch (error) {\n C._free(rangeAddress);\n throw error;\n }\n}\n\nfunction marshalParseInputs(\n maxOperations: number | undefined,\n rangeAddress: number,\n rangeCount: number,\n hasProgressCallback: number,\n): void {\n const base = TRANSFER_BUFFER >>> 2;\n const heapU32 = C.HEAPU32;\n heapU32[base] = maxOperations === undefined ? 0 : maxOperations >>> 0;\n heapU32[base + 1] = maxOperations === undefined ? 0 : Math.floor(maxOperations / TWO_POW_32) >>> 0;\n heapU32[base + 2] = rangeAddress;\n heapU32[base + 3] = rangeCount;\n heapU32[base + 4] = hasProgressCallback;\n}\n\nfunction unmarshalOperationCount(): number {\n const base = TRANSFER_BUFFER >>> 2;\n const heapU32 = C.HEAPU32;\n return heapU32[base] + heapU32[base + 1] * TWO_POW_32;\n}\n\nfunction clearCallb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"x", "isPoint", "point", "setModule", "module", "C", "newFinalizer", "handler", "e", "finalizer", "newFinalizer", "address", "C", "TreeCursor", "_TreeCursor", "internal", "tree", "assertInternal", "INTERNAL", "unmarshalNode", "textSource", "getCallbackText", "unmarshalPoint", "TRANSFER_BUFFER", "goalDescendantIndex", "goalIndex", "goalPosition", "node", "marshalNode", "cursor", "base", "heap", "getCallbackText", "textSource", "startIndex", "endIndex", "startPosition", "length", "result", "string", "finalizer", "newFinalizer", "address", "C", "Tree", "_Tree", "internal", "language", "assertInternal", "INTERNAL", "unmarshalNode", "offsetBytes", "offsetExtent", "TRANSFER_BUFFER", "SIZE_OF_NODE", "marshalPoint", "SIZE_OF_INT", "TreeCursor", "unmarshalRanges", "EMPTY_SYMBOLS", "symbolsByTypeCache", "Node", "internal", "id", "tree", "startIndex", "startPosition", "other", "endIndex", "endRow", "endColumn", "flags", "assertInternal", "marshalNode", "C", "textSource", "getCallbackText", "index", "unmarshalNode", "fieldId", "fieldName", "address", "unmarshalNodeArray", "TRANSFER_BUFFER", "SIZE_OF_NODE", "types", "ZERO_POINT", "endPosition", "symbols", "symbolsForTypes", "symbolsAddress", "SIZE_OF_INT", "pointAddress", "marshalPoint", "SIZE_OF_POINT", "result", "descendant", "start", "end", "base", "heap", "isPoint", "TreeCursor", "INTERNAL", "language", "byType", "symbolsByTypeForLanguage", "collectSymbolsForTypes", "cached", "buildSymbolsByType", "typesBySymbol", "grouped", "i", "n", "type", "list", "errorSymbols", "matches", "symbol", "marshalNode", "node", "index", "base", "TRANSFER_BUFFER", "SIZE_OF_NODE", "heap", "C", "unmarshalNode", "tree", "address", "id", "heapU32", "Node", "INTERNAL", "marshalPoint", "point", "unmarshalPoint", "marshalRange", "range", "unmarshalRange", "unmarshalLanguageMetadata", "unmarshalSymbols", "count", "buffer", "result", "symbolBase", "heapU16", "i", "unmarshalRanges", "useTsFree", "unmarshalArray", "SIZE_OF_RANGE", "unmarshalNodeArray", "stride", "readItem", "LANGUAGE_FUNCTION_REGEX", "Language", "internal", "address", "assertInternal", "C", "i", "n", "fieldName", "ptr", "TRANSFER_BUFFER", "unmarshalLanguageMetadata", "SIZE_OF_INT", "result", "fieldId", "type", "named", "typeLength", "typeAddress", "typeId", "name", "unmarshalSymbols", "supertype", "input", "binary", "response", "body", "retryResp", "reason", "mod", "loadFromWasmExports", "wasmModule", "sync", "symbolNames", "functionName", "key", "languageAddress", "INTERNAL", "Module", "createRequire", "maxBytes", "pages", "status", "toThrow", "path", "filename", "ret", "binary", "url", "xhr", "resolve", "reject", "response", "b", "INITIAL_MEMORY", "what", "e", "file", "binaryFile", "imports", "instance", "reason", "instantiationResult", "receiveInstance", "module", "metadata", "scannerAllocators", "receiveInstantiationResult", "result", "info", "mod", "inst", "exports", "obj", "symName", "rtn", "callbacks", "cb", "heapOrArray", "idx", "maxBytesToRead", "ignoreNul", "maxIdx", "endPtr", "str", "u0", "u1", "u2", "ch", "offset", "end", "getU8", "getLEB", "mul", "byte", "getString", "len", "getStringList", "count", "failIf", "condition", "message", "dylinkSection", "int32View", "magicNumberFound", "section_size", "name", "customSection", "WASM_DYLINK_MEM_INFO", "WASM_DYLINK_NEEDED", "WASM_DYLINK_EXPORT_INFO", "WASM_DYLINK_IMPORT_INFO", "WASM_DYLINK_RUNTIME_PATH", "WASM_SYMBOL_TLS", "WASM_SYMBOL_BINDING_MASK", "WASM_SYMBOL_BINDING_WEAK", "subsectionType", "subsectionSize", "symname", "flags", "modname", "handle", "syms", "dso", "size", "alignment", "arr", "n", "types", "type", "code", "func", "sig", "bytes", "wrappedFunc", "funcPtr", "i", "item", "err", "wrapped", "replace", "value", "memoryBase", "relocated", "existing", "ptr", "args", "promising", "convert", "val", "sp", "direct", "sym", "resolved", "stubs", "prop", "res", "chain", "dynNeeded", "needed", "libName", "exp", "setImport", "target", "main_alias", "arrayBuffer", "localScope", "loadLibData", "data", "dataSize", "libData", "libFile", "getExports", "moduleLoaded", "entry", "id", "callback", "lib", "implicit", "which", "timeout_ms", "oldHeapSize", "requestedSize", "oldSize", "maxHeapSize", "cutDown", "overGrownHeapSize", "newSize", "replacement", "isLexMessage", "messageAddress", "inputBufferAddress", "maxCodeUnits", "index", "row", "column", "lengthAddress", "source", "isString", "chunk", "remaining", "last", "base", "currentOffset", "hasError", "c", "heap", "outIdx", "maxBytesToWrite", "startIdx", "endIdx", "u", "outPtr", "sz", "wasmExports", "a1", "a2", "a3", "entryFunction", "argc", "argv", "argv_ptr", "arg", "doRun", "noInitialRun", "web_tree_sitter_default", "Module", "initializeBinding", "options", "wasmModule", "moduleOptions", "web_tree_sitter_default", "instantiationFailure", "_", "reject", "imports", "receiveInstance", "instance", "checkModule", "TWO_POW_32", "TRANSFER_BUFFER", "LANGUAGE_VERSION", "MIN_COMPATIBLE_VERSION", "assertSupportedLanguage", "language", "version", "C", "finalizer", "newFinalizer", "addresses", "Parser", "options", "setModule", "initializeBinding", "base", "checkModule", "address", "Language", "callback", "maxMemoryBytes", "validateMemoryLimit", "maxOperations", "validateOperationLimit", "progressCallback", "treeAddress", "Tree", "INTERNAL", "clearCallbacks", "rangeAddress", "rangeCount", "prepareRanges", "marshalParseInputs", "unmarshalOperationCount", "error", "unmarshalRanges", "ranges", "SIZE_OF_RANGE", "range", "marshalRange", "hasProgressCallback", "heapU32"]
7
7
  }