mirror of https://github.com/Wilfred/difftastic/
add tree sitter python package
parent
9004b86531
commit
1680203047
@ -0,0 +1,30 @@
|
||||
# tree-sitter-solidity
|
||||
|
||||
This is an automatically generated python package using [python-tree-sitter-types](https://github.com/JoranHonig/python-tree-sitter-types).
|
||||
|
||||
It provides nice typed bindings for the tree-sitter raw parser.
|
||||
|
||||
### Installation
|
||||
|
||||
```bash
|
||||
pip install tree-sitter-solidity
|
||||
```
|
||||
|
||||
### Example
|
||||
|
||||
```python
|
||||
|
||||
from tree_sitter_solidity import load_language, parse_node
|
||||
from tree_sitter import Parser
|
||||
|
||||
language = load_language('tree-sitter-solidity', 'solidity')
|
||||
|
||||
parser = Parser()
|
||||
parser.set_language(language)
|
||||
|
||||
tree = parser.parse(bytes("<some solidity code>", "utf-8"))
|
||||
|
||||
typed_tree = parse_node(tree.root_node)
|
||||
|
||||
# Your cool clean code:
|
||||
```
|
||||
@ -0,0 +1 @@
|
||||
tree-sitter-types
|
||||
@ -0,0 +1,30 @@
|
||||
import pathlib
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
# The directory containing this file
|
||||
HERE = pathlib.Path(__file__).parent
|
||||
|
||||
# The text of the README file
|
||||
README = (HERE / "README.md").read_text()
|
||||
|
||||
REQUIREMENTS = (HERE / "requirements.txt")
|
||||
|
||||
requirements = [x for x in map(str.strip, REQUIREMENTS.read_text().split("\n")) if x != ""]
|
||||
|
||||
setup(
|
||||
name="tree-sitter-solidity",
|
||||
version="0.0.1",
|
||||
description="A tree-sitter based typed parser for the solidity language",
|
||||
long_description=README,
|
||||
long_description_content_type="text/markdown",
|
||||
url="https://github.com/joranhonig/tree-sitter-solidity/",
|
||||
author="Joran Honig",
|
||||
author_email="joran.honig@gmail.com",
|
||||
classifiers=[
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
],
|
||||
packages=find_packages(),
|
||||
include_package_data=True,
|
||||
install_requires=requirements,
|
||||
)
|
||||
@ -0,0 +1 @@
|
||||
from typed_parser import *
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue