diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..cc140fb --- /dev/null +++ b/docs/index.html @@ -0,0 +1,96 @@ + + + + + + + Tree-sitter TOML Playground + + + +
+
+ + + + +

Tree-sitter TOML v0.2.0

+ + + +
+ This playground was modified from the official Tree-sitter Playground. +
+ + + + + + + + + + +
+
+ + + + diff --git a/docs/tree-sitter-0.15.7/LICENSE b/docs/tree-sitter-0.15.7/LICENSE new file mode 100644 index 0000000..971b81f --- /dev/null +++ b/docs/tree-sitter-0.15.7/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 Max Brunsfeld + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/docs/tree-sitter-0.15.7/playground.js b/docs/tree-sitter-0.15.7/playground.js new file mode 100644 index 0000000..1b151e4 --- /dev/null +++ b/docs/tree-sitter-0.15.7/playground.js @@ -0,0 +1,279 @@ +let tree; + +(async () => { + const scriptURL = document.currentScript.getAttribute('src'); + const codeInput = document.getElementById('code-input'); + const languageSelect = document.getElementById('language-select'); + const loggingCheckbox = document.getElementById('logging-checkbox'); + const outputContainer = document.getElementById('output-container'); + const outputContainerScroll = document.getElementById('output-container-scroll'); + const updateTimeSpan = document.getElementById('update-time'); + const demoContainer = document.getElementById('playground-container'); + const languagesByName = {}; + + await TreeSitter.init(); + + const parser = new TreeSitter(); + const codeEditor = CodeMirror.fromTextArea(codeInput, { + lineNumbers: true, + showCursorWhenSelecting: true + }); + const cluster = new Clusterize({ + rows: [], + noDataText: null, + contentElem: outputContainer, + scrollElem: outputContainerScroll + }); + const renderTreeOnCodeChange = debounce(renderTree, 50); + + let languageName = languageSelect.value; + let treeRows = null; + let treeRowHighlightedIndex = -1; + let parseCount = 0; + let isRendering = 0; + + codeEditor.on('changes', handleCodeChange); + codeEditor.on('cursorActivity', debounce(handleCursorMovement, 150)); + loggingCheckbox.addEventListener('change', handleLoggingChange); + languageSelect.addEventListener('change', handleLanguageChange); + outputContainer.addEventListener('click', handleTreeClick); + + await handleLanguageChange() + + demoContainer.style.visibility = 'visible'; + + async function handleLanguageChange() { + const newLanguageName = languageSelect.value; + if (!languagesByName[newLanguageName]) { + const url = `${LANGUAGE_BASE_URL}/tree-sitter-${newLanguageName}.wasm` + languageSelect.disabled = true; + try { + languagesByName[newLanguageName] = await TreeSitter.Language.load(url); + } catch (e) { + console.error(e); + languageSelect.value = languageName; + return + } finally { + languageSelect.disabled = false; + } + } + + tree = null; + languageName = newLanguageName; + parser.setLanguage(languagesByName[newLanguageName]); + handleCodeChange(); + } + + async function handleCodeChange(editor, changes) { + const newText = codeEditor.getValue() + '\n'; + + const start = performance.now(); + if (tree && changes) { + for (const change of changes) { + tree.edit(treeEditForEditorChange(change)); + } + } + const newTree = parser.parse(newText, tree); + const duration = (performance.now() - start).toFixed(1); + + updateTimeSpan.innerText = `${duration} ms`; + if (tree) tree.delete(); + tree = newTree; + parseCount++; + renderTreeOnCodeChange(); + } + + async function renderTree() { + isRendering++; + const cursor = tree.walk(); + + let currentRenderCount = parseCount; + let row = ''; + let rows = []; + let finishedRow = false; + let visitedChildren = false; + let indentLevel = 0; + + for (let i = 0;; i++) { + if (i > 0 && i % 10000 === 0) { + await new Promise(r => setTimeout(r, 0)); + if (parseCount !== currentRenderCount) { + cursor.delete(); + isRendering--; + return; + } + } + + let displayName; + if (cursor.nodeIsMissing) { + displayName = `MISSING ${cursor.nodeType}` + } else if (cursor.nodeIsNamed) { + displayName = cursor.nodeType; + } + + if (visitedChildren) { + if (displayName) { + finishedRow = true; + } + + if (cursor.gotoNextSibling()) { + visitedChildren = false; + } else if (cursor.gotoParent()) { + visitedChildren = true; + indentLevel--; + } else { + break; + } + } else { + if (displayName) { + if (finishedRow) { + row += ''; + rows.push(row); + finishedRow = false; + } + const start = cursor.startPosition; + const end = cursor.endPosition; + const id = cursor.nodeId; + let fieldName = cursor.currentFieldName(); + if (fieldName) { + fieldName += ': '; + } else { + fieldName = ''; + } + row = `
${' '.repeat(indentLevel)}${fieldName}${displayName} [${start.row}, ${start.column}] - [${end.row}, ${end.column}])`; + finishedRow = true; + } + + if (cursor.gotoFirstChild()) { + visitedChildren = false; + indentLevel++; + } else { + visitedChildren = true; + } + } + } + if (finishedRow) { + row += '
'; + rows.push(row); + } + + cursor.delete(); + cluster.update(rows); + treeRows = rows; + isRendering--; + handleCursorMovement(); + } + + function handleCursorMovement() { + if (isRendering) return; + + const selection = codeEditor.getDoc().listSelections()[0]; + let start = {row: selection.anchor.line, column: selection.anchor.ch}; + let end = {row: selection.head.line, column: selection.head.ch}; + if ( + start.row > end.row || + ( + start.row === end.row && + start.column > end.column + ) + ) { + let swap = end; + end = start; + start = swap; + } + const node = tree.rootNode.namedDescendantForPosition(start, end); + if (treeRows) { + if (treeRowHighlightedIndex !== -1) { + const row = treeRows[treeRowHighlightedIndex]; + if (row) treeRows[treeRowHighlightedIndex] = row.replace('highlighted', 'plain'); + } + treeRowHighlightedIndex = treeRows.findIndex(row => row.includes(`data-id=${node.id}`)); + if (treeRowHighlightedIndex !== -1) { + const row = treeRows[treeRowHighlightedIndex]; + if (row) treeRows[treeRowHighlightedIndex] = row.replace('plain', 'highlighted'); + } + cluster.update(treeRows); + const lineHeight = cluster.options.item_height; + const scrollTop = outputContainerScroll.scrollTop; + const containerHeight = outputContainerScroll.clientHeight; + const offset = treeRowHighlightedIndex * lineHeight; + if (scrollTop > offset - 20) { + $(outputContainerScroll).animate({scrollTop: offset - 20}, 150); + } else if (scrollTop < offset + lineHeight + 40 - containerHeight) { + $(outputContainerScroll).animate({scrollTop: offset - containerHeight + 40}, 150); + } + } + } + + function handleTreeClick(event) { + if (event.target.tagName === 'A') { + event.preventDefault(); + const [startRow, startColumn, endRow, endColumn] = event + .target + .dataset + .range + .split(',') + .map(n => parseInt(n)); + codeEditor.focus(); + codeEditor.setSelection( + {line: startRow, ch: startColumn}, + {line: endRow, ch: endColumn} + ); + } + } + + function handleLoggingChange() { + if (loggingCheckbox.checked) { + parser.setLogger((message, lexing) => { + if (lexing) { + console.log(" ", message) + } else { + console.log(message) + } + }); + } else { + parser.setLogger(null); + } + } + + function treeEditForEditorChange(change) { + const oldLineCount = change.removed.length; + const newLineCount = change.text.length; + const lastLineLength = change.text[newLineCount - 1].length; + + const startPosition = {row: change.from.line, column: change.from.ch}; + const oldEndPosition = {row: change.to.line, column: change.to.ch}; + const newEndPosition = { + row: startPosition.row + newLineCount - 1, + column: newLineCount === 1 + ? startPosition.column + lastLineLength + : lastLineLength + }; + + const startIndex = codeEditor.indexFromPos(change.from); + let newEndIndex = startIndex + newLineCount - 1; + let oldEndIndex = startIndex + oldLineCount - 1; + for (let i = 0; i < newLineCount; i++) newEndIndex += change.text[i].length; + for (let i = 0; i < oldLineCount; i++) oldEndIndex += change.removed[i].length; + + return { + startIndex, oldEndIndex, newEndIndex, + startPosition, oldEndPosition, newEndPosition + }; + } + + function debounce(func, wait, immediate) { + var timeout; + return function() { + var context = this, args = arguments; + var later = function() { + timeout = null; + if (!immediate) func.apply(context, args); + }; + var callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) func.apply(context, args); + }; + } +})(); diff --git a/docs/tree-sitter-0.15.7/style.css b/docs/tree-sitter-0.15.7/style.css new file mode 100644 index 0000000..1654441 --- /dev/null +++ b/docs/tree-sitter-0.15.7/style.css @@ -0,0 +1 @@ +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */@import url("https://fonts.googleapis.com/css?family=Open+Sans:400,700");html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}.highlight table td{padding:5px}.highlight table pre{margin:0}.highlight .cm{color:#999988;font-style:italic}.highlight .cp{color:#999999;font-weight:bold}.highlight .c1{color:#999988;font-style:italic}.highlight .cs{color:#999999;font-weight:bold;font-style:italic}.highlight .c,.highlight .cd{color:#999988;font-style:italic}.highlight .err{color:#a61717;background-color:#e3d2d2}.highlight .gd{color:#000000;background-color:#ffdddd}.highlight .ge{color:#000000;font-style:italic}.highlight .gr{color:#aa0000}.highlight .gh{color:#999999}.highlight .gi{color:#000000;background-color:#ddffdd}.highlight .go{color:#888888}.highlight .gp{color:#555555}.highlight .gs{font-weight:bold}.highlight .gu{color:#aaaaaa}.highlight .gt{color:#aa0000}.highlight .kc{color:#000000;font-weight:bold}.highlight .kd{color:#000000;font-weight:bold}.highlight .kn{color:#000000;font-weight:bold}.highlight .kp{color:#000000;font-weight:bold}.highlight .kr{color:#000000;font-weight:bold}.highlight .kt{color:#445588;font-weight:bold}.highlight .k,.highlight .kv{color:#000000;font-weight:bold}.highlight .mf{color:#009999}.highlight .mh{color:#009999}.highlight .il{color:#009999}.highlight .mi{color:#009999}.highlight .mo{color:#009999}.highlight .m,.highlight .mb,.highlight .mx{color:#009999}.highlight .sb{color:#d14}.highlight .sc{color:#d14}.highlight .sd{color:#d14}.highlight .s2{color:#d14}.highlight .se{color:#d14}.highlight .sh{color:#d14}.highlight .si{color:#d14}.highlight .sx{color:#d14}.highlight .sr{color:#009926}.highlight .s1{color:#d14}.highlight .ss{color:#990073}.highlight .s{color:#d14}.highlight .na{color:#008080}.highlight .bp{color:#999999}.highlight .nb{color:#0086B3}.highlight .nc{color:#445588;font-weight:bold}.highlight .no{color:#008080}.highlight .nd{color:#3c5d5d;font-weight:bold}.highlight .ni{color:#800080}.highlight .ne{color:#990000;font-weight:bold}.highlight .nf{color:#990000;font-weight:bold}.highlight .nl{color:#990000;font-weight:bold}.highlight .nn{color:#555555}.highlight .nt{color:#000080}.highlight .vc{color:#008080}.highlight .vg{color:#008080}.highlight .vi{color:#008080}.highlight .nv{color:#008080}.highlight .ow{color:#000000;font-weight:bold}.highlight .o{color:#000000;font-weight:bold}.highlight .w{color:#bbbbbb}.highlight{background-color:#f8f8f8}*{box-sizing:border-box}body{padding:0;margin:0;font-family:"Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;font-size:16px;line-height:1.5;color:#606c71}a{color:#1e6bb8;text-decoration:none}a:hover{text-decoration:underline}.btn{display:inline-block;margin-bottom:1rem;color:rgba(255,255,255,0.7);background-color:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.2);border-style:solid;border-width:1px;border-radius:0.3rem;transition:color 0.2s, background-color 0.2s, border-color 0.2s}.btn:hover{color:rgba(255,255,255,0.8);text-decoration:none;background-color:rgba(255,255,255,0.2);border-color:rgba(255,255,255,0.3)}.btn+.btn{margin-left:1rem}@media screen and (min-width: 64em){.btn{padding:0.75rem 1rem}}@media screen and (min-width: 42em) and (max-width: 64em){.btn{padding:0.6rem 0.9rem;font-size:0.9rem}}@media screen and (max-width: 42em){.btn{display:block;width:100%;padding:0.75rem;font-size:0.9rem}.btn+.btn{margin-top:1rem;margin-left:0}}.page-header{color:#fff;text-align:center;background-color:#159957;background-image:linear-gradient(120deg, #155799, #159957)}@media screen and (min-width: 64em){.page-header{padding:5rem 6rem}}@media screen and (min-width: 42em) and (max-width: 64em){.page-header{padding:3rem 4rem}}@media screen and (max-width: 42em){.page-header{padding:2rem 1rem}}.project-name{margin-top:0;margin-bottom:0.1rem}@media screen and (min-width: 64em){.project-name{font-size:3.25rem}}@media screen and (min-width: 42em) and (max-width: 64em){.project-name{font-size:2.25rem}}@media screen and (max-width: 42em){.project-name{font-size:1.75rem}}.project-tagline{margin-bottom:2rem;font-weight:normal;opacity:0.7}@media screen and (min-width: 64em){.project-tagline{font-size:1.25rem}}@media screen and (min-width: 42em) and (max-width: 64em){.project-tagline{font-size:1.15rem}}@media screen and (max-width: 42em){.project-tagline{font-size:1rem}}.main-content{word-wrap:break-word}.main-content :first-child{margin-top:0}@media screen and (min-width: 64em){.main-content{max-width:64rem;padding:2rem 6rem;margin:0 auto;font-size:1.1rem}}@media screen and (min-width: 42em) and (max-width: 64em){.main-content{padding:2rem 4rem;font-size:1.1rem}}@media screen and (max-width: 42em){.main-content{padding:2rem 1rem;font-size:1rem}}.main-content img{max-width:100%}.main-content h1,.main-content h2,.main-content h3,.main-content h4,.main-content h5,.main-content h6{margin-top:2rem;margin-bottom:1rem;font-weight:normal;color:#159957}.main-content p{margin-bottom:1em}.main-content code{padding:2px 4px;font-family:Consolas, "Liberation Mono", Menlo, Courier, monospace;font-size:0.9rem;color:#567482;background-color:#f3f6fa;border-radius:0.3rem}.main-content pre{padding:0.8rem;margin-top:0;margin-bottom:1rem;font:1rem Consolas, "Liberation Mono", Menlo, Courier, monospace;color:#567482;word-wrap:normal;background-color:#f3f6fa;border:solid 1px #dce6f0;border-radius:0.3rem}.main-content pre>code{padding:0;margin:0;font-size:0.9rem;color:#567482;word-break:normal;white-space:pre;background:transparent;border:0}.main-content .highlight{margin-bottom:1rem}.main-content .highlight pre{margin-bottom:0;word-break:normal}.main-content .highlight pre,.main-content pre{padding:0.8rem;overflow:auto;font-size:0.9rem;line-height:1.45;border-radius:0.3rem;-webkit-overflow-scrolling:touch}.main-content pre code,.main-content pre tt{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}.main-content pre code:before,.main-content pre code:after,.main-content pre tt:before,.main-content pre tt:after{content:normal}.main-content ul,.main-content ol{margin-top:0}.main-content blockquote{padding:0 1rem;margin-left:0;color:#819198;border-left:0.3rem solid #dce6f0}.main-content blockquote>:first-child{margin-top:0}.main-content blockquote>:last-child{margin-bottom:0}.main-content table{display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all;-webkit-overflow-scrolling:touch}.main-content table th{font-weight:bold}.main-content table th,.main-content table td{padding:0.5rem 1rem;border:1px solid #e9ebec}.main-content dl{padding:0}.main-content dl dt{padding:0;margin-top:1rem;font-size:1rem;font-weight:bold}.main-content dl dd{padding:0;margin-bottom:1rem}.main-content hr{height:2px;padding:0;margin:1rem 0;background-color:#eff0f1;border:0}.site-footer{padding-top:2rem;margin-top:2rem;border-top:solid 1px #eff0f1}@media screen and (min-width: 64em){.site-footer{font-size:1rem}}@media screen and (min-width: 42em) and (max-width: 64em){.site-footer{font-size:1rem}}@media screen and (max-width: 42em){.site-footer{font-size:0.9rem}}.site-footer-owner{display:block;font-weight:bold}.site-footer-credits{color:#819198}body{overflow:scroll}#container{position:relative;max-width:1024px;margin:0 auto}#main-content,#sidebar{padding:20px 0}#sidebar{position:fixed;background:white;top:0;bottom:0;width:300px;overflow-y:auto;border-right:1px solid #ccc;z-index:1}#sidebar-toggle-link{font-size:24px;position:fixed;background-color:white;opacity:0.75;box-shadow:1px 1px 5px #aaa;left:300px;padding:5px 10px;display:none;z-index:100;text-decoration:none !important;color:#aaa}#main-content{position:relative;padding:20px;padding-left:320px}.nav-link.active{text-decoration:underline}.table-of-contents-section{border-bottom:1px solid #ccc}.logo{display:block}.table-of-contents-section.active{background-color:#edffcb}.table-of-contents-section{padding:10px 20px}#table-of-contents ul{padding:0;margin:0}#table-of-contents li{display:block;padding:5px 20px}@media (max-width: 900px){#sidebar{left:0;transition:left 0.25s}#sidebar-toggle-link{display:block;transition:left 0.25s}#main-content{left:300px;padding-left:20px;transition:left 0.25s}body.sidebar-hidden #sidebar{left:-300px}body.sidebar-hidden #main-content{left:0}body.sidebar-hidden #sidebar-toggle-link{left:0}}#playground-container>.CodeMirror{height:auto;max-height:350px;border:1px solid #aaa}#playground-container .CodeMirror-scroll{height:auto;max-height:350px}#playground-container h4,#playground-container select,#playground-container .field{display:inline-block;margin-right:20px}#playground-container #logging-checkbox{height:15px}#playground-container .CodeMirror div.CodeMirror-cursor{border-left:3px solid red}#output-container{padding:0 10px;margin:0}#output-container-scroll{padding:0;position:relative;margin-top:0;overflow:auto;max-height:350px;border:1px solid #aaa}a.highlighted{background-color:#ddd;text-decoration:underline} diff --git a/docs/tree-sitter-0.15.7/tree-sitter.js b/docs/tree-sitter-0.15.7/tree-sitter.js new file mode 100644 index 0000000..7fa7187 --- /dev/null +++ b/docs/tree-sitter-0.15.7/tree-sitter.js @@ -0,0 +1 @@ +var Module=void 0!==Module?Module:{};!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():window.TreeSitter=t()}(0,function(){var e,t={};for(e in Module)Module.hasOwnProperty(e)&&(t[e]=Module[e]);Module.arguments=[],Module.thisProgram="./this.program",Module.quit=function(e,t){throw t},Module.preRun=[],Module.postRun=[];var n,r=!1,a=!1,i=!1;r="object"==typeof window,a="function"==typeof importScripts,i="object"==typeof process&&"function"==typeof require&&!r&&!a,n=!r&&!i&&!a;var o,l,u="";i?(u=__dirname+"/",Module.read=function shell_read(e,t){var n;return o||(o=require("fs")),l||(l=require("path")),e=l.normalize(e),n=o.readFileSync(e),t?n:n.toString()},Module.readBinary=function readBinary(e){var t=Module.read(e,!0);return t.buffer||(t=new Uint8Array(t)),assert(t.buffer),t},process.argv.length>1&&(Module.thisProgram=process.argv[1].replace(/\\/g,"/")),Module.arguments=process.argv.slice(2),"undefined"!=typeof module&&(module.exports=Module),process.on("uncaughtException",function(e){if(!(e instanceof ExitStatus))throw e}),process.on("unhandledRejection",abort),Module.quit=function(e){process.exit(e)},Module.inspect=function(){return"[Emscripten Module object]"}):n?("undefined"!=typeof read&&(Module.read=function shell_read(e){return read(e)}),Module.readBinary=function readBinary(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(assert("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:void 0!==arguments&&(Module.arguments=arguments),"function"==typeof quit&&(Module.quit=function(e){quit(e)})):(r||a)&&(a?u=self.location.href:document.currentScript&&(u=document.currentScript.src),u=0!==u.indexOf("blob:")?u.substr(0,u.lastIndexOf("/")+1):"",Module.read=function shell_read(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},a&&(Module.readBinary=function readBinary(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),Module.readAsync=function readAsync(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function xhr_onload(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)},Module.setWindowTitle=function(e){document.title=e});var s=Module.print||("undefined"!=typeof console?console.log.bind(console):"undefined"!=typeof print?print:null),_=Module.printErr||("undefined"!=typeof printErr?printErr:"undefined"!=typeof console&&console.warn.bind(console)||s);for(e in t)t.hasOwnProperty(e)&&(Module[e]=t[e]);t=void 0;var d=16;function dynamicAlloc(e){var t=S[T>>2],n=t+e+15&-16;if(n<=_emscripten_get_heap_size())S[T>>2]=n;else if(!_emscripten_resize_heap(n))return 0;return t}function alignMemory(e,t){return t||(t=d),Math.ceil(e/t)*t}function getNativeTypeSize(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:if("*"===e[e.length-1])return 4;if("i"===e[0]){var t=parseInt(e.substr(1));return assert(t%8==0,"getNativeTypeSize invalid bits "+t+", type "+e),t/8}return 0}}var c={"f64-rem":function(e,t){return e%t},debugger:function(){}},m={nextHandle:1,loadedLibs:{"-1":{refcount:1/0,name:"__self__",module:Module,global:!0}},loadedLibNames:{__self__:-1}};function loadDynamicLibrary(e,t){t=t||{global:!0,nodelete:!0};var n,r=m.loadedLibNames[e];if(r)return n=m.loadedLibs[r],t.global&&!n.global&&(n.global=!0,"loading"!==n.module&&mergeLibSymbols(n.module)),t.nodelete&&n.refcount!==1/0&&(n.refcount=1/0),n.refcount++,t.loadAsync?Promise.resolve(r):r;function loadLibData(){if(t.fs){var n=t.fs.readFile(e,{encoding:"binary"});return n instanceof Uint8Array||(n=new Uint8Array(lib_data)),t.loadAsync?Promise.resolve(n):n}return t.loadAsync?function fetchBinary(e){return fetch(e,{credentials:"same-origin"}).then(function(t){if(!t.ok)throw"failed to load binary file at '"+e+"'";return t.arrayBuffer()}).then(function(e){return new Uint8Array(e)})}(e):Module.readBinary(e)}function createLibModule(e){return loadWebAssemblyModule(e,t)}function getLibModule(){if(void 0!==Module.preloadedWasm&&void 0!==Module.preloadedWasm[e]){var n=Module.preloadedWasm[e];return t.loadAsync?Promise.resolve(n):n}return t.loadAsync?loadLibData().then(function(e){return createLibModule(e)}):createLibModule(loadLibData())}function mergeLibSymbols(e){for(var t in e)if(e.hasOwnProperty(t)){var n=t;"_"===t[0]&&(Module.hasOwnProperty(n)||(Module[n]=e[t]))}}function moduleLoaded(e){n.global&&mergeLibSymbols(e),n.module=e}return r=m.nextHandle++,n={refcount:t.nodelete?1/0:1,name:e,module:"loading",global:t.global},m.loadedLibNames[e]=r,m.loadedLibs[r]=n,t.loadAsync?getLibModule().then(function(e){return moduleLoaded(e),r}):(moduleLoaded(getLibModule()),r)}function loadWebAssemblyModule(e,t){assert(1836278016==new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer)[0],"need to see wasm magic number"),assert(0===e[8],"need the dylink section to be first");var n=9;function getLEB(){for(var t=0,r=1;;){var a=e[n++];if(t+=(127&a)*r,r*=128,!(128&a))break}return t}getLEB();assert(6===e[n]),assert(e[++n]==="d".charCodeAt(0)),assert(e[++n]==="y".charCodeAt(0)),assert(e[++n]==="l".charCodeAt(0)),assert(e[++n]==="i".charCodeAt(0)),assert(e[++n]==="n".charCodeAt(0)),assert(e[++n]==="k".charCodeAt(0)),n++;for(var r=getLEB(),a=getLEB(),i=getLEB(),o=getLEB(),l=getLEB(),u=[],s=0;s>0];case"i16":return E[e>>1];case"i32":case"i64":return S[e>>2];case"float":return N[e>>2];case"double":return A[e>>3];default:abort("invalid type for getValue: "+t)}return null}h=alignMemory(h,16),"object"!=typeof WebAssembly&&_("no native wasm support detected");var g=!1;function assert(e,t){e||abort("Assertion failed: "+t)}function setValue(e,t,n,r){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":v[e>>0]=t;break;case"i16":E[e>>1]=t;break;case"i32":S[e>>2]=t;break;case"i64":tempI64=[t>>>0,(tempDouble=t,+P(tempDouble)>=1?tempDouble>0?(0|B(+U(tempDouble/4294967296),4294967295))>>>0:~~+k((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],S[e>>2]=tempI64[0],S[e+4>>2]=tempI64[1];break;case"float":N[e>>2]=t;break;case"double":A[e>>3]=t;break;default:abort("invalid type for setValue: "+n)}}var M=3;function getMemory(e){return L?Q(e):dynamicAlloc(e)}var b="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function UTF8ArrayToString(e,t,n){for(var r=t+n,a=t;e[a]&&!(a>=r);)++a;if(a-t>16&&e.subarray&&b)return b.decode(e.subarray(t,a));for(var i="";t>10,56320|1023&s)}}else i+=String.fromCharCode((31&o)<<6|l)}else i+=String.fromCharCode(o)}return i}function UTF8ToString(e,t){return e?UTF8ArrayToString(C,e,t):""}function stringToUTF8Array(e,t,n,r){if(!(r>0))return 0;for(var a=n,i=n+r-1,o=0;o=55296&&l<=57343)l=65536+((1023&l)<<10)|1023&e.charCodeAt(++o);if(l<=127){if(n>=i)break;t[n++]=l}else if(l<=2047){if(n+1>=i)break;t[n++]=192|l>>6,t[n++]=128|63&l}else if(l<=65535){if(n+2>=i)break;t[n++]=224|l>>12,t[n++]=128|l>>6&63,t[n++]=128|63&l}else{if(n+3>=i)break;t[n++]=240|l>>18,t[n++]=128|l>>12&63,t[n++]=128|l>>6&63,t[n++]=128|63&l}}return t[n]=0,n-a}function lengthBytesUTF8(e){for(var t=0,n=0;n=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:4}return t}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");function allocateUTF8OnStack(e){var t=lengthBytesUTF8(e)+1,n=te(t);return stringToUTF8Array(e,v,n,t),n}var w,v,C,E,S,N,A;function alignUp(e,t){return e%t>0&&(e+=t-e%t),e}function updateGlobalBufferViews(){Module.HEAP8=v=new Int8Array(w),Module.HEAP16=E=new Int16Array(w),Module.HEAP32=S=new Int32Array(w),Module.HEAPU8=C=new Uint8Array(w),Module.HEAPU16=new Uint16Array(w),Module.HEAPU32=new Uint32Array(w),Module.HEAPF32=N=new Float32Array(w),Module.HEAPF64=A=new Float64Array(w)}var T=28848,D=Module.TOTAL_MEMORY||33554432;function callRuntimeCallbacks(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?Module.dynCall_v(n):Module.dynCall_vi(n,t.arg):n(void 0===t.arg?null:t.arg)}else t()}}D<5242880&&_("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+D+"! (TOTAL_STACK=5242880)"),Module.buffer?w=Module.buffer:"object"==typeof WebAssembly&&"function"==typeof WebAssembly.Memory?(f=new WebAssembly.Memory({initial:D/65536}),w=f.buffer):w=new ArrayBuffer(D),updateGlobalBufferViews(),S[T>>2]=5271760;var I=[],F=[],x=[],R=[],L=!1;function ensureInitRuntime(){L||(L=!0,callRuntimeCallbacks(F))}function addOnPreRun(e){I.unshift(e)}var P=Math.abs,k=Math.ceil,U=Math.floor,B=Math.min,V=0,W=null,O=null;function addRunDependency(e){V++,Module.monitorRunDependencies&&Module.monitorRunDependencies(V)}function removeRunDependency(e){if(V--,Module.monitorRunDependencies&&Module.monitorRunDependencies(V),0==V&&(null!==W&&(clearInterval(W),W=null),O)){var t=O;O=null,t()}}Module.preloadedImages={},Module.preloadedAudios={},Module.preloadedWasm={},addOnPreRun(function(){if(Module.dynamicLibraries&&Module.dynamicLibraries.length>0&&!Module.readBinary)return addRunDependency(),void Promise.all(Module.dynamicLibraries.map(function(e){return loadDynamicLibrary(e,{loadAsync:!0,global:!0,nodelete:!0})})).then(function(){removeRunDependency()});!function loadDynamicLibraries(e){e&&e.forEach(function(e){loadDynamicLibrary(e,{global:!0,nodelete:!0})})}(Module.dynamicLibraries)});var Y="data:application/octet-stream;base64,";function isDataURI(e){return String.prototype.startsWith?e.startsWith(Y):0===e.indexOf(Y)}var z="tree-sitter.wasm";function getBinary(){try{if(Module.wasmBinary)return new Uint8Array(Module.wasmBinary);if(Module.readBinary)return Module.readBinary(z);throw"both async and sync fetching of the wasm failed"}catch(e){abort(e)}}function createWasm(e){var t={env:e,global:{NaN:NaN,Infinity:1/0},"global.Math":Math,asm2wasm:c};function receiveInstance(e,t){var n=e.exports;Module.asm=n,removeRunDependency()}if(addRunDependency(),Module.instantiateWasm)try{return Module.instantiateWasm(t,receiveInstance)}catch(e){return _("Module.instantiateWasm callback failed with error: "+e),!1}function receiveInstantiatedSource(e){receiveInstance(e.instance)}function instantiateArrayBuffer(e){(function getBinaryPromise(){return Module.wasmBinary||!r&&!a||"function"!=typeof fetch?new Promise(function(e,t){e(getBinary())}):fetch(z,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+z+"'";return e.arrayBuffer()}).catch(function(){return getBinary()})})().then(function(e){return WebAssembly.instantiate(e,t)}).then(e,function(e){_("failed to asynchronously prepare wasm: "+e),abort(e)})}return Module.wasmBinary||"function"!=typeof WebAssembly.instantiateStreaming||isDataURI(z)||"function"!=typeof fetch?instantiateArrayBuffer(receiveInstantiatedSource):WebAssembly.instantiateStreaming(fetch(z,{credentials:"same-origin"}),t).then(receiveInstantiatedSource,function(e){_("wasm streaming compile failed: "+e),_("falling back to ArrayBuffer instantiation"),instantiateArrayBuffer(receiveInstantiatedSource)}),{}}isDataURI(z)||(z=function locateFile(e){return Module.locateFile?Module.locateFile(e,u):u+e}(z)),Module.asm=function(e,t,n){return t.memory=f,t.table=p=new WebAssembly.Table({initial:512,element:"anyfunc"}),t.__memory_base=1024,t.__table_base=0,createWasm(t)},F.push({func:function(){ee()}});function ___assert_fail(e,t,n,r){abort("Assertion failed: "+UTF8ToString(e)+", at: "+[t?UTF8ToString(t):"unknown filename",n,r?UTF8ToString(r):"unknown function"])}function ___setErrNo(e){return Module.___errno_location&&(S[Module.___errno_location()>>2]=e),e}Module.___assert_fail=___assert_fail;var Z={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var n=0,r=e.length-1;r>=0;r--){var a=e[r];"."===a?e.splice(r,1):".."===a?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),n="/"===e.substr(-1);return(e=Z.normalizeArray(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=Z.splitPath(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},basename:function(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)},extname:function(e){return Z.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return Z.normalize(e.join("/"))},join2:function(e,t){return Z.normalize(e+"/"+t)}},j={DEFAULT_POLLMASK:5,mappings:{},umask:511,calculateAt:function(e,t){if("/"!==t[0]){var n;if(-100===e)n=FS.cwd();else{var r=FS.getStream(e);if(!r)throw new FS.ErrnoError(9);n=r.path}t=Z.join2(n,t)}return t},doStat:function(e,t,n){try{var r=e(t)}catch(e){if(e&&e.node&&Z.normalize(t)!==Z.normalize(FS.getPath(e.node)))return-20;throw e}return S[n>>2]=r.dev,S[n+4>>2]=0,S[n+8>>2]=r.ino,S[n+12>>2]=r.mode,S[n+16>>2]=r.nlink,S[n+20>>2]=r.uid,S[n+24>>2]=r.gid,S[n+28>>2]=r.rdev,S[n+32>>2]=0,tempI64=[r.size>>>0,(tempDouble=r.size,+P(tempDouble)>=1?tempDouble>0?(0|B(+U(tempDouble/4294967296),4294967295))>>>0:~~+k((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],S[n+40>>2]=tempI64[0],S[n+44>>2]=tempI64[1],S[n+48>>2]=4096,S[n+52>>2]=r.blocks,S[n+56>>2]=r.atime.getTime()/1e3|0,S[n+60>>2]=0,S[n+64>>2]=r.mtime.getTime()/1e3|0,S[n+68>>2]=0,S[n+72>>2]=r.ctime.getTime()/1e3|0,S[n+76>>2]=0,tempI64=[r.ino>>>0,(tempDouble=r.ino,+P(tempDouble)>=1?tempDouble>0?(0|B(+U(tempDouble/4294967296),4294967295))>>>0:~~+k((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],S[n+80>>2]=tempI64[0],S[n+84>>2]=tempI64[1],0},doMsync:function(e,t,n,r){var a=new Uint8Array(C.subarray(e,e+n));FS.msync(t,a,0,n,r)},doMkdir:function(e,t){return"/"===(e=Z.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),FS.mkdir(e,t,0),0},doMknod:function(e,t,n){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-22}return FS.mknod(e,t,n),0},doReadlink:function(e,t,n){if(n<=0)return-22;var r=FS.readlink(e),a=Math.min(n,lengthBytesUTF8(r)),i=v[t+a];return function stringToUTF8(e,t,n){return stringToUTF8Array(e,C,t,n)}(r,t,n+1),v[t+a]=i,a},doAccess:function(e,t){if(-8&t)return-22;var n;n=FS.lookupPath(e,{follow:!0}).node;var r="";return 4&t&&(r+="r"),2&t&&(r+="w"),1&t&&(r+="x"),r&&FS.nodePermissions(n,r)?-13:0},doDup:function(e,t,n){var r=FS.getStream(n);return r&&FS.close(r),FS.open(e,t,0,n,n).fd},doReadv:function(e,t,n,r){for(var a=0,i=0;i>2],l=S[t+(8*i+4)>>2],u=FS.read(e,v,o,l,r);if(u<0)return-1;if(a+=u,u>2],l=S[t+(8*i+4)>>2],u=FS.write(e,v,o,l,r);if(u<0)return-1;a+=u}return a},varargs:0,get:function(e){return j.varargs+=4,S[j.varargs-4>>2]},getStr:function(){return UTF8ToString(j.get())},getStreamFromFD:function(){var e=FS.getStream(j.get());if(!e)throw new FS.ErrnoError(9);return e},get64:function(){var e=j.get();j.get();return e},getZero:function(){j.get()}};function _abort(){Module.abort()}function _emscripten_get_now(){abort()}function _emscripten_get_heap_size(){return v.length}function _emscripten_resize_heap(e){var t=_emscripten_get_heap_size();if(e>2147418112)return!1;for(var n=Math.max(t,16777216);n0;){var r=__isLeapYear(n.getFullYear()),a=n.getMonth(),i=(r?K:q)[a];if(!(t>i-n.getDate()))return n.setDate(n.getDate()+t),n;t-=i-n.getDate()+1,n.setDate(1),a<11?n.setMonth(a+1):(n.setMonth(0),n.setFullYear(n.getFullYear()+1))}return n}function _strftime(e,t,n,r){var a=S[r+40>>2],i={tm_sec:S[r>>2],tm_min:S[r+4>>2],tm_hour:S[r+8>>2],tm_mday:S[r+12>>2],tm_mon:S[r+16>>2],tm_year:S[r+20>>2],tm_wday:S[r+24>>2],tm_yday:S[r+28>>2],tm_isdst:S[r+32>>2],tm_gmtoff:S[r+36>>2],tm_zone:a?UTF8ToString(a):""},o=UTF8ToString(n),l={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S"};for(var u in l)o=o.replace(new RegExp(u,"g"),l[u]);var s=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],_=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(e,t,n){for(var r="number"==typeof e?e.toString():e||"";r.length0?1:0}var n;return 0===(n=sgn(e.getFullYear()-t.getFullYear()))&&0===(n=sgn(e.getMonth()-t.getMonth()))&&(n=sgn(e.getDate()-t.getDate())),n}function getFirstWeekStartDate(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function getWeekBasedYear(e){var t=__addDays(new Date(e.tm_year+1900,0,1),e.tm_yday),n=new Date(t.getFullYear(),0,4),r=new Date(t.getFullYear()+1,0,4),a=getFirstWeekStartDate(n),i=getFirstWeekStartDate(r);return compareByDay(a,t)<=0?compareByDay(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var d={"%a":function(e){return s[e.tm_wday].substring(0,3)},"%A":function(e){return s[e.tm_wday]},"%b":function(e){return _[e.tm_mon].substring(0,3)},"%B":function(e){return _[e.tm_mon]},"%C":function(e){return leadingNulls((e.tm_year+1900)/100|0,2)},"%d":function(e){return leadingNulls(e.tm_mday,2)},"%e":function(e){return leadingSomething(e.tm_mday,2," ")},"%g":function(e){return getWeekBasedYear(e).toString().substring(2)},"%G":function(e){return getWeekBasedYear(e)},"%H":function(e){return leadingNulls(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),leadingNulls(t,2)},"%j":function(e){return leadingNulls(e.tm_mday+__arraySum(__isLeapYear(e.tm_year+1900)?K:q,e.tm_mon-1),3)},"%m":function(e){return leadingNulls(e.tm_mon+1,2)},"%M":function(e){return leadingNulls(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return leadingNulls(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return new Date(e.tm_year+1900,e.tm_mon+1,e.tm_mday,0,0,0,0).getDay()||7},"%U":function(e){var t=new Date(e.tm_year+1900,0,1),n=0===t.getDay()?t:__addDays(t,7-t.getDay()),r=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(compareByDay(n,r)<0){var a=__arraySum(__isLeapYear(r.getFullYear())?K:q,r.getMonth()-1)-31,i=31-n.getDate()+a+r.getDate();return leadingNulls(Math.ceil(i/7),2)}return 0===compareByDay(n,t)?"01":"00"},"%V":function(e){var t,n=new Date(e.tm_year+1900,0,4),r=new Date(e.tm_year+1901,0,4),a=getFirstWeekStartDate(n),i=getFirstWeekStartDate(r),o=__addDays(new Date(e.tm_year+1900,0,1),e.tm_yday);return compareByDay(o,a)<0?"53":compareByDay(i,o)<=0?"01":(t=a.getFullYear()=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(n?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var u in d)o.indexOf(u)>=0&&(o=o.replace(new RegExp(u,"g"),d[u](i)));var c=function intArrayFromString(e,t,n){var r=n>0?n:lengthBytesUTF8(e)+1,a=new Array(r),i=stringToUTF8Array(e,a,0,a.length);t&&(a.length=i);return a}(o,!1);return c.length>t?0:(function writeArrayToMemory(e,t){v.set(e,t)}(c,e),c.length-1)}_emscripten_get_now=i?function _emscripten_get_now_actual(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof dateNow?dateNow:"object"==typeof performance&&performance&&"function"==typeof performance.now?function(){return performance.now()}:Date.now;var G=h;function dynCall_X(e){return e|=0,mftCall_X(e)}function dynCall_i(e){return e|=0,0|mftCall_i(e)}function dynCall_ii(e,t){return e|=0,t|=0,0|mftCall_ii(e,0|t)}function dynCall_iidiiii(e,t,n,r,a,i,o){return e|=0,t|=0,n=+n,r|=0,a|=0,i|=0,o|=0,0|mftCall_iidiiii(e,0|t,+n,0|r,0|a,0|i,0|o)}function dynCall_iii(e,t,n){return e|=0,t|=0,n|=0,0|mftCall_iii(e,0|t,0|n)}function dynCall_iiii(e,t,n,r){return e|=0,t|=0,n|=0,r|=0,0|mftCall_iiii(e,0|t,0|n,0|r)}function dynCall_iiiii(e,t,n,r,a){return e|=0,t|=0,n|=0,r|=0,a|=0,0|mftCall_iiiii(e,0|t,0|n,0|r,0|a)}function dynCall_iiiiid(e,t,n,r,a,i){return e|=0,t|=0,n|=0,r|=0,a|=0,i=+i,0|mftCall_iiiiid(e,0|t,0|n,0|r,0|a,+i)}function dynCall_iiiiii(e,t,n,r,a,i){return e|=0,t|=0,n|=0,r|=0,a|=0,i|=0,0|mftCall_iiiiii(e,0|t,0|n,0|r,0|a,0|i)}function dynCall_iiiiiid(e,t,n,r,a,i,o){return e|=0,t|=0,n|=0,r|=0,a|=0,i|=0,o=+o,0|mftCall_iiiiiid(e,0|t,0|n,0|r,0|a,0|i,+o)}function dynCall_iiiiiii(e,t,n,r,a,i,o){return e|=0,t|=0,n|=0,r|=0,a|=0,i|=0,o|=0,0|mftCall_iiiiiii(e,0|t,0|n,0|r,0|a,0|i,0|o)}function dynCall_iiiiiiii(e,t,n,r,a,i,o,l){return e|=0,t|=0,n|=0,r|=0,a|=0,i|=0,o|=0,l|=0,0|mftCall_iiiiiiii(e,0|t,0|n,0|r,0|a,0|i,0|o,0|l)}function dynCall_iiiiiiiii(e,t,n,r,a,i,o,l,u){return e|=0,t|=0,n|=0,r|=0,a|=0,i|=0,o|=0,l|=0,u|=0,0|mftCall_iiiiiiiii(e,0|t,0|n,0|r,0|a,0|i,0|o,0|l,0|u)}function dynCall_v(e){e|=0,mftCall_v(e)}function dynCall_vi(e,t){e|=0,t|=0,mftCall_vi(e,0|t)}function dynCall_vii(e,t,n){e|=0,t|=0,n|=0,mftCall_vii(e,0|t,0|n)}function dynCall_viii(e,t,n,r){e|=0,t|=0,n|=0,r|=0,mftCall_viii(e,0|t,0|n,0|r)}function dynCall_viiii(e,t,n,r,a){e|=0,t|=0,n|=0,r|=0,a|=0,mftCall_viiii(e,0|t,0|n,0|r,0|a)}function dynCall_viiiii(e,t,n,r,a,i){e|=0,t|=0,n|=0,r|=0,a|=0,i|=0,mftCall_viiiii(e,0|t,0|n,0|r,0|a,0|i)}function dynCall_viiiiii(e,t,n,r,a,i,o){e|=0,t|=0,n|=0,r|=0,a|=0,i|=0,o|=0,mftCall_viiiiii(e,0|t,0|n,0|r,0|a,0|i,0|o)}var X={I:abort,j:function(e){y=e},h:function(){return y},g:___assert_fail,v:function ___cxa_pure_virtual(){throw g=!0,"Pure virtual function called!"},p:function ___lock(){},u:function ___map_file(e,t){return ___setErrNo(1),-1},o:___setErrNo,t:function ___syscall140(e,t){j.varargs=t;try{var n=j.getStreamFromFD(),r=j.get(),a=j.get(),i=j.get(),o=j.get();if(!(-1==r&&a<0||0==r&&a>=0))return-75;var l=a;return FS.llseek(n,l,o),tempI64=[n.position>>>0,(tempDouble=n.position,+P(tempDouble)>=1?tempDouble>0?(0|B(+U(tempDouble/4294967296),4294967295))>>>0:~~+k((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],S[i>>2]=tempI64[0],S[i+4>>2]=tempI64[1],n.getdents&&0===l&&0===o&&(n.getdents=null),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}},s:function ___syscall145(e,t){j.varargs=t;try{var n=j.getStreamFromFD(),r=j.get(),a=j.get();return j.doReadv(n,r,a)}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}},r:function ___syscall146(e,t){j.varargs=t;try{var n=j.getStreamFromFD(),r=j.get(),a=j.get();return j.doWritev(n,r,a)}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}},H:function ___syscall54(e,t){j.varargs=t;try{var n=j.getStreamFromFD(),r=j.get();switch(r){case 21509:case 21505:return n.tty?0:-25;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return n.tty?0:-25;case 21519:if(!n.tty)return-25;var a=j.get();return S[a>>2]=0,0;case 21520:return n.tty?-22:-25;case 21531:return a=j.get(),FS.ioctl(n,r,a);case 21523:case 21524:return n.tty?0:-25;default:abort("bad ioctl syscall "+r)}}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}},G:function ___syscall6(e,t){j.varargs=t;try{var n=j.getStreamFromFD();return FS.close(n),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}},F:function ___syscall91(e,t){j.varargs=t;try{var n=j.get(),r=j.get(),a=j.mappings[n];if(!a)return 0;if(r===a.len){var i=FS.getStream(a.fd);j.doMsync(n,i,r,a.flags),FS.munmap(i),j.mappings[n]=null,a.allocated&&J(a.malloc)}return 0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}},n:function ___unlock(){},i:_abort,q:function _clock_gettime(e,t){var n;if(0===e)n=Date.now();else{if(1!==e||!function _emscripten_get_now_is_monotonic(){return i||"undefined"!=typeof dateNow||"object"==typeof performance&&performance&&"function"==typeof performance.now}())return ___setErrNo(22),-1;n=_emscripten_get_now()}return S[t>>2]=n/1e3|0,S[t+4>>2]=n%1e3*1e3*1e3|0,0},E:_emscripten_get_heap_size,D:function _emscripten_memcpy_big(e,t,n){C.set(C.subarray(t,t+n),e)},C:_emscripten_resize_heap,f:function _exit(e){exit(e)},m:function _getenv(e){return 0===e?0:(e=UTF8ToString(e),H.hasOwnProperty(e)?(_getenv.ret&&J(_getenv.ret),_getenv.ret=function allocateUTF8(e){var t=lengthBytesUTF8(e)+1,n=Q(t);return n&&stringToUTF8Array(e,v,n,t),n}(H[e]),_getenv.ret):0)},l:function _llvm_stackrestore(e){var t=_llvm_stacksave,n=t.LLVM_SAVEDSTACKS[e];t.LLVM_SAVEDSTACKS.splice(e,1),ne(n)},k:_llvm_stacksave,B:function _llvm_trap(){abort("trap!")},A:function _pthread_cond_wait(){return 0},z:function _strftime_l(e,t,n,r){return _strftime(e,t,n,r)},y:function _tree_sitter_log_callback(e,t,n){if(ge){const e=UTF8ToString(n);ge(e,0!==t)}},x:function _tree_sitter_parse_callback(e,t,n,r,a){var i=he(t,{row:n,column:r});"string"==typeof i?(setValue(a,i.length,"i32"),function stringToUTF16(e,t,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=t,a=(n-=2)<2*e.length?n/2:e.length,i=0;i>1]=o,t+=2}return E[t>>1]=0,t-r}(i,e,10240)):setValue(a,0,"i32")},w:function abortOnCannotGrowMemory(e){abort("OOM")},a:28864,b:T,c:G,d:0,e:28880},$=Module.asm({},X,w);Module.asm=$;Module.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=function(){return Module.asm.J.apply(null,arguments)},Module.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=function(){return Module.asm.K.apply(null,arguments)},Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=function(){return Module.asm.L.apply(null,arguments)},Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=function(){return Module.asm.M.apply(null,arguments)},Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=function(){return Module.asm.N.apply(null,arguments)},Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=function(){return Module.asm.O.apply(null,arguments)},Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_=function(){return Module.asm.P.apply(null,arguments)},Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=function(){return Module.asm.Q.apply(null,arguments)},Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=function(){return Module.asm.R.apply(null,arguments)},Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=function(){return Module.asm.S.apply(null,arguments)},Module.__ZdlPv=function(){return Module.asm.T.apply(null,arguments)},Module.__Znwm=function(){return Module.asm.U.apply(null,arguments)},Module._calloc=function(){return Module.asm.V.apply(null,arguments)};var J=Module._free=function(){return Module.asm.W.apply(null,arguments)},Q=(Module._iswalnum=function(){return Module.asm.X.apply(null,arguments)},Module._iswalpha=function(){return Module.asm.Y.apply(null,arguments)},Module._iswdigit=function(){return Module.asm.Z.apply(null,arguments)},Module._iswlower=function(){return Module.asm._.apply(null,arguments)},Module._iswspace=function(){return Module.asm.$.apply(null,arguments)},Module._malloc=function(){return Module.asm.aa.apply(null,arguments)}),ee=(Module._memchr=function(){return Module.asm.ba.apply(null,arguments)},Module._memcmp=function(){return Module.asm.ca.apply(null,arguments)},Module._memcpy=function(){return Module.asm.da.apply(null,arguments)},Module._strlen=function(){return Module.asm.ea.apply(null,arguments)},Module._towupper=function(){return Module.asm.fa.apply(null,arguments)},Module._ts_init=function(){return Module.asm.ga.apply(null,arguments)},Module._ts_language_field_count=function(){return Module.asm.ha.apply(null,arguments)},Module._ts_language_field_name_for_id=function(){return Module.asm.ia.apply(null,arguments)},Module._ts_language_symbol_count=function(){return Module.asm.ja.apply(null,arguments)},Module._ts_language_symbol_name=function(){return Module.asm.ka.apply(null,arguments)},Module._ts_language_symbol_type=function(){return Module.asm.la.apply(null,arguments)},Module._ts_language_version=function(){return Module.asm.ma.apply(null,arguments)},Module._ts_node_child_count_wasm=function(){return Module.asm.na.apply(null,arguments)},Module._ts_node_child_wasm=function(){return Module.asm.oa.apply(null,arguments)},Module._ts_node_children_wasm=function(){return Module.asm.pa.apply(null,arguments)},Module._ts_node_descendant_for_index_wasm=function(){return Module.asm.qa.apply(null,arguments)},Module._ts_node_descendant_for_position_wasm=function(){return Module.asm.ra.apply(null,arguments)},Module._ts_node_descendants_of_type_wasm=function(){return Module.asm.sa.apply(null,arguments)},Module._ts_node_end_index_wasm=function(){return Module.asm.ta.apply(null,arguments)},Module._ts_node_end_point_wasm=function(){return Module.asm.ua.apply(null,arguments)},Module._ts_node_has_changes_wasm=function(){return Module.asm.va.apply(null,arguments)},Module._ts_node_has_error_wasm=function(){return Module.asm.wa.apply(null,arguments)},Module._ts_node_is_missing_wasm=function(){return Module.asm.xa.apply(null,arguments)},Module._ts_node_is_named_wasm=function(){return Module.asm.ya.apply(null,arguments)},Module._ts_node_named_child_count_wasm=function(){return Module.asm.za.apply(null,arguments)},Module._ts_node_named_child_wasm=function(){return Module.asm.Aa.apply(null,arguments)},Module._ts_node_named_children_wasm=function(){return Module.asm.Ba.apply(null,arguments)},Module._ts_node_named_descendant_for_index_wasm=function(){return Module.asm.Ca.apply(null,arguments)},Module._ts_node_named_descendant_for_position_wasm=function(){return Module.asm.Da.apply(null,arguments)},Module._ts_node_next_named_sibling_wasm=function(){return Module.asm.Ea.apply(null,arguments)},Module._ts_node_next_sibling_wasm=function(){return Module.asm.Fa.apply(null,arguments)},Module._ts_node_parent_wasm=function(){return Module.asm.Ga.apply(null,arguments)},Module._ts_node_prev_named_sibling_wasm=function(){return Module.asm.Ha.apply(null,arguments)},Module._ts_node_prev_sibling_wasm=function(){return Module.asm.Ia.apply(null,arguments)},Module._ts_node_start_index_wasm=function(){return Module.asm.Ja.apply(null,arguments)},Module._ts_node_start_point_wasm=function(){return Module.asm.Ka.apply(null,arguments)},Module._ts_node_symbol_wasm=function(){return Module.asm.La.apply(null,arguments)},Module._ts_node_to_string_wasm=function(){return Module.asm.Ma.apply(null,arguments)},Module._ts_parser_delete=function(){return Module.asm.Na.apply(null,arguments)},Module._ts_parser_enable_logger_wasm=function(){return Module.asm.Oa.apply(null,arguments)},Module._ts_parser_new_wasm=function(){return Module.asm.Pa.apply(null,arguments)},Module._ts_parser_parse_wasm=function(){return Module.asm.Qa.apply(null,arguments)},Module._ts_parser_set_language=function(){return Module.asm.Ra.apply(null,arguments)},Module._ts_tree_cursor_current_field_id_wasm=function(){return Module.asm.Sa.apply(null,arguments)},Module._ts_tree_cursor_current_node_id_wasm=function(){return Module.asm.Ta.apply(null,arguments)},Module._ts_tree_cursor_current_node_is_missing_wasm=function(){return Module.asm.Ua.apply(null,arguments)},Module._ts_tree_cursor_current_node_is_named_wasm=function(){return Module.asm.Va.apply(null,arguments)},Module._ts_tree_cursor_current_node_type_id_wasm=function(){return Module.asm.Wa.apply(null,arguments)},Module._ts_tree_cursor_current_node_wasm=function(){return Module.asm.Xa.apply(null,arguments)},Module._ts_tree_cursor_delete_wasm=function(){return Module.asm.Ya.apply(null,arguments)},Module._ts_tree_cursor_end_index_wasm=function(){return Module.asm.Za.apply(null,arguments)},Module._ts_tree_cursor_end_position_wasm=function(){return Module.asm._a.apply(null,arguments)},Module._ts_tree_cursor_goto_first_child_wasm=function(){return Module.asm.$a.apply(null,arguments)},Module._ts_tree_cursor_goto_next_sibling_wasm=function(){return Module.asm.ab.apply(null,arguments)},Module._ts_tree_cursor_goto_parent_wasm=function(){return Module.asm.bb.apply(null,arguments)},Module._ts_tree_cursor_new_wasm=function(){return Module.asm.cb.apply(null,arguments)},Module._ts_tree_cursor_reset_wasm=function(){return Module.asm.db.apply(null,arguments)},Module._ts_tree_cursor_start_index_wasm=function(){return Module.asm.eb.apply(null,arguments)},Module._ts_tree_cursor_start_position_wasm=function(){return Module.asm.fb.apply(null,arguments)},Module._ts_tree_delete=function(){return Module.asm.gb.apply(null,arguments)},Module._ts_tree_edit_wasm=function(){return Module.asm.hb.apply(null,arguments)},Module._ts_tree_get_changed_ranges_wasm=function(){return Module.asm.ib.apply(null,arguments)},Module._ts_tree_root_node_wasm=function(){return Module.asm.jb.apply(null,arguments)},Module.globalCtors=function(){return Module.asm.Eb.apply(null,arguments)}),te=Module.stackAlloc=function(){return Module.asm.Fb.apply(null,arguments)},ne=Module.stackRestore=function(){return Module.asm.Gb.apply(null,arguments)},re=Module.stackSave=function(){return Module.asm.Hb.apply(null,arguments)},dynCall_X=Module.dynCall_X=function(){return Module.asm.kb.apply(null,arguments)},dynCall_i=Module.dynCall_i=function(){return Module.asm.lb.apply(null,arguments)},dynCall_ii=Module.dynCall_ii=function(){return Module.asm.mb.apply(null,arguments)},dynCall_iidiiii=Module.dynCall_iidiiii=function(){return Module.asm.nb.apply(null,arguments)},dynCall_iii=Module.dynCall_iii=function(){return Module.asm.ob.apply(null,arguments)},dynCall_iiii=Module.dynCall_iiii=function(){return Module.asm.pb.apply(null,arguments)},dynCall_iiiii=Module.dynCall_iiiii=function(){return Module.asm.qb.apply(null,arguments)},dynCall_iiiiid=Module.dynCall_iiiiid=function(){return Module.asm.rb.apply(null,arguments)},dynCall_iiiiii=Module.dynCall_iiiiii=function(){return Module.asm.sb.apply(null,arguments)},dynCall_iiiiiid=Module.dynCall_iiiiiid=function(){return Module.asm.tb.apply(null,arguments)},dynCall_iiiiiii=Module.dynCall_iiiiiii=function(){return Module.asm.ub.apply(null,arguments)},dynCall_iiiiiiii=Module.dynCall_iiiiiiii=function(){return Module.asm.vb.apply(null,arguments)},dynCall_iiiiiiiii=Module.dynCall_iiiiiiiii=function(){return Module.asm.wb.apply(null,arguments)},dynCall_v=Module.dynCall_v=function(){return Module.asm.xb.apply(null,arguments)},dynCall_vi=Module.dynCall_vi=function(){return Module.asm.yb.apply(null,arguments)},dynCall_vii=Module.dynCall_vii=function(){return Module.asm.zb.apply(null,arguments)},dynCall_viii=Module.dynCall_viii=function(){return Module.asm.Ab.apply(null,arguments)},dynCall_viiii=Module.dynCall_viiii=function(){return Module.asm.Bb.apply(null,arguments)},dynCall_viiiii=Module.dynCall_viiiii=function(){return Module.asm.Cb.apply(null,arguments)},dynCall_viiiiii=Module.dynCall_viiiiii=function(){return Module.asm.Db.apply(null,arguments)};Module.dynCall_X=dynCall_X,Module.dynCall_i=dynCall_i,Module.dynCall_ii=dynCall_ii,Module.dynCall_iidiiii=dynCall_iidiiii,Module.dynCall_iii=dynCall_iii,Module.dynCall_iiii=dynCall_iiii,Module.dynCall_iiiii=dynCall_iiiii,Module.dynCall_iiiiid=dynCall_iiiiid,Module.dynCall_iiiiii=dynCall_iiiiii,Module.dynCall_iiiiiid=dynCall_iiiiiid,Module.dynCall_iiiiiii=dynCall_iiiiiii,Module.dynCall_iiiiiiii=dynCall_iiiiiiii,Module.dynCall_iiiiiiiii=dynCall_iiiiiiiii,Module.dynCall_v=dynCall_v,Module.dynCall_vi=dynCall_vi,Module.dynCall_vii=dynCall_vii,Module.dynCall_viii=dynCall_viii,Module.dynCall_viiii=dynCall_viiii,Module.dynCall_viiiii=dynCall_viiiii,Module.dynCall_viiiiii=dynCall_viiiiii;var ae={_ZZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKvE5__fmt:18894,_ZZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwmE5__fmt:18905};for(var ie in ae)Module["_"+ie]=G+ae[ie];for(var ie in Module.NAMED_GLOBALS=ae,ae)!function(e){var t=Module["_"+e];Module["g$_"+e]=function(){return t}}(ie);function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_,Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev=Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev,Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED1Ev=Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev,Module.asm=$,Module.allocate=function allocate(e,t,n,r){var a,i;"number"==typeof e?(a=!0,i=e):(a=!1,i=e.length);var o,l="string"==typeof t?t:null;if(o=n==M?r:[Q,te,dynamicAlloc][n](Math.max(i,l?1:t.length)),a){var u;for(r=o,assert(0==(3&o)),u=o+(-4&i);r>2]=0;for(u=o+i;r>0]=0;return o}if("i8"===l)return e.subarray||e.slice?C.set(e,o):C.set(new Uint8Array(e),o),o;for(var s,_,d,c=0;c0||(!function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(I)}(),V>0||Module.calledRun||(Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),doRun()},1)):doRun()))}function exit(e,t){t&&Module.noExitRuntime&&0===e||(Module.noExitRuntime||(g=!0,e,function exitRuntime(){!0}(),Module.onExit&&Module.onExit(e)),Module.quit(e,new ExitStatus(e)))}function abort(e){throw Module.onAbort&&Module.onAbort(e),void 0!==e?(s(e),_(e),e=JSON.stringify(e)):e="",g=!0,1,"abort("+e+"). Build with -s ASSERTIONS=1 for more info."}if(O=function runCaller(){Module.calledRun||run(),Module.calledRun||(O=runCaller)},Module.callMain=function callMain(e){e=e||[],ensureInitRuntime();var t=e.length+1,n=te(4*(t+1));S[n>>2]=allocateUTF8OnStack(Module.thisProgram);for(var r=1;r>2)+r]=allocateUTF8OnStack(e[r-1]);S[(n>>2)+t]=0;try{exit(Module._main(t,n,0),!0)}catch(e){if(e instanceof ExitStatus)return;if("SimulateInfiniteLoop"==e)return void(Module.noExitRuntime=!0);var a=e;e&&"object"==typeof e&&e.stack&&(a=[e,e.stack]),_("exception thrown: "+a),Module.quit(1,e)}finally{!0}},Module.run=run,Module.abort=abort,Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var oe=!0;Module.noInitialRun&&(oe=!1),Module.noExitRuntime=!0,run();const le=Module,ue={},se=4,_e=5*se,de=2*se,ce=2*se+2*de,me={row:0,column:0};var fe,pe,ye,he,ge,Me=new Promise(e=>{Module.onRuntimeInitialized=e}).then(()=>{ye=le._ts_init(),fe=getValue(ye,"i32"),pe=getValue(ye+se,"i32")});class Parser{static init(){return Me}constructor(){if(null==ye)throw new Error("You must first call Parser.init() and wait for it to resolve.");le._ts_parser_new_wasm(),this[0]=getValue(ye,"i32"),this[1]=getValue(ye+se,"i32")}delete(){le._ts_parser_delete(this[0]),le._free(this[1])}setLanguage(e){let t;if(e){if(e.constructor!==Language)throw new Error("Argument must be a Language");{t=e[0];const n=le._ts_language_version(t);if(ne.slice(t));else{if("function"!=typeof e)throw new Error("Argument must be a string or a function");he=e}this.logCallback?(ge=this.logCallback,le._ts_parser_enable_logger_wasm(this[0],1)):(ge=null,le._ts_parser_enable_logger_wasm(this[0],0));let r=0,a=0;if(n&&n.includedRanges){r=n.includedRanges.length;let e=a=le._calloc(r,ce);for(let t=0;t0){let e=n;for(let n=0;n0){let n=t;for(let t=0;t0){let n=t;for(let t=0;t0){let e=l;for(let t=0;t>0];if(!n)return t;t+=String.fromCharCode(n)}}(e);return le._free(e),t}}class TreeCursor{constructor(e,t){if(e!==ue)throw new Error("Illegal constructor");this.tree=t,unmarshalTreeCursor(this)}delete(){marshalTreeCursor(this),le._ts_tree_cursor_delete_wasm(this.tree[0])}reset(e){marshalNode(e),marshalTreeCursor(this,ye+_e),le._ts_tree_cursor_reset_wasm(this.tree[0]),unmarshalTreeCursor(this)}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return marshalTreeCursor(this),le._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeId(){return marshalTreeCursor(this),le._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return marshalTreeCursor(this),1===le._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])}get nodeIsMissing(){return marshalTreeCursor(this),1===le._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])}get startPosition(){return marshalTreeCursor(this),le._ts_tree_cursor_start_position_wasm(this.tree[0]),unmarshalPoint(ye)}get endPosition(){return marshalTreeCursor(this),le._ts_tree_cursor_end_position_wasm(this.tree[0]),unmarshalPoint(ye)}get startIndex(){return marshalTreeCursor(this),le._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return marshalTreeCursor(this),le._ts_tree_cursor_end_index_wasm(this.tree[0])}currentNode(){return marshalTreeCursor(this),le._ts_tree_cursor_current_node_wasm(this.tree[0]),unmarshalNode(this.tree)}currentFieldName(){marshalTreeCursor(this);const e=le._ts_tree_cursor_current_field_id_wasm(this.tree[0]);return this.tree.language.fields[e]}gotoFirstChild(){marshalTreeCursor(this);const e=le._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===e}gotoNextSibling(){marshalTreeCursor(this);const e=le._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===e}gotoParent(){marshalTreeCursor(this);const e=le._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===e}}class Language{constructor(e,t){if(e!==ue)throw new Error("Illegal constructor");this[0]=t,this.types=new Array(le._ts_language_symbol_count(this[0]));for(let e=0,t=this.types.length;ee.arrayBuffer().then(t=>{if(e.ok)return new Uint8Array(t);{const n=new TextDecoder("utf-8").decode(t);throw new Error(`Language.load failed with status ${e.status}.\n\n${n}`)}}));return t.then(e=>loadWebAssemblyModule(e,{loadAsync:!0})).then(e=>{const t=e[Object.keys(e).find(e=>e.includes("tree_sitter_"))]();return new Language(ue,t)})}}function isPoint(e){return e&&"number"==typeof e.row&&"number"==typeof e.column}function marshalNode(e){let t=ye;for(let n=0;n<5;n++)setValue(t,e[n],"i32"),t+=se}function unmarshalNode(e,t=ye){const n=getValue(t,"i32");if(0===n)return null;const r=new Node(ue,e);r[0]=n,t+=se;for(let e=1;e<5;e++)r[e]=getValue(t,"i32"),t+=se;return r}function marshalTreeCursor(e,t=ye){setValue(t+0*se,e[0],"i32"),setValue(t+1*se,e[1],"i32"),setValue(t+2*se,e[2],"i32")}function unmarshalTreeCursor(e){e[0]=getValue(ye+0*se,"i32"),e[1]=getValue(ye+1*se,"i32"),e[2]=getValue(ye+2*se,"i32")}function marshalPoint(e,t){setValue(e,t.row,"i32"),setValue(e+se,t.column,"i32")}function unmarshalPoint(e){return{row:getValue(e,"i32"),column:getValue(e+se,"i32")}}function marshalRange(e,t){marshalPoint(e,t.startPosition),marshalPoint(e+=de,t.endPosition),setValue(e+=de,t.startIndex,"i32"),setValue(e+=se,t.endIndex,"i32"),e+=se}function unmarshalRange(e){const t={};return t.startPosition=unmarshalPoint(e),e+=de,t.endPosition=unmarshalPoint(e),e+=de,t.startIndex=getValue(e,"i32"),e+=se,t.endIndex=getValue(e,"i32"),t}return Parser.Language=Language,Parser}); diff --git a/docs/tree-sitter-0.15.7/tree-sitter.wasm b/docs/tree-sitter-0.15.7/tree-sitter.wasm new file mode 100644 index 0000000..bcbcc67 Binary files /dev/null and b/docs/tree-sitter-0.15.7/tree-sitter.wasm differ diff --git a/docs/tree-sitter-toml-0.2.0/tree-sitter-toml.wasm b/docs/tree-sitter-toml-0.2.0/tree-sitter-toml.wasm new file mode 100644 index 0000000..efa6478 Binary files /dev/null and b/docs/tree-sitter-toml-0.2.0/tree-sitter-toml.wasm differ