diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index b5303cf..0000000 --- a/.gitmodules +++ /dev/null @@ -1,8 +0,0 @@ -[submodule "tree-sitter"] - path = tree-sitter - url = https://github.com/ikatyang/tree-sitter - branch = v0.19.3-custom -[submodule "yaml-test-suite"] - path = yaml-test-suite - url = https://github.com/yaml/yaml-test-suite - branch = data diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 475f3ce..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,69 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -# [0.5.0](https://github.com/ikatyang/tree-sitter-yaml/compare/v0.4.1...v0.5.0) (2021-04-18) - - -### Features - -* expose `anchor_name`, `alias_name`, `&`, and `*` ([#24](https://github.com/ikatyang/tree-sitter-yaml/issues/24)) ([b77b438](https://github.com/ikatyang/tree-sitter-yaml/commit/b77b438)) - - - -## [0.4.1](https://github.com/ikatyang/tree-sitter-yaml/compare/v0.4.0...v0.4.1) (2021-03-21) - - -### Bug Fixes - -* add missing binding.gyp ([#21](https://github.com/ikatyang/tree-sitter-yaml/issues/21)) ([5976a87](https://github.com/ikatyang/tree-sitter-yaml/commit/5976a87)) - - - -# [0.4.0](https://github.com/ikatyang/tree-sitter-yaml/compare/v0.3.1...v0.4.0) (2021-03-14) - - -### ⚠ BREAKING CHANGES - -* require tree-sitter 0.19+ - - -### Features - -* upgrade to tree-sitter@0.19.3 ([#19](https://github.com/ikatyang/tree-sitter-yaml/issues/19)) ([32689b6](https://github.com/ikatyang/tree-sitter-yaml/commit/32689b6)) - - - -## [0.3.1](https://github.com/ikatyang/tree-sitter-yaml/compare/v0.3.0...v0.3.1) (2021-01-01) - - -### Bug Fixes - -* avoid accessing unowned memory ([#17](https://github.com/ikatyang/tree-sitter-yaml/issues/17)) ([45ecb42](https://github.com/ikatyang/tree-sitter-yaml/commit/45ecb42)) - - - -# [0.3.0](https://github.com/ikatyang/tree-sitter-yaml/compare/v0.2.0...v0.3.0) (2020-10-04) - - -### Features - -* support core schema ([#13](https://github.com/ikatyang/tree-sitter-yaml/issues/13)) ([6d74a6b](https://github.com/ikatyang/tree-sitter-yaml/commit/6d74a6b)) - - - -# [0.2.0](https://github.com/ikatyang/tree-sitter-yaml/compare/v0.1.0...v0.2.0) (2020-09-28) - - -### Features - -* expose literal tokens as anonymous nodes ([#11](https://github.com/ikatyang/tree-sitter-yaml/issues/11)) ([f75b1f9](https://github.com/ikatyang/tree-sitter-yaml/commit/f75b1f9)) - - - -## 0.1.0 (2019-08-31) - - -### Features - -* initial implementation ([f45f18f](https://github.com/ikatyang/tree-sitter-yaml/commit/f45f18f)) diff --git a/docs/assets/tree-sitter-playground-0.19.3/LICENSE b/docs/assets/tree-sitter-playground-0.19.3/LICENSE deleted file mode 100644 index 971b81f..0000000 --- a/docs/assets/tree-sitter-playground-0.19.3/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/assets/tree-sitter-playground-0.19.3/playground.js b/docs/assets/tree-sitter-playground-0.19.3/playground.js deleted file mode 100644 index b3c005a..0000000 --- a/docs/assets/tree-sitter-playground-0.19.3/playground.js +++ /dev/null @@ -1,469 +0,0 @@ -let tree; - -(async () => { - const CAPTURE_REGEX = /@\s*([\w\._-]+)/g; - const COLORS_BY_INDEX = [ - 'blue', - 'chocolate', - 'darkblue', - 'darkcyan', - 'darkgreen', - 'darkred', - 'darkslategray', - 'dimgray', - 'green', - 'indigo', - 'navy', - 'red', - 'sienna', - ]; - - 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 playgroundContainer = document.getElementById('playground-container'); - const queryCheckbox = document.getElementById('query-checkbox'); - const queryContainer = document.getElementById('query-container'); - const queryInput = document.getElementById('query-input'); - const updateTimeSpan = document.getElementById('update-time'); - const languagesByName = {}; - - loadState(); - - await TreeSitter.init(); - - const parser = new TreeSitter(); - const codeEditor = CodeMirror.fromTextArea(codeInput, { - lineNumbers: true, - showCursorWhenSelecting: true - }); - - const queryEditor = CodeMirror.fromTextArea(queryInput, { - lineNumbers: true, - showCursorWhenSelecting: true - }); - - const cluster = new Clusterize({ - rows: [], - noDataText: null, - contentElem: outputContainer, - scrollElem: outputContainerScroll - }); - const renderTreeOnCodeChange = debounce(renderTree, 50); - const saveStateOnChange = debounce(saveState, 2000); - const runTreeQueryOnChange = debounce(runTreeQuery, 50); - - let languageName = languageSelect.value; - let treeRows = null; - let treeRowHighlightedIndex = -1; - let parseCount = 0; - let isRendering = 0; - let query; - - codeEditor.on('changes', handleCodeChange); - codeEditor.on('viewportChange', runTreeQueryOnChange); - codeEditor.on('cursorActivity', debounce(handleCursorMovement, 150)); - queryEditor.on('changes', debounce(handleQueryChange, 150)); - - loggingCheckbox.addEventListener('change', handleLoggingChange); - queryCheckbox.addEventListener('change', handleQueryEnableChange); - languageSelect.addEventListener('change', handleLanguageChange); - outputContainer.addEventListener('click', handleTreeClick); - - handleQueryEnableChange(); - await handleLanguageChange() - - playgroundContainer.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(); - handleQueryChange(); - } - - async function handleCodeChange(editor, changes) { - const newText = codeEditor.getValue(); - const edits = tree && changes && changes.map(treeEditForEditorChange); - - const start = performance.now(); - if (edits) { - for (const edit of edits) { - tree.edit(edit); - } - } - 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(); - runTreeQueryOnChange(); - saveStateOnChange(); - } - - 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 runTreeQuery(_, startRow, endRow) { - if (endRow == null) { - const viewport = codeEditor.getViewport(); - startRow = viewport.from; - endRow = viewport.to; - } - - codeEditor.operation(() => { - const marks = codeEditor.getAllMarks(); - marks.forEach(m => m.clear()); - - if (tree && query) { - const captures = query.captures( - tree.rootNode, - {row: startRow, column: 0}, - {row: endRow, column: 0}, - ); - let lastNodeId; - for (const {name, node} of captures) { - if (node.id === lastNodeId) continue; - lastNodeId = node.id; - const {startPosition, endPosition} = node; - codeEditor.markText( - {line: startPosition.row, ch: startPosition.column}, - {line: endPosition.row, ch: endPosition.column}, - { - inclusiveLeft: true, - inclusiveRight: true, - css: `color: ${colorForCaptureName(name)}` - } - ); - } - } - }); - } - - function handleQueryChange() { - if (query) { - query.delete(); - query.deleted = true; - query = null; - } - - queryEditor.operation(() => { - queryEditor.getAllMarks().forEach(m => m.clear()); - if (!queryCheckbox.checked) return; - - const queryText = queryEditor.getValue(); - - try { - query = parser.getLanguage().query(queryText); - let match; - - let row = 0; - queryEditor.eachLine((line) => { - while (match = CAPTURE_REGEX.exec(line.text)) { - queryEditor.markText( - {line: row, ch: match.index}, - {line: row, ch: match.index + match[0].length}, - { - inclusiveLeft: true, - inclusiveRight: true, - css: `color: ${colorForCaptureName(match[1])}` - } - ); - } - row++; - }); - } catch (error) { - const startPosition = queryEditor.posFromIndex(error.index); - const endPosition = { - line: startPosition.line, - ch: startPosition.ch + (error.length || Infinity) - }; - - if (error.index === queryText.length) { - if (startPosition.ch > 0) { - startPosition.ch--; - } else if (startPosition.row > 0) { - startPosition.row--; - startPosition.column = Infinity; - } - } - - queryEditor.markText( - startPosition, - endPosition, - { - className: 'query-error', - inclusiveLeft: true, - inclusiveRight: true, - attributes: {title: error.message} - } - ); - } - }); - - runTreeQuery(); - saveQueryState(); - } - - 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 handleQueryEnableChange() { - if (queryCheckbox.checked) { - queryContainer.style.visibility = ''; - queryContainer.style.position = ''; - } else { - queryContainer.style.visibility = 'hidden'; - queryContainer.style.position = 'absolute'; - } - handleQueryChange(); - } - - 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 colorForCaptureName(capture) { - const id = query.captureNames.indexOf(capture); - return COLORS_BY_INDEX[id % COLORS_BY_INDEX.length]; - } - - function getLocalStorageItem(key) { - return localStorage.getItem(`${document.title}:${key}`); - } - - function setLocalStorageItem(key, value) { - localStorage.setItem(`${document.title}:${key}`, value); - } - - function loadState() { - const language = getLocalStorageItem("language"); - const sourceCode = getLocalStorageItem("sourceCode"); - const query = getLocalStorageItem("query"); - const queryEnabled = getLocalStorageItem("queryEnabled"); - if (language != null && sourceCode != null && query != null) { - queryInput.value = query; - codeInput.value = sourceCode; - languageSelect.value = language; - queryCheckbox.checked = (queryEnabled === 'true'); - } - } - - function saveState() { - setLocalStorageItem("language", languageSelect.value); - setLocalStorageItem("sourceCode", codeEditor.getValue()); - saveQueryState(); - } - - function saveQueryState() { - setLocalStorageItem("queryEnabled", queryCheckbox.checked); - setLocalStorageItem("query", queryEditor.getValue()); - } - - 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/assets/tree-sitter-playground-0.19.3/style.css b/docs/assets/tree-sitter-playground-0.19.3/style.css deleted file mode 100644 index 6e37df6..0000000 --- a/docs/assets/tree-sitter-playground-0.19.3/style.css +++ /dev/null @@ -1 +0,0 @@ -/*! normalize.css v3.0.2 | MIT License | git.io/normalize */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}a[href^="http"]:after{content:"";display:inline-block;transform:translate(0px, 2px);width:.9em;height:.9em;margin-left:3px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23777'%3E%3Cpath d='M20 3h-5a1 1 0 1 0 0 2h3L8 14a1 1 0 1 0 2 2l9-10v3a1 1 0 1 0 2 0V4a1 1 0 0 0-1-1zM5 3L3 5v14l2 2h14l2-2v-6a1 1 0 1 0-2 0v6H5V5h6a1 1 0 1 0 0-2H5z'/%3E%3C/svg%3E");background-size:cover}#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:0;overflow-y:auto;border-right:1px solid #ccc;z-index:1}#sidebar .github-repo{display:inline-block;padding-left:3.75em;font-size:.85em}#sidebar-toggle-link{font-size:24px;position:fixed;background-color:white;opacity:0.75;box-shadow:1px 1px 5px #aaa;left:0;padding:5px 10px;display:none;z-index:100;text-decoration:none !important;color:#aaa}#main-content{position:relative;padding:20px;padding-left:20px}.nav-link.active{text-decoration:underline}a>span{text-decoration:inherit}.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:0;padding-left:20px;transition:left 0.25s}body.sidebar-hidden #sidebar{left:0}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,#playground-container label{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}.query-error{text-decoration:underline red dashed} diff --git a/docs/assets/web-tree-sitter-0.19.3/LICENSE b/docs/assets/web-tree-sitter-0.19.3/LICENSE deleted file mode 100644 index 971b81f..0000000 --- a/docs/assets/web-tree-sitter-0.19.3/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/assets/web-tree-sitter-0.19.3/tree-sitter.js b/docs/assets/web-tree-sitter-0.19.3/tree-sitter.js deleted file mode 100644 index ee0e287..0000000 --- a/docs/assets/web-tree-sitter-0.19.3/tree-sitter.js +++ /dev/null @@ -1 +0,0 @@ -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]);var n,r,s=[],o="./this.program",_=function(e,t){throw t},a=!1,u=!1;a="object"==typeof window,u="function"==typeof importScripts,n="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,r=!a&&!n&&!u;var i,l,d,c,m,f="";n?(f=u?require("path").dirname(f)+"/":__dirname+"/",i=function(e,t){return c||(c=require("fs")),m||(m=require("path")),e=m.normalize(e),c.readFileSync(e,t?null:"utf8")},d=function(e){var t=i(e,!0);return t.buffer||(t=new Uint8Array(t)),N(t.buffer),t},process.argv.length>1&&(o=process.argv[1].replace(/\\/g,"/")),s=process.argv.slice(2),"undefined"!=typeof module&&(module.exports=Module),_=function(e){process.exit(e)},Module.inspect=function(){return"[Emscripten Module object]"}):r?("undefined"!=typeof read&&(i=function(e){return read(e)}),d=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(N("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?s=scriptArgs:void 0!==arguments&&(s=arguments),"function"==typeof quit&&(_=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(a||u)&&(u?f=self.location.href:"undefined"!=typeof document&&document.currentScript&&(f=document.currentScript.src),f=0!==f.indexOf("blob:")?f.substr(0,f.lastIndexOf("/")+1):"",i=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},u&&(d=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),l=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)});Module.print||console.log.bind(console);var p=Module.printErr||console.warn.bind(console);for(e in t)t.hasOwnProperty(e)&&(Module[e]=t[e]);t=null,Module.arguments&&(s=Module.arguments),Module.thisProgram&&(o=Module.thisProgram),Module.quit&&(_=Module.quit);var h=16;var g,w=[];function M(e,t){if(!g){g=new WeakMap;for(var n=0;n>0]=t;break;case"i16":q[e>>1]=t;break;case"i32":T[e>>2]=t;break;case"i64":ce=[t>>>0,(de=t,+Math.abs(de)>=1?de>0?(0|Math.min(+Math.floor(de/4294967296),4294967295))>>>0:~~+Math.ceil((de-+(~~de>>>0))/4294967296)>>>0:0)],T[e>>2]=ce[0],T[e+4>>2]=ce[1];break;case"float":W[e>>2]=t;break;case"double":Z[e>>3]=t;break;default:se("invalid type for setValue: "+n)}}function A(e,t,n){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return C[e>>0];case"i16":return q[e>>1];case"i32":case"i64":return T[e>>2];case"float":return W[e>>2];case"double":return Z[e>>3];default:se("invalid type for getValue: "+t)}return null}"object"!=typeof WebAssembly&&se("no native wasm support detected");var x=!1;function N(e,t){e||se("Assertion failed: "+t)}var P=1;var k,C,R,q,T,W,Z,F="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function L(e,t,n){for(var r=t+n,s=t;e[s]&&!(s>=r);)++s;if(s-t>16&&e.subarray&&F)return F.decode(e.subarray(t,s));for(var o="";t>10,56320|1023&i)}}else o+=String.fromCharCode((31&_)<<6|a)}else o+=String.fromCharCode(_)}return o}function O(e,t){return e?L(R,e,t):""}function $(e,t,n,r){if(!(r>0))return 0;for(var s=n,o=n+r-1,_=0;_=55296&&a<=57343)a=65536+((1023&a)<<10)|1023&e.charCodeAt(++_);if(a<=127){if(n>=o)break;t[n++]=a}else if(a<=2047){if(n+1>=o)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=o)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+3>=o)break;t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}return t[n]=0,n-s}function U(e,t,n){return $(e,R,t,n)}function D(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}function j(e){var t=D(e)+1,n=je(t);return $(e,C,n,t),n}function z(e){k=e,Module.HEAP8=C=new Int8Array(e),Module.HEAP16=q=new Int16Array(e),Module.HEAP32=T=new Int32Array(e),Module.HEAPU8=R=new Uint8Array(e),Module.HEAPU16=new Uint16Array(e),Module.HEAPU32=new Uint32Array(e),Module.HEAPF32=W=new Float32Array(e),Module.HEAPF64=Z=new Float64Array(e)}var G=new WebAssembly.Global({value:"i32",mutable:!0},5250816);Module.___heap_base=5250816;var B=Module.INITIAL_MEMORY||33554432;(v=Module.wasmMemory?Module.wasmMemory:new WebAssembly.Memory({initial:B/65536,maximum:32768}))&&(k=v.buffer),B=k.byteLength,z(k);var H=new WebAssembly.Table({initial:13,element:"anyfunc"}),K=[],V=[],X=[],Q=[],Y=!1;var J=0,ee=null,te=null;function ne(e){J++,Module.monitorRunDependencies&&Module.monitorRunDependencies(J)}function re(e){if(J--,Module.monitorRunDependencies&&Module.monitorRunDependencies(J),0==J&&(null!==ee&&(clearInterval(ee),ee=null),te)){var t=te;te=null,t()}}function se(e){throw Module.onAbort&&Module.onAbort(e),p(e+=""),x=!0,1,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(e)}function oe(e,t){return String.prototype.startsWith?e.startsWith(t):0===e.indexOf(t)}Module.preloadedImages={},Module.preloadedAudios={},Module.preloadedWasm={};var _e="data:application/octet-stream;base64,";function ae(e){return oe(e,_e)}var ue="file://";function ie(e){return oe(e,ue)}var le,de,ce,me="tree-sitter.wasm";function fe(e){try{if(e==me&&y)return new Uint8Array(y);if(d)return d(e);throw"both async and sync fetching of the wasm failed"}catch(e){se(e)}}ae(me)||(le=me,me=Module.locateFile?Module.locateFile(le,f):f+le);var pe={},he={get:function(e,t){return pe[t]||(pe[t]=new WebAssembly.Global({value:"i32",mutable:!0})),pe[t]}};function ge(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?H.get(n)():H.get(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(Module)}}function we(e){var t=0;function n(){for(var n=0,r=1;;){var s=e[t++];if(n+=(127&s)*r,r*=128,!(128&s))break}return n}if(e instanceof WebAssembly.Module){var r=WebAssembly.Module.customSections(e,"dylink");N(0!=r.length,"need dylink section"),e=new Int8Array(r[0])}else{N(1836278016==new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer)[0],"need to see wasm magic number"),N(0===e[8],"need the dylink section to be first"),t=9,n(),N(6===e[t]),N(e[++t]==="d".charCodeAt(0)),N(e[++t]==="y".charCodeAt(0)),N(e[++t]==="l".charCodeAt(0)),N(e[++t]==="i".charCodeAt(0)),N(e[++t]==="n".charCodeAt(0)),N(e[++t]==="k".charCodeAt(0)),t++}var s={};s.memorySize=n(),s.memoryAlign=n(),s.tableSize=n(),s.tableAlign=n();var o=n();s.neededDynlibs=[];for(var _=0;_0}var be,Ee={nextHandle:1,loadedLibs:{},loadedLibNames:{}};function ve(e){return-1!=["__cpp_exception","__wasm_apply_data_relocs","__dso_handle","__set_stack_limits"].indexOf(e)}function Ie(e,t){var n={};for(var r in e){var s=e[r];"object"==typeof s&&(s=s.value),"number"==typeof s&&(s+=t),n[r]=s}return function(e){for(var t in e)if(!ve(t)){var n=!1,r=e[t];0==t.indexOf("orig$")&&(t=t.split("$")[1],n=!0),pe[t]||(pe[t]=new WebAssembly.Global({value:"i32",mutable:!0})),(n||0==pe[t].value)&&("function"==typeof r?pe[t].value=M(r):"number"==typeof r?pe[t].value=r:p("unhandled export type for `"+t+"`: "+typeof r))}}(n),n}function Se(e){return 0==e.indexOf("dynCall_")||-1!=["setTempRet0","getTempRet0","stackAlloc","stackSave","stackRestore"].indexOf(e)?e:"_"+e}function Ae(e,t){var n,r;return t&&(n=Module.asm["orig$"+e]),n||(n=Module.asm[e]),!n&&t&&(n=Module["_orig$"+e]),n||(n=Module[Se(e)]),n||0!=e.indexOf("invoke_")||(r=e.split("_")[1],n=function(){var e=Ue();try{return dynCall(r,arguments[0],Array.prototype.slice.call(arguments,1))}catch(t){if(De(e),t!==t+0&&"longjmp"!==t)throw t;_setThrew(1,0)}}),n}function xe(e,t){var n=we(e);function r(){var r=Math.pow(2,n.memoryAlign);r=Math.max(r,h);var s,o,_,a=(s=function(e){if(Y)return Oe(e);var t=Module.___heap_base,n=t+e+15&-16;return Module.___heap_base=n,pe.__heap_base.value=n,t}(n.memorySize+r),(o=r)||(o=h),Math.ceil(s/o)*o),u=Le,i=H.length;H.grow(n.tableSize);for(var l=a;l>2]=r,-1;n=be()}return T[t>>2]=n/1e3|0,T[t+4>>2]=n%1e3*1e3*1e3|0,0}function Te(e){try{return v.grow(e-k.byteLength+65535>>>16),z(v.buffer),1}catch(e){}}function We(e){He(e)}function Ze(e){b(0|e)}qe.sig="iii",We.sig="vi",Ze.sig="vi";var Fe,Le={__indirect_function_table:H,__memory_base:1024,__stack_pointer:G,__table_base:1,abort:Ce,clock_gettime:qe,emscripten_memcpy_big:function(e,t,n){R.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n,r=R.length;if((e>>>=0)>2147483648)return!1;for(var s=1;s<=4;s*=2){var o=r*(1+.2/s);if(o=Math.min(o,e+100663296),Te(Math.min(2147483648,((t=Math.max(e,o))%(n=65536)>0&&(t+=n-t%n),t))))return!0}return!1},exit:We,memory:v,setTempRet0:Ze,tree_sitter_log_callback:function(e,t){if(lt){const n=O(t);lt(n,0!==e)}},tree_sitter_parse_callback:function(e,t,n,r,s){var o=it(t,{row:n,column:r});"string"==typeof o?(S(s,o.length,"i32"),function(e,t,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=(n-=2)<2*e.length?n/2:e.length,s=0;s>1]=o,t+=2}q[t>>1]=0}(o,e,10240)):S(s,0,"i32")}},Oe=(function(){var e={env:Le,wasi_snapshot_preview1:Le,"GOT.mem":new Proxy(Le,he),"GOT.func":new Proxy(Le,he)};function t(e,t){var n=e.exports;n=Ie(n,1024),Module.asm=n;var r,s=we(t);s.neededDynlibs&&(E=s.neededDynlibs.concat(E)),r=Module.asm.__wasm_call_ctors,V.unshift(r),re()}function n(e){t(e.instance,e.module)}function r(t){return function(){if(!y&&(a||u)){if("function"==typeof fetch&&!ie(me))return fetch(me,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+me+"'";return e.arrayBuffer()}).catch(function(){return fe(me)});if(l)return new Promise(function(e,t){l(me,function(t){e(new Uint8Array(t))},t)})}return Promise.resolve().then(function(){return fe(me)})}().then(function(t){return WebAssembly.instantiate(t,e)}).then(t,function(e){p("failed to asynchronously prepare wasm: "+e),se(e)})}if(ne(),Module.instantiateWasm)try{return Module.instantiateWasm(e,t)}catch(e){return p("Module.instantiateWasm callback failed with error: "+e),!1}y||"function"!=typeof WebAssembly.instantiateStreaming||ae(me)||ie(me)||"function"!=typeof fetch?r(n):fetch(me,{credentials:"same-origin"}).then(function(t){return WebAssembly.instantiateStreaming(t,e).then(n,function(e){return p("wasm streaming compile failed: "+e),p("falling back to ArrayBuffer instantiation"),r(n)})})}(),Module.___wasm_call_ctors=function(){return(Module.___wasm_call_ctors=Module.asm.__wasm_call_ctors).apply(null,arguments)},Module._malloc=function(){return(Oe=Module._malloc=Module.asm.malloc).apply(null,arguments)}),$e=(Module._ts_language_symbol_count=function(){return(Module._ts_language_symbol_count=Module.asm.ts_language_symbol_count).apply(null,arguments)},Module._ts_language_version=function(){return(Module._ts_language_version=Module.asm.ts_language_version).apply(null,arguments)},Module._ts_language_field_count=function(){return(Module._ts_language_field_count=Module.asm.ts_language_field_count).apply(null,arguments)},Module._ts_language_symbol_name=function(){return(Module._ts_language_symbol_name=Module.asm.ts_language_symbol_name).apply(null,arguments)},Module._ts_language_symbol_for_name=function(){return(Module._ts_language_symbol_for_name=Module.asm.ts_language_symbol_for_name).apply(null,arguments)},Module._ts_language_symbol_type=function(){return(Module._ts_language_symbol_type=Module.asm.ts_language_symbol_type).apply(null,arguments)},Module._ts_language_field_name_for_id=function(){return(Module._ts_language_field_name_for_id=Module.asm.ts_language_field_name_for_id).apply(null,arguments)},Module._memcpy=function(){return(Module._memcpy=Module.asm.memcpy).apply(null,arguments)},Module._free=function(){return(Module._free=Module.asm.free).apply(null,arguments)},Module._calloc=function(){return(Module._calloc=Module.asm.calloc).apply(null,arguments)},Module._ts_parser_delete=function(){return(Module._ts_parser_delete=Module.asm.ts_parser_delete).apply(null,arguments)},Module._ts_parser_set_language=function(){return(Module._ts_parser_set_language=Module.asm.ts_parser_set_language).apply(null,arguments)},Module._ts_parser_timeout_micros=function(){return(Module._ts_parser_timeout_micros=Module.asm.ts_parser_timeout_micros).apply(null,arguments)},Module._ts_parser_set_timeout_micros=function(){return(Module._ts_parser_set_timeout_micros=Module.asm.ts_parser_set_timeout_micros).apply(null,arguments)},Module._memcmp=function(){return(Module._memcmp=Module.asm.memcmp).apply(null,arguments)},Module._ts_query_new=function(){return(Module._ts_query_new=Module.asm.ts_query_new).apply(null,arguments)},Module._ts_query_delete=function(){return(Module._ts_query_delete=Module.asm.ts_query_delete).apply(null,arguments)},Module._iswspace=function(){return(Module._iswspace=Module.asm.iswspace).apply(null,arguments)},Module._iswalnum=function(){return(Module._iswalnum=Module.asm.iswalnum).apply(null,arguments)},Module._ts_query_pattern_count=function(){return(Module._ts_query_pattern_count=Module.asm.ts_query_pattern_count).apply(null,arguments)},Module._ts_query_capture_count=function(){return(Module._ts_query_capture_count=Module.asm.ts_query_capture_count).apply(null,arguments)},Module._ts_query_string_count=function(){return(Module._ts_query_string_count=Module.asm.ts_query_string_count).apply(null,arguments)},Module._ts_query_capture_name_for_id=function(){return(Module._ts_query_capture_name_for_id=Module.asm.ts_query_capture_name_for_id).apply(null,arguments)},Module._ts_query_string_value_for_id=function(){return(Module._ts_query_string_value_for_id=Module.asm.ts_query_string_value_for_id).apply(null,arguments)},Module._ts_query_predicates_for_pattern=function(){return(Module._ts_query_predicates_for_pattern=Module.asm.ts_query_predicates_for_pattern).apply(null,arguments)},Module._ts_tree_copy=function(){return(Module._ts_tree_copy=Module.asm.ts_tree_copy).apply(null,arguments)},Module._ts_tree_delete=function(){return(Module._ts_tree_delete=Module.asm.ts_tree_delete).apply(null,arguments)},Module._ts_init=function(){return(Module._ts_init=Module.asm.ts_init).apply(null,arguments)},Module._ts_parser_new_wasm=function(){return(Module._ts_parser_new_wasm=Module.asm.ts_parser_new_wasm).apply(null,arguments)},Module._ts_parser_enable_logger_wasm=function(){return(Module._ts_parser_enable_logger_wasm=Module.asm.ts_parser_enable_logger_wasm).apply(null,arguments)},Module._ts_parser_parse_wasm=function(){return(Module._ts_parser_parse_wasm=Module.asm.ts_parser_parse_wasm).apply(null,arguments)},Module._ts_language_type_is_named_wasm=function(){return(Module._ts_language_type_is_named_wasm=Module.asm.ts_language_type_is_named_wasm).apply(null,arguments)},Module._ts_language_type_is_visible_wasm=function(){return(Module._ts_language_type_is_visible_wasm=Module.asm.ts_language_type_is_visible_wasm).apply(null,arguments)},Module._ts_tree_root_node_wasm=function(){return(Module._ts_tree_root_node_wasm=Module.asm.ts_tree_root_node_wasm).apply(null,arguments)},Module._ts_tree_edit_wasm=function(){return(Module._ts_tree_edit_wasm=Module.asm.ts_tree_edit_wasm).apply(null,arguments)},Module._ts_tree_get_changed_ranges_wasm=function(){return(Module._ts_tree_get_changed_ranges_wasm=Module.asm.ts_tree_get_changed_ranges_wasm).apply(null,arguments)},Module._ts_tree_cursor_new_wasm=function(){return(Module._ts_tree_cursor_new_wasm=Module.asm.ts_tree_cursor_new_wasm).apply(null,arguments)},Module._ts_tree_cursor_delete_wasm=function(){return(Module._ts_tree_cursor_delete_wasm=Module.asm.ts_tree_cursor_delete_wasm).apply(null,arguments)},Module._ts_tree_cursor_reset_wasm=function(){return(Module._ts_tree_cursor_reset_wasm=Module.asm.ts_tree_cursor_reset_wasm).apply(null,arguments)},Module._ts_tree_cursor_goto_first_child_wasm=function(){return(Module._ts_tree_cursor_goto_first_child_wasm=Module.asm.ts_tree_cursor_goto_first_child_wasm).apply(null,arguments)},Module._ts_tree_cursor_goto_next_sibling_wasm=function(){return(Module._ts_tree_cursor_goto_next_sibling_wasm=Module.asm.ts_tree_cursor_goto_next_sibling_wasm).apply(null,arguments)},Module._ts_tree_cursor_goto_parent_wasm=function(){return(Module._ts_tree_cursor_goto_parent_wasm=Module.asm.ts_tree_cursor_goto_parent_wasm).apply(null,arguments)},Module._ts_tree_cursor_current_node_type_id_wasm=function(){return(Module._ts_tree_cursor_current_node_type_id_wasm=Module.asm.ts_tree_cursor_current_node_type_id_wasm).apply(null,arguments)},Module._ts_tree_cursor_current_node_is_named_wasm=function(){return(Module._ts_tree_cursor_current_node_is_named_wasm=Module.asm.ts_tree_cursor_current_node_is_named_wasm).apply(null,arguments)},Module._ts_tree_cursor_current_node_is_missing_wasm=function(){return(Module._ts_tree_cursor_current_node_is_missing_wasm=Module.asm.ts_tree_cursor_current_node_is_missing_wasm).apply(null,arguments)},Module._ts_tree_cursor_current_node_id_wasm=function(){return(Module._ts_tree_cursor_current_node_id_wasm=Module.asm.ts_tree_cursor_current_node_id_wasm).apply(null,arguments)},Module._ts_tree_cursor_start_position_wasm=function(){return(Module._ts_tree_cursor_start_position_wasm=Module.asm.ts_tree_cursor_start_position_wasm).apply(null,arguments)},Module._ts_tree_cursor_end_position_wasm=function(){return(Module._ts_tree_cursor_end_position_wasm=Module.asm.ts_tree_cursor_end_position_wasm).apply(null,arguments)},Module._ts_tree_cursor_start_index_wasm=function(){return(Module._ts_tree_cursor_start_index_wasm=Module.asm.ts_tree_cursor_start_index_wasm).apply(null,arguments)},Module._ts_tree_cursor_end_index_wasm=function(){return(Module._ts_tree_cursor_end_index_wasm=Module.asm.ts_tree_cursor_end_index_wasm).apply(null,arguments)},Module._ts_tree_cursor_current_field_id_wasm=function(){return(Module._ts_tree_cursor_current_field_id_wasm=Module.asm.ts_tree_cursor_current_field_id_wasm).apply(null,arguments)},Module._ts_tree_cursor_current_node_wasm=function(){return(Module._ts_tree_cursor_current_node_wasm=Module.asm.ts_tree_cursor_current_node_wasm).apply(null,arguments)},Module._ts_node_symbol_wasm=function(){return(Module._ts_node_symbol_wasm=Module.asm.ts_node_symbol_wasm).apply(null,arguments)},Module._ts_node_child_count_wasm=function(){return(Module._ts_node_child_count_wasm=Module.asm.ts_node_child_count_wasm).apply(null,arguments)},Module._ts_node_named_child_count_wasm=function(){return(Module._ts_node_named_child_count_wasm=Module.asm.ts_node_named_child_count_wasm).apply(null,arguments)},Module._ts_node_child_wasm=function(){return(Module._ts_node_child_wasm=Module.asm.ts_node_child_wasm).apply(null,arguments)},Module._ts_node_named_child_wasm=function(){return(Module._ts_node_named_child_wasm=Module.asm.ts_node_named_child_wasm).apply(null,arguments)},Module._ts_node_child_by_field_id_wasm=function(){return(Module._ts_node_child_by_field_id_wasm=Module.asm.ts_node_child_by_field_id_wasm).apply(null,arguments)},Module._ts_node_next_sibling_wasm=function(){return(Module._ts_node_next_sibling_wasm=Module.asm.ts_node_next_sibling_wasm).apply(null,arguments)},Module._ts_node_prev_sibling_wasm=function(){return(Module._ts_node_prev_sibling_wasm=Module.asm.ts_node_prev_sibling_wasm).apply(null,arguments)},Module._ts_node_next_named_sibling_wasm=function(){return(Module._ts_node_next_named_sibling_wasm=Module.asm.ts_node_next_named_sibling_wasm).apply(null,arguments)},Module._ts_node_prev_named_sibling_wasm=function(){return(Module._ts_node_prev_named_sibling_wasm=Module.asm.ts_node_prev_named_sibling_wasm).apply(null,arguments)},Module._ts_node_parent_wasm=function(){return(Module._ts_node_parent_wasm=Module.asm.ts_node_parent_wasm).apply(null,arguments)},Module._ts_node_descendant_for_index_wasm=function(){return(Module._ts_node_descendant_for_index_wasm=Module.asm.ts_node_descendant_for_index_wasm).apply(null,arguments)},Module._ts_node_named_descendant_for_index_wasm=function(){return(Module._ts_node_named_descendant_for_index_wasm=Module.asm.ts_node_named_descendant_for_index_wasm).apply(null,arguments)},Module._ts_node_descendant_for_position_wasm=function(){return(Module._ts_node_descendant_for_position_wasm=Module.asm.ts_node_descendant_for_position_wasm).apply(null,arguments)},Module._ts_node_named_descendant_for_position_wasm=function(){return(Module._ts_node_named_descendant_for_position_wasm=Module.asm.ts_node_named_descendant_for_position_wasm).apply(null,arguments)},Module._ts_node_start_point_wasm=function(){return(Module._ts_node_start_point_wasm=Module.asm.ts_node_start_point_wasm).apply(null,arguments)},Module._ts_node_end_point_wasm=function(){return(Module._ts_node_end_point_wasm=Module.asm.ts_node_end_point_wasm).apply(null,arguments)},Module._ts_node_start_index_wasm=function(){return(Module._ts_node_start_index_wasm=Module.asm.ts_node_start_index_wasm).apply(null,arguments)},Module._ts_node_end_index_wasm=function(){return(Module._ts_node_end_index_wasm=Module.asm.ts_node_end_index_wasm).apply(null,arguments)},Module._ts_node_to_string_wasm=function(){return(Module._ts_node_to_string_wasm=Module.asm.ts_node_to_string_wasm).apply(null,arguments)},Module._ts_node_children_wasm=function(){return(Module._ts_node_children_wasm=Module.asm.ts_node_children_wasm).apply(null,arguments)},Module._ts_node_named_children_wasm=function(){return(Module._ts_node_named_children_wasm=Module.asm.ts_node_named_children_wasm).apply(null,arguments)},Module._ts_node_descendants_of_type_wasm=function(){return(Module._ts_node_descendants_of_type_wasm=Module.asm.ts_node_descendants_of_type_wasm).apply(null,arguments)},Module._ts_node_is_named_wasm=function(){return(Module._ts_node_is_named_wasm=Module.asm.ts_node_is_named_wasm).apply(null,arguments)},Module._ts_node_has_changes_wasm=function(){return(Module._ts_node_has_changes_wasm=Module.asm.ts_node_has_changes_wasm).apply(null,arguments)},Module._ts_node_has_error_wasm=function(){return(Module._ts_node_has_error_wasm=Module.asm.ts_node_has_error_wasm).apply(null,arguments)},Module._ts_node_is_missing_wasm=function(){return(Module._ts_node_is_missing_wasm=Module.asm.ts_node_is_missing_wasm).apply(null,arguments)},Module._ts_query_matches_wasm=function(){return(Module._ts_query_matches_wasm=Module.asm.ts_query_matches_wasm).apply(null,arguments)},Module._ts_query_captures_wasm=function(){return(Module._ts_query_captures_wasm=Module.asm.ts_query_captures_wasm).apply(null,arguments)},Module._iswdigit=function(){return(Module._iswdigit=Module.asm.iswdigit).apply(null,arguments)},Module._iswalpha=function(){return(Module._iswalpha=Module.asm.iswalpha).apply(null,arguments)},Module._iswlower=function(){return(Module._iswlower=Module.asm.iswlower).apply(null,arguments)},Module._towupper=function(){return(Module._towupper=Module.asm.towupper).apply(null,arguments)},Module.___errno_location=function(){return($e=Module.___errno_location=Module.asm.__errno_location).apply(null,arguments)}),Ue=(Module._memchr=function(){return(Module._memchr=Module.asm.memchr).apply(null,arguments)},Module._strlen=function(){return(Module._strlen=Module.asm.strlen).apply(null,arguments)},Module.stackSave=function(){return(Ue=Module.stackSave=Module.asm.stackSave).apply(null,arguments)}),De=Module.stackRestore=function(){return(De=Module.stackRestore=Module.asm.stackRestore).apply(null,arguments)},je=Module.stackAlloc=function(){return(je=Module.stackAlloc=Module.asm.stackAlloc).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=function(){return(Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm).apply(null,arguments)},Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=function(){return(Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev).apply(null,arguments)},Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=function(){return(Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm).apply(null,arguments)},Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=function(){return(Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm).apply(null,arguments)},Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=function(){return(Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc).apply(null,arguments)},Module.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=function(){return(Module.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=Module.asm._ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm).apply(null,arguments)},Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=function(){return(Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev).apply(null,arguments)},Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=function(){return(Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw).apply(null,arguments)},Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=function(){return(Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_).apply(null,arguments)},Module.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=function(){return(Module.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=Module.asm._ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv).apply(null,arguments)},Module.__Znwm=function(){return(Module.__Znwm=Module.asm._Znwm).apply(null,arguments)},Module.__ZdlPv=function(){return(Module.__ZdlPv=Module.asm._ZdlPv).apply(null,arguments)},Module._orig$ts_parser_timeout_micros=function(){return(Module._orig$ts_parser_timeout_micros=Module.asm.orig$ts_parser_timeout_micros).apply(null,arguments)},Module._orig$ts_parser_set_timeout_micros=function(){return(Module._orig$ts_parser_set_timeout_micros=Module.asm.orig$ts_parser_set_timeout_micros).apply(null,arguments)},Module._TRANSFER_BUFFER=7296,Module.___cxa_new_handler=7928;function ze(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}Module.allocate=function(e,t){var n;return n=t==P?je(e.length):Oe(e.length),e.subarray||e.slice?R.set(e,n):R.set(new Uint8Array(e),n),n};te=function e(){Fe||Be(),Fe||(te=e)};var Ge=!1;function Be(e){function t(){Fe||(Fe=!0,Module.calledRun=!0,x||(Y=!0,ge(V),ge(X),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Ke&&function(e){var t=Module._main;if(t){var n=(e=e||[]).length+1,r=je(4*(n+1));T[r>>2]=j(o);for(var s=1;s>2)+s]=j(e[s-1]);T[(r>>2)+n]=0;try{He(t(n,r),!0)}catch(e){if(e instanceof ze)return;if("unwind"==e)return;var a=e;e&&"object"==typeof e&&e.stack&&(a=[e,e.stack]),p("exception thrown: "+a),_(1,e)}finally{!0}}}(e),function(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)e=Module.postRun.shift(),Q.unshift(e);var e;ge(Q)}()))}e=e||s,J>0||!Ge&&(function(){if(E.length){if(!d)return ne(),void E.reduce(function(e,t){return e.then(function(){return Pe(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})})},Promise.resolve()).then(function(){re(),ke()});E.forEach(function(e){Pe(e,{global:!0,nodelete:!0,allowUndefined:!0})}),ke()}else ke()}(),Ge=!0,J>0)||(!function(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)e=Module.preRun.shift(),K.unshift(e);var e;ge(K)}(),J>0||(Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),t()},1)):t()))}function He(e,t){e,t&&ye()&&0===e||(ye()||(!0,Module.onExit&&Module.onExit(e),x=!0),_(e,new ze(e)))}if(Module.run=Be,Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var Ke=!0;Module.noInitialRun&&(Ke=!1),Be();const Ve=Module,Xe={},Qe=4,Ye=5*Qe,Je=2*Qe,et=2*Qe+2*Je,tt={row:0,column:0},nt=/[\w-.]*/g,rt=1,st=2,ot=/^_?tree_sitter_\w+/;var _t,at,ut,it,lt,dt=new Promise(e=>{Module.onRuntimeInitialized=e}).then(()=>{ut=Ve._ts_init(),_t=A(ut,"i32"),at=A(ut+Qe,"i32")});class Parser{static init(){return dt}constructor(){if(null==ut)throw new Error("You must first call Parser.init() and wait for it to resolve.");Ve._ts_parser_new_wasm(),this[0]=A(ut,"i32"),this[1]=A(ut+Qe,"i32")}delete(){Ve._ts_parser_delete(this[0]),Ve._free(this[1]),this[0]=0,this[1]=0}setLanguage(e){let t;if(e){if(e.constructor!==Language)throw new Error("Argument must be a Language");{t=e[0];const n=Ve._ts_language_version(t);if(ne.slice(t,r));else{if("function"!=typeof e)throw new Error("Argument must be a string or a function");it=e}this.logCallback?(lt=this.logCallback,Ve._ts_parser_enable_logger_wasm(this[0],1)):(lt=null,Ve._ts_parser_enable_logger_wasm(this[0],0));let r=0,s=0;if(n&&n.includedRanges){r=n.includedRanges.length;let e=s=Ve._calloc(r,et);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=a;for(let t=0;t<_;t++)u[t]=gt(this.tree,e),e+=Ye}return Ve._free(a),Ve._free(o),u}get nextSibling(){return ht(this),Ve._ts_node_next_sibling_wasm(this.tree[0]),gt(this.tree)}get previousSibling(){return ht(this),Ve._ts_node_prev_sibling_wasm(this.tree[0]),gt(this.tree)}get nextNamedSibling(){return ht(this),Ve._ts_node_next_named_sibling_wasm(this.tree[0]),gt(this.tree)}get previousNamedSibling(){return ht(this),Ve._ts_node_prev_named_sibling_wasm(this.tree[0]),gt(this.tree)}get parent(){return ht(this),Ve._ts_node_parent_wasm(this.tree[0]),gt(this.tree)}descendantForIndex(e,t=e){if("number"!=typeof e||"number"!=typeof t)throw new Error("Arguments must be numbers");ht(this);let n=ut+Ye;return S(n,e,"i32"),S(n+Qe,t,"i32"),Ve._ts_node_descendant_for_index_wasm(this.tree[0]),gt(this.tree)}namedDescendantForIndex(e,t=e){if("number"!=typeof e||"number"!=typeof t)throw new Error("Arguments must be numbers");ht(this);let n=ut+Ye;return S(n,e,"i32"),S(n+Qe,t,"i32"),Ve._ts_node_named_descendant_for_index_wasm(this.tree[0]),gt(this.tree)}descendantForPosition(e,t=e){if(!pt(e)||!pt(t))throw new Error("Arguments must be {row, column} objects");ht(this);let n=ut+Ye;return yt(n,e),yt(n+Je,t),Ve._ts_node_descendant_for_position_wasm(this.tree[0]),gt(this.tree)}namedDescendantForPosition(e,t=e){if(!pt(e)||!pt(t))throw new Error("Arguments must be {row, column} objects");ht(this);let n=ut+Ye;return yt(n,e),yt(n+Je,t),Ve._ts_node_named_descendant_for_position_wasm(this.tree[0]),gt(this.tree)}walk(){return ht(this),Ve._ts_tree_cursor_new_wasm(this.tree[0]),new TreeCursor(Xe,this.tree)}toString(){ht(this);const e=Ve._ts_node_to_string_wasm(this.tree[0]),t=function(e){for(var t="";;){var n=R[e++>>0];if(!n)return t;t+=String.fromCharCode(n)}}(e);return Ve._free(e),t}}class TreeCursor{constructor(e,t){ft(e),this.tree=t,Mt(this)}delete(){wt(this),Ve._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}reset(e){ht(e),wt(this,ut+Ye),Ve._ts_tree_cursor_reset_wasm(this.tree[0]),Mt(this)}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return wt(this),Ve._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeId(){return wt(this),Ve._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return wt(this),1===Ve._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])}get nodeIsMissing(){return wt(this),1===Ve._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])}get nodeText(){wt(this);const e=Ve._ts_tree_cursor_start_index_wasm(this.tree[0]),t=Ve._ts_tree_cursor_end_index_wasm(this.tree[0]);return ct(this.tree,e,t)}get startPosition(){return wt(this),Ve._ts_tree_cursor_start_position_wasm(this.tree[0]),bt(ut)}get endPosition(){return wt(this),Ve._ts_tree_cursor_end_position_wasm(this.tree[0]),bt(ut)}get startIndex(){return wt(this),Ve._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return wt(this),Ve._ts_tree_cursor_end_index_wasm(this.tree[0])}currentNode(){return wt(this),Ve._ts_tree_cursor_current_node_wasm(this.tree[0]),gt(this.tree)}currentFieldId(){return wt(this),Ve._ts_tree_cursor_current_field_id_wasm(this.tree[0])}currentFieldName(){return this.tree.language.fields[this.currentFieldId()]}gotoFirstChild(){wt(this);const e=Ve._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return Mt(this),1===e}gotoNextSibling(){wt(this);const e=Ve._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return Mt(this),1===e}gotoParent(){wt(this);const e=Ve._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return Mt(this),1===e}}class Language{constructor(e,t){ft(e),this[0]=t,this.types=new Array(Ve._ts_language_symbol_count(this[0]));for(let e=0,t=this.types.length;e0){if("string"!==s[0].type)throw new Error("Predicates must begin with a literal value");const t=s[0].value;let n=!0;switch(t){case"not-eq?":n=!1;case"eq?":if(3!==s.length)throw new Error(`Wrong number of arguments to \`#eq?\` predicate. Expected 2, got ${s.length-1}`);if("capture"!==s[1].type)throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${s[1].value}"`);if("capture"===s[2].type){const t=s[1].name,r=s[2].name;m[e].push(function(e){let s,o;for(const n of e)n.name===t&&(s=n.node),n.name===r&&(o=n.node);return s.text===o.text===n})}else{const t=s[1].name,r=s[2].value;m[e].push(function(e){for(const s of e)if(s.name===t)return s.node.text===r===n;return!1})}break;case"not-match?":n=!1;case"match?":if(3!==s.length)throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${s.length-1}.`);if("capture"!==s[1].type)throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${s[1].value}".`);if("string"!==s[2].type)throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${s[2].value}.`);const r=s[1].name,o=new RegExp(s[2].value);m[e].push(function(e){for(const t of e)if(t.name===r)return o.test(t.node.text)===n;return!1});break;case"set!":if(s.length<2||s.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${s.length-1}.`);if(s.some(e=>"string"!==e.type))throw new Error('Arguments to `#set!` predicate must be a strings.".');i[e]||(i[e]={}),i[e][s[1].value]=s[2]?s[2].value:null;break;case"is?":case"is-not?":if(s.length<2||s.length>3)throw new Error(`Wrong number of arguments to \`#${t}\` predicate. Expected 1 or 2. Got ${s.length-1}.`);if(s.some(e=>"string"!==e.type))throw new Error(`Arguments to \`#${t}\` predicate must be a strings.".`);const _="is?"===t?l:d;_[e]||(_[e]={}),_[e][s[1].value]=s[2]?s[2].value:null;break;default:c[e].push({operator:t,operands:s.slice(1)})}s.length=0}}Object.freeze(i[e]),Object.freeze(l[e]),Object.freeze(d[e])}return Ve._free(n),new Query(Xe,r,a,m,c,Object.freeze(i),Object.freeze(l),Object.freeze(d))}static load(e){let t;if(e instanceof Uint8Array)t=Promise.resolve(e);else{const n=e;if("undefined"!=typeof process&&process.versions&&process.versions.node){const e=require("fs");t=Promise.resolve(e.readFileSync(n))}else t=fetch(n).then(e=>e.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}`)}}))}const n="function"==typeof loadSideModule?loadSideModule:xe;return t.then(e=>n(e,{loadAsync:!0})).then(e=>{const t=Object.keys(e),n=t.find(e=>ot.test(e)&&!e.includes("external_scanner_"));n||console.log(`Couldn't find language function in WASM file. Symbols:\n${JSON.stringify(t,null,2)}`);const r=e[n]();return new Language(Xe,r)})}}class Query{constructor(e,t,n,r,s,o,_,a){ft(e),this[0]=t,this.captureNames=n,this.textPredicates=r,this.predicates=s,this.setProperties=o,this.assertedProperties=_,this.refutedProperties=a}delete(){Ve._ts_query_delete(this[0]),this[0]=0}matches(e,t,n){t||(t=tt),n||(n=tt),ht(e),Ve._ts_query_matches_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=A(ut,"i32"),s=A(ut+Qe,"i32"),o=new Array(r);let _=0,a=s;for(let t=0;te(s))){o[_++]={pattern:n,captures:s};const e=this.setProperties[n];e&&(o[t].setProperties=e);const r=this.assertedProperties[n];r&&(o[t].assertedProperties=r);const a=this.refutedProperties[n];a&&(o[t].refutedProperties=a)}}return o.length=_,Ve._free(s),o}captures(e,t,n){t||(t=tt),n||(n=tt),ht(e),Ve._ts_query_captures_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=A(ut,"i32"),s=A(ut+Qe,"i32"),o=[],_=[];let a=s;for(let t=0;te(_))){const e=_[r],n=this.setProperties[t];n&&(e.setProperties=n);const s=this.assertedProperties[t];s&&(e.assertedProperties=s);const a=this.refutedProperties[t];a&&(e.refutedProperties=a),o.push(e)}}return Ve._free(s),o}predicatesForPattern(e){return this.predicates[e]}}function ct(e,t,n){const r=n-t;let s=e.textCallback(t,null,n);for(t+=s.length;t0))break;t+=r.length,s+=r}return t>n&&(s=s.slice(0,r)),s}function mt(e,t,n,r){for(let s=0,o=r.length;s - - - - - - - Tree-sitter YAML Playground - - - -
-
- - - - -

Tree-sitter YAML v0.5.0

- - - -
- This playground was modified from the official Tree-sitter Playground. -
- - - - - - - - - - - -
-
- - - - diff --git a/scripts/generate-playground.js b/scripts/generate-playground.js deleted file mode 100644 index f9e2b58..0000000 --- a/scripts/generate-playground.js +++ /dev/null @@ -1,36 +0,0 @@ -const generatePlayground = require("../tree-sitter/script/generate-playground"); - -generatePlayground("docs", { - name: "YAML", - example: ` ---- -invoice: 34843 -date : 2001-01-23 -bill-to: &id001 - given : Chris - family : Dumars - address: - lines: | - 458 Walkman Dr. - Suite #292 - city : Royal Oak - state : MI - postal : 48046 -ship-to: *id001 -product: - - sku : BL394D - quantity : 4 - description : Basketball - price : 450.00 - - sku : BL4438H - quantity : 1 - description : Super Hoop - price : 2392.00 -tax : 251.42 -total: 4443.52 -comments: > - Late afternoon is best. - Backup contact is Nancy - Billsmer @ 338-4338. -`.trim() -}); diff --git a/scripts/setup-tree-sitter.sh b/scripts/setup-tree-sitter.sh deleted file mode 100644 index 1299e58..0000000 --- a/scripts/setup-tree-sitter.sh +++ /dev/null @@ -1,4 +0,0 @@ -git submodule update --init -cd tree-sitter -./script/build-wasm -cargo build --release diff --git a/scripts/update-schema.js b/scripts/update-schema.js deleted file mode 100755 index 0689349..0000000 --- a/scripts/update-schema.js +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env node - -// @ts-nocheck - -const fs = require("fs"); -const path = require("path"); - -fs.promises.readFile("./schema/src/parser.c", "utf8").then(input => { - const cases = extractCases(input); - const enums = []; - const content = "switch (sch_stt) " + block([ - "case SCH_STT_FRZ:\n break;", - cases - .map(([key, { content }]) => `${(key === "default" ? "default:" : `case ${key}:`)}\n${indent(content)}`) - .join("\n END_STATE();\n") - .replace(/ADVANCE\((\d+)\);/g, (_, state) => { - const stateCase = cases.find(([key]) => key === state); - if (stateCase) { - const [, { acceptToken }] = stateCase; - if (acceptToken) { - return `{${acceptToken} return ${state};}`; - } - } - return `{*rlt_sch = RS_STR; return ${state};}`; - }) - .replace("ACCEPT_TOKEN(ts_builtin_sym_end);", "abort();") - .replace(/ACCEPT_TOKEN\((\w+)\);/g, (_, name) => { - const newName = "RS_" + convertName(name); - if (!enums.includes(newName)) { - enums.push(newName); - } - return `*rlt_sch = ${newName};`; - }) - .replace(/END_STATE\(\);/g, `break;`) - .replace("return false;", '*rlt_sch = RS_STR;\n return SCH_STT_FRZ;') - .replace(/lookahead/g, "cur_chr"), - ]); - fs.writeFileSync( - path.resolve(__dirname, "../src/schema.generated.c"), - [ - "#include ", - "#define SCH_STT_FRZ -1", - `typedef enum ${block(enums.map((k) => `${k},`))} ResultSchema;`, - `int8_t adv_sch_stt(int8_t sch_stt, int32_t cur_chr, ResultSchema *rlt_sch) ${block([ - content, - `if (cur_chr != '\\r' && cur_chr != '\\n' && cur_chr != ' ' && cur_chr != 0) *rlt_sch = RS_STR;`, - "return SCH_STT_FRZ;", - ])}`, - ].join("\n\n"), - ); -}); - -function extractCases(input) { - const MAIN_SIGNATURE = "static bool ts_lex(TSLexer *lexer, TSStateId state) {"; - const SWITCH_CASE = "switch (state) {\n"; - const startIndex = input.indexOf(SWITCH_CASE, input.indexOf(MAIN_SIGNATURE)) + SWITCH_CASE.length; - const endIndex = input.indexOf("}\n}", startIndex); - const content = input.slice(startIndex, endIndex).replace(/^\s*if \(eof\).+\n/mg, "").trimEnd(); - return dedent(dedent(content)).split("END_STATE();").map(text => { - const index = text.indexOf(":\n"); - const key = text.slice(0, index).trim().replace(/^case /, ""); - const content = dedent(text.slice(index + 2)).trim(); - const matchAcceptToken = content.match(/^ACCEPT_TOKEN\(\w+\);/); - const acceptToken = matchAcceptToken && matchAcceptToken[0]; - const hasAcceptTokenOnly = acceptToken && acceptToken.length === content.length; - return [key, { content, acceptToken, hasAcceptTokenOnly }]; - }); -} - -function convertName(name) { - return { - anon_sym_: "NULL", - sym__base_10: "INT", - sym__base_8: "INT", - sym__base_16: "INT", - sym__number: "FLOAT", - sym__infinity: "FLOAT", - sym__not_a_number: "FLOAT", - aux_sym_str_token1: "STR", - }[name] || name.replace("sym_", "").toUpperCase(); -} - -function block(contents) { - return `{\n${indent(contents)}\n}`; -} - -function lines(contents) { - return [].concat(contents).join("\n").split("\n"); -} - -function indent(contents) { - return lines(contents).map(x => " ".repeat(2) + x).join("\n"); -} - -function dedent(contents) { - return lines(contents).map(x => x.replace(/^ /mg, "")).join("\n"); -} diff --git a/scripts/update-schema.sh b/scripts/update-schema.sh deleted file mode 100644 index f4dc5de..0000000 --- a/scripts/update-schema.sh +++ /dev/null @@ -1,11 +0,0 @@ -cd $(dirname "$0")/.. - -ROOT_DIR=$PWD -TREE_SITTER_CLI="$ROOT_DIR/tree-sitter/target/release/tree-sitter" -SCHEMA_GRAMMAR="$ROOT_DIR/grammar-schema.js" -TEMP_DIR=$(mktemp -d) - -cd $TEMP_DIR -cp $SCHEMA_GRAMMAR grammar.js -$TREE_SITTER_CLI generate -cat $TEMP_DIR/src/parser.c | node $ROOT_DIR/scripts/update-schema.js diff --git a/scripts/update-spec-corpus.js b/scripts/update-spec-corpus.js deleted file mode 100644 index 5ca997f..0000000 --- a/scripts/update-spec-corpus.js +++ /dev/null @@ -1,51 +0,0 @@ -const fs = require("fs"); -const { orderBy } = require("natural-orderby"); -const path = require("path"); - -const testSuiteDirname = "./yaml-test-suite"; -const whitelistForValidTest = [ - "Duplicate YAML directive", // semantic error - "Missing space in YAML directive", // https://github.com/yaml/yaml-test-suite/issues/38 - "Tag shorthand used in documents but only defined in the first", // semantic error -]; - -const testCases = {}; -const testTagsDirname = path.join(testSuiteDirname, "tags"); -for (const tagName of fs.readdirSync(testTagsDirname)) { - const testTagDirname = path.join(testTagsDirname, tagName); - for (const testCaseId of fs.readdirSync(testTagDirname)) { - const dirname = path.join(testSuiteDirname, testCaseId); - const title = fs.readFileSync(path.join(dirname, "==="), "utf8").trim(); - const content = fs.readFileSync(path.join(dirname, "in.yaml"), "utf8"); - const isInvalid = - fs.existsSync(path.join(dirname, "error")) && - whitelistForValidTest.indexOf(title) === -1; - testCases[isInvalid ? `${title} [INVALID]` : title] = { - input: content, - output: "()", - }; - } -} - -const finalTestCases = {}; -for (const title of orderBy(Object.keys(testCases))) { - finalTestCases[title] = testCases[title]; -} - -fs.writeFileSync( - "./corpus/spec.txt", - Object.entries(finalTestCases) - .map(([title, { input, output }]) => - [ - "=".repeat(80), - title, - "=".repeat(80), - input, - "-".repeat(80), - "", - output.trim(), - "" - ].join("\n") - ) - .join("\n") -); diff --git a/tree-sitter b/tree-sitter deleted file mode 160000 index fc5a692..0000000 --- a/tree-sitter +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fc5a692b7d5f144cc531f5823b1c5a3b2f06cf01 diff --git a/yaml-test-suite b/yaml-test-suite deleted file mode 160000 index 053b73a..0000000 --- a/yaml-test-suite +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 053b73a9c12c0cd76da797fdc2ffbd4bb5264c12