tree-sitter-ballerina 0.1.0__tar.gz

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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Heshan Padmasiri
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ include src/tree_sitter/parser.h
@@ -0,0 +1,34 @@
1
+ Metadata-Version: 2.4
2
+ Name: tree-sitter-ballerina
3
+ Version: 0.1.0
4
+ Summary: Ballerina grammar for tree-sitter
5
+ Home-page: https://github.com/tree-sitter/tree-sitter-ballerina
6
+ Author: Heshan Padmasiri
7
+ Author-email:
8
+ License: MIT
9
+ Project-URL: Homepage, https://github.com/tree-sitter/tree-sitter-ballerina
10
+ Project-URL: Repository, https://github.com/tree-sitter/tree-sitter-ballerina
11
+ Project-URL: Issues, https://github.com/tree-sitter/tree-sitter-ballerina/issues
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.7
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Topic :: Software Development :: Compilers
23
+ Classifier: Topic :: Text Processing :: Linguistic
24
+ Requires-Python: >=3.7
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE.md
27
+ Requires-Dist: tree-sitter>=0.20.0
28
+ Dynamic: home-page
29
+ Dynamic: license-file
30
+ Dynamic: requires-python
31
+
32
+ # tree-sitter-ballerina
33
+
34
+ Ballerina grammer for [tree-sitter](https://github.com/tree-sitter/tree-sitter). Currently fully implements the grammer in [nballerina](https://github.com/ballerina-platform/nballerina) subset 14 as well as parts of ballerina spec version [2022R2](https://ballerina.io/spec/lang/2022R2/)
@@ -0,0 +1,3 @@
1
+ # tree-sitter-ballerina
2
+
3
+ Ballerina grammer for [tree-sitter](https://github.com/tree-sitter/tree-sitter). Currently fully implements the grammer in [nballerina](https://github.com/ballerina-platform/nballerina) subset 14 as well as parts of ballerina spec version [2022R2](https://ballerina.io/spec/lang/2022R2/)
@@ -0,0 +1,31 @@
1
+ #include <Python.h>
2
+
3
+ typedef struct TSLanguage TSLanguage;
4
+
5
+ TSLanguage *tree_sitter_ballerina(void);
6
+
7
+ static PyObject* language(PyObject *self, PyObject *args) {
8
+ return PyLong_FromVoidPtr(tree_sitter_ballerina());
9
+ }
10
+
11
+ static PyMethodDef module_methods[] = {
12
+ {
13
+ .ml_name = "language",
14
+ .ml_meth = language,
15
+ .ml_flags = METH_NOARGS,
16
+ .ml_doc = "Get the tree-sitter language for Ballerina"
17
+ },
18
+ {NULL, NULL, 0, NULL}
19
+ };
20
+
21
+ static struct PyModuleDef module_definition = {
22
+ .m_base = PyModuleDef_HEAD_INIT,
23
+ .m_name = "_binding",
24
+ .m_doc = "Tree-sitter language bindings for Ballerina",
25
+ .m_size = -1,
26
+ .m_methods = module_methods
27
+ };
28
+
29
+ PyMODINIT_FUNC PyInit__binding(void) {
30
+ return PyModule_Create(&module_definition);
31
+ }
@@ -0,0 +1,39 @@
1
+ [build-system]
2
+ requires = ["setuptools>=45", "wheel", "pybind11>=2.6.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "tree-sitter-ballerina"
7
+ version = "0.1.0"
8
+ description = "Ballerina grammar for tree-sitter"
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ authors = [
12
+ {name = "Heshan Padmasiri"}
13
+ ]
14
+ classifiers = [
15
+ "Development Status :: 3 - Alpha",
16
+ "Intended Audience :: Developers",
17
+ "License :: OSI Approved :: MIT License",
18
+ "Operating System :: OS Independent",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.7",
21
+ "Programming Language :: Python :: 3.8",
22
+ "Programming Language :: Python :: 3.9",
23
+ "Programming Language :: Python :: 3.10",
24
+ "Programming Language :: Python :: 3.11",
25
+ "Topic :: Software Development :: Compilers",
26
+ "Topic :: Text Processing :: Linguistic",
27
+ ]
28
+ requires-python = ">=3.7"
29
+ dependencies = [
30
+ "tree-sitter>=0.20.0"
31
+ ]
32
+
33
+ [project.urls]
34
+ Homepage = "https://github.com/tree-sitter/tree-sitter-ballerina"
35
+ Repository = "https://github.com/tree-sitter/tree-sitter-ballerina"
36
+ Issues = "https://github.com/tree-sitter/tree-sitter-ballerina/issues"
37
+
38
+ [tool.setuptools.packages.find]
39
+ include = ["tree_sitter_ballerina*"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,51 @@
1
+ from setuptools import setup, Extension, find_packages
2
+ import os
3
+ import platform
4
+
5
+ # Define the extension module
6
+ ext_modules = [
7
+ Extension(
8
+ "tree_sitter_ballerina._binding",
9
+ sources=[
10
+ "bindings/python/tree_sitter_ballerina.c",
11
+ "src/parser.c",
12
+ ],
13
+ include_dirs=["src"],
14
+ extra_compile_args=['-std=c99'] if platform.system() != 'Windows' else [],
15
+ ),
16
+ ]
17
+
18
+ with open("README.md", "r", encoding="utf-8") as fh:
19
+ long_description = fh.read()
20
+
21
+ setup(
22
+ name="tree-sitter-ballerina",
23
+ version="0.1.0",
24
+ author="Heshan Padmasiri",
25
+ author_email="",
26
+ description="Ballerina grammar for tree-sitter",
27
+ long_description=long_description,
28
+ long_description_content_type="text/markdown",
29
+ url="https://github.com/tree-sitter/tree-sitter-ballerina",
30
+ packages=["tree_sitter_ballerina"],
31
+ ext_modules=ext_modules,
32
+ classifiers=[
33
+ "Development Status :: 3 - Alpha",
34
+ "Intended Audience :: Developers",
35
+ "License :: OSI Approved :: MIT License",
36
+ "Operating System :: OS Independent",
37
+ "Programming Language :: Python :: 3",
38
+ "Programming Language :: Python :: 3.7",
39
+ "Programming Language :: Python :: 3.8",
40
+ "Programming Language :: Python :: 3.9",
41
+ "Programming Language :: Python :: 3.10",
42
+ "Programming Language :: Python :: 3.11",
43
+ "Topic :: Software Development :: Compilers",
44
+ "Topic :: Text Processing :: Linguistic",
45
+ ],
46
+ python_requires=">=3.7",
47
+ install_requires=[
48
+ "tree-sitter>=0.20.0",
49
+ ],
50
+ zip_safe=False,
51
+ )