@willbooster/web-tree-sitter 19.1.0 → 20.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -20
- package/debug/web-tree-sitter.cjs +168 -433
- package/debug/web-tree-sitter.cjs.map +4 -4
- package/debug/web-tree-sitter.js +168 -432
- package/debug/web-tree-sitter.js.map +4 -4
- package/debug/web-tree-sitter.wasm +0 -0
- package/debug/web-tree-sitter.wasm.map +17 -23
- package/package.json +1 -2
- package/web-tree-sitter.cjs +3 -3
- package/web-tree-sitter.cjs.map +4 -4
- package/web-tree-sitter.d.cts +2 -86
- package/web-tree-sitter.d.cts.map +1 -4
- package/web-tree-sitter.d.ts +2 -86
- package/web-tree-sitter.d.ts.map +1 -4
- package/web-tree-sitter.js +3 -3
- package/web-tree-sitter.js.map +4 -4
- package/web-tree-sitter.wasm +0 -0
- package/web-tree-sitter.wasm.map +22 -28
- package/web-tree-sitter.web.js +3 -3
- package/web-tree-sitter.web.js.map +4 -4
package/README.md
CHANGED
|
@@ -110,26 +110,6 @@ console.log(callExpression.type, callExpression.startPosition, callExpression.en
|
|
|
110
110
|
// call_expression { row: 0, column: 11 } { row: 0, column: 25 }
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
### Editing
|
|
114
|
-
|
|
115
|
-
If your source code _changes_, you can update the syntax tree. This will take less time than the first parse.
|
|
116
|
-
|
|
117
|
-
```javascript
|
|
118
|
-
// Replace 'let' with 'const'
|
|
119
|
-
const newSourceCode = 'const x = 1; console.log(x);';
|
|
120
|
-
|
|
121
|
-
tree.edit({
|
|
122
|
-
startIndex: 0,
|
|
123
|
-
oldEndIndex: 3,
|
|
124
|
-
newEndIndex: 5,
|
|
125
|
-
startPosition: { row: 0, column: 0 },
|
|
126
|
-
oldEndPosition: { row: 0, column: 3 },
|
|
127
|
-
newEndPosition: { row: 0, column: 5 },
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
const newTree = parser.parse(newSourceCode, tree);
|
|
131
|
-
```
|
|
132
|
-
|
|
133
113
|
### Parsing Text From a Custom Data Structure
|
|
134
114
|
|
|
135
115
|
If your text is stored in a data structure other than a single string, you can parse it by supplying a callback to `parse`
|