-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
8,345 additions
and
8,382 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,50 @@ | ||
Tree-sitter -> wasm | ||
|
||
https://emscripten.org/docs/getting_started/downloads.html | ||
https://github.com/tree-sitter/tree-sitter/blob/master/lib/binding_web/README.md | ||
https://tree-sitter.github.io/tree-sitter/creating-parsers | ||
|
||
|
||
install python with optional `py` launcher and `PATH` option | ||
|
||
install emscripten in a separate private folder | ||
`git clone https://github.com/emscripten-core/emsdk.git` | ||
`cd emsdk` | ||
`git pull` | ||
(the latest version (`3.X.X`) doesn't seem to work with the `vscode-parse-tree` extension on Windows. Install version `2.0.34` instead) | ||
`./emsdk install 2.0.34` | ||
`./emsdk activate 2.0.34 --permanent` | ||
`./emsdk_env.bat` | ||
restart powershell and/or vscode | ||
|
||
install tree-sitter in the extension folder | ||
cd `/out/tree-sitter/` | ||
`npm install tree-sitter-cli` | ||
|
||
compile wasm | ||
run `build_grammar.ps1` | ||
|
||
|
||
to install tree-sitter in your own personal extension | ||
`mkdir tree-sitter-your_language` | ||
`cd tree-sitter-your_language` | ||
`npm init` (creates `package.json`) | ||
`npm install --save nan` | ||
`npm install --save-dev tree-sitter-cli` | ||
add `./node_modules/.bin` to `PATH` | ||
`grammar.js` => ```js | ||
Tree-sitter -> wasm | ||
|
||
https://emscripten.org/docs/getting_started/downloads.html | ||
https://github.com/tree-sitter/tree-sitter/blob/master/lib/binding_web/README.md | ||
https://tree-sitter.github.io/tree-sitter/creating-parsers | ||
|
||
|
||
install python with optional `py` launcher and `PATH` option | ||
|
||
install emscripten in a separate private folder | ||
`git clone https://github.com/emscripten-core/emsdk.git` | ||
`cd emsdk` | ||
`git pull` | ||
(the latest version (`3.X.X`) doesn't seem to work with the `vscode-parse-tree` extension on Windows. Install version `2.0.34` instead) | ||
`./emsdk install 2.0.34` | ||
`./emsdk activate 2.0.34 --permanent` | ||
`./emsdk_env.bat` | ||
restart powershell and/or vscode | ||
|
||
install tree-sitter in the extension folder | ||
cd `/out/tree-sitter/` | ||
`npm install tree-sitter-cli` | ||
|
||
compile wasm | ||
run `build_grammar.ps1` | ||
|
||
|
||
to install tree-sitter in your own personal extension | ||
`mkdir tree-sitter-your_language` | ||
`cd tree-sitter-your_language` | ||
`npm init` (creates `package.json`) | ||
`npm install --save nan` | ||
`npm install --save-dev tree-sitter-cli` | ||
add `./node_modules/.bin` to `PATH` | ||
`grammar.js` => | ||
```js | ||
module.exports = grammar({ | ||
name: 'your_language', | ||
|
||
rules: { | ||
// TODO: add the actual grammar rules | ||
source_file: $ => 'hello' | ||
} | ||
});``` | ||
`tree-sitter generate` | ||
`example-file` => `hello` (UTF8 encoding!!) | ||
`tree-sitter parse example-file` | ||
|
||
https://raw.githubusercontent.com/tree-sitter/tree-sitter/master/cli/src/generate/grammar-schema.json | ||
}); | ||
``` | ||
`tree-sitter generate` | ||
`example-file` => `hello` (UTF8 encoding!!) | ||
`tree-sitter parse example-file` | ||
|
||
https://raw.githubusercontent.com/tree-sitter/tree-sitter/master/cli/src/generate/grammar-schema.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.