Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yijunyu/tree-sitter-parsers


https://github.com/yijunyu/tree-sitter-parsers

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

# Tree-sitter parsers

The package ```tree-sitter-parsers``` preinstalls tree-sitter parsers as shared libraries into your ```$HOME/.tree-sitter/tree-sitter-parsers-$(uname)``` folder.

Usage:

```python
import tree_sitter_parsers
```

## Development

### preparation of source code
The source code are extracted from official nodejs packages by the following script:
```bash
#!/bin/bash
for l in bash c cpp c-sharp css elm go html java javascript kotlin lua php python ruby rust scala solidity verilog yaml; do
npm pack tree-sitter-$l
done
for l in *.tgz; do
f=${l/.tgz/}
mkdir -p $f
tar xvfz $l --strip-components=1 -C $f
done
```
Here we can support more programming languages.

### testing

The script below tests the package:

```bash
rm -rf dist/*
python3 setup.py sdist bdist_wheel
pip uninstall tree_sitter_parsers -y
pip install dist/tree_sitter_parsers-*-py3-none-any.whl
rm -rf ~/.tree-sitter
python3 -c "import tree_sitter_parsers"
```

### deployment

The script below uploads the package into Pypi archive:
```bash
twine upload dist/tree_sitter_parsers-*
pip uninstall tree_sitter_parsers -y
pip install tree_sitter_parsers
```