tree-sitter-sql 0.3.5__tar.gz → 0.3.7__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.
Files changed (21) hide show
  1. {tree-sitter-sql-0.3.5 → tree_sitter_sql-0.3.7}/PKG-INFO +15 -7
  2. {tree-sitter-sql-0.3.5 → tree_sitter_sql-0.3.7}/README.md +8 -2
  3. tree_sitter_sql-0.3.7/bindings/python/tree_sitter_sql/__init__.py +42 -0
  4. tree_sitter_sql-0.3.7/bindings/python/tree_sitter_sql/__init__.pyi +10 -0
  5. {tree-sitter-sql-0.3.5 → tree_sitter_sql-0.3.7}/bindings/python/tree_sitter_sql/binding.c +2 -2
  6. {tree-sitter-sql-0.3.5 → tree_sitter_sql-0.3.7}/bindings/python/tree_sitter_sql.egg-info/PKG-INFO +15 -7
  7. {tree-sitter-sql-0.3.5 → tree_sitter_sql-0.3.7}/bindings/python/tree_sitter_sql.egg-info/SOURCES.txt +1 -0
  8. tree_sitter_sql-0.3.7/bindings/python/tree_sitter_sql.egg-info/requires.txt +3 -0
  9. {tree-sitter-sql-0.3.5 → tree_sitter_sql-0.3.7}/pyproject.toml +8 -7
  10. tree_sitter_sql-0.3.7/src/parser.c +557640 -0
  11. {tree-sitter-sql-0.3.5 → tree_sitter_sql-0.3.7}/src/scanner.c +2 -2
  12. tree-sitter-sql-0.3.5/bindings/python/tree_sitter_sql/__init__.py +0 -5
  13. tree-sitter-sql-0.3.5/bindings/python/tree_sitter_sql/__init__.pyi +0 -1
  14. tree-sitter-sql-0.3.5/bindings/python/tree_sitter_sql.egg-info/requires.txt +0 -3
  15. {tree-sitter-sql-0.3.5 → tree_sitter_sql-0.3.7}/LICENSE +0 -0
  16. {tree-sitter-sql-0.3.5 → tree_sitter_sql-0.3.7}/bindings/python/tree_sitter_sql/py.typed +0 -0
  17. {tree-sitter-sql-0.3.5 → tree_sitter_sql-0.3.7}/bindings/python/tree_sitter_sql.egg-info/dependency_links.txt +0 -0
  18. {tree-sitter-sql-0.3.5 → tree_sitter_sql-0.3.7}/bindings/python/tree_sitter_sql.egg-info/not-zip-safe +0 -0
  19. {tree-sitter-sql-0.3.5 → tree_sitter_sql-0.3.7}/bindings/python/tree_sitter_sql.egg-info/top_level.txt +0 -0
  20. {tree-sitter-sql-0.3.5 → tree_sitter_sql-0.3.7}/setup.cfg +0 -0
  21. {tree-sitter-sql-0.3.5 → tree_sitter_sql-0.3.7}/setup.py +0 -0
@@ -1,19 +1,21 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tree-sitter-sql
3
- Version: 0.3.5
4
- Summary: Sql grammar for tree-sitter
3
+ Version: 0.3.7
4
+ Summary: Tree-sitter Grammar for SQL
5
+ Author: derek stride
5
6
  License: MIT
6
- Project-URL: Homepage, https://github.com/tree-sitter/tree-sitter-sql
7
+ Project-URL: Homepage, https://github.com/derekstride/tree-sitter-sql.git
7
8
  Keywords: incremental,parsing,tree-sitter,sql
8
9
  Classifier: Intended Audience :: Developers
9
10
  Classifier: License :: OSI Approved :: MIT License
10
11
  Classifier: Topic :: Software Development :: Compilers
11
12
  Classifier: Topic :: Text Processing :: Linguistic
12
13
  Classifier: Typing :: Typed
13
- Requires-Python: >=3.8
14
+ Requires-Python: >=3.9
14
15
  Description-Content-Type: text/markdown
15
- Provides-Extra: core
16
16
  License-File: LICENSE
17
+ Provides-Extra: core
18
+ Requires-Dist: tree-sitter~=0.22; extra == "core"
17
19
 
18
20
  # tree-sitter-sql
19
21
 
@@ -62,18 +64,24 @@ Tree-sitter parsers need to be compiled as a shared-object / dynamic-library, yo
62
64
  cc -shared -fPIC -I./src src/parser.c src/scanner.c -o sql.so
63
65
  ```
64
66
 
65
- ### Using [Cargo](https://crates.io/crates/tree-sitter-sequel)
67
+ ### Using [cargo](https://crates.io/crates/tree-sitter-sequel)
66
68
 
67
69
  ```bash
68
70
  cargo add tree-sitter-sequel
69
71
  ```
70
72
 
71
- ### Using [NPM](https://www.npmjs.com/package/@derekstride/tree-sitter-sql)
73
+ ### Using [npm](https://www.npmjs.com/package/@derekstride/tree-sitter-sql)
72
74
 
73
75
  ```bash
74
76
  npm i @derekstride/tree-sitter-sql
75
77
  ```
76
78
 
79
+ ### Using [pip](https://pypi.org/project/tree-sitter-sql/0.3.5/)
80
+
81
+ ```bash
82
+ pip install tree-sitter-sql
83
+ ```
84
+
77
85
  ## Development
78
86
 
79
87
  See [CONTRIBUTING.md](CONTRIBUTING.md) for documentation on how to set up the project for development.
@@ -45,18 +45,24 @@ Tree-sitter parsers need to be compiled as a shared-object / dynamic-library, yo
45
45
  cc -shared -fPIC -I./src src/parser.c src/scanner.c -o sql.so
46
46
  ```
47
47
 
48
- ### Using [Cargo](https://crates.io/crates/tree-sitter-sequel)
48
+ ### Using [cargo](https://crates.io/crates/tree-sitter-sequel)
49
49
 
50
50
  ```bash
51
51
  cargo add tree-sitter-sequel
52
52
  ```
53
53
 
54
- ### Using [NPM](https://www.npmjs.com/package/@derekstride/tree-sitter-sql)
54
+ ### Using [npm](https://www.npmjs.com/package/@derekstride/tree-sitter-sql)
55
55
 
56
56
  ```bash
57
57
  npm i @derekstride/tree-sitter-sql
58
58
  ```
59
59
 
60
+ ### Using [pip](https://pypi.org/project/tree-sitter-sql/0.3.5/)
61
+
62
+ ```bash
63
+ pip install tree-sitter-sql
64
+ ```
65
+
60
66
  ## Development
61
67
 
62
68
  See [CONTRIBUTING.md](CONTRIBUTING.md) for documentation on how to set up the project for development.
@@ -0,0 +1,42 @@
1
+ """Tree-sitter Grammar for SQL"""
2
+
3
+ from importlib.resources import files as _files
4
+
5
+ from ._binding import language
6
+
7
+
8
+ def _get_query(name, file):
9
+ query = _files(f"{__package__}.queries") / file
10
+ globals()[name] = query.read_text()
11
+ return globals()[name]
12
+
13
+
14
+ def __getattr__(name):
15
+ # NOTE: uncomment these to include any queries that this grammar contains:
16
+
17
+ if name == "HIGHLIGHTS_QUERY":
18
+ return _get_query("HIGHLIGHTS_QUERY", "highlights.scm")
19
+ # if name == "INJECTIONS_QUERY":
20
+ # return _get_query("INJECTIONS_QUERY", "injections.scm")
21
+ # if name == "LOCALS_QUERY":
22
+ # return _get_query("LOCALS_QUERY", "locals.scm")
23
+ # if name == "TAGS_QUERY":
24
+ # return _get_query("TAGS_QUERY", "tags.scm")
25
+
26
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
27
+
28
+
29
+ __all__ = [
30
+ "language",
31
+ "HIGHLIGHTS_QUERY",
32
+ # "INJECTIONS_QUERY",
33
+ # "LOCALS_QUERY",
34
+ # "TAGS_QUERY",
35
+ ]
36
+
37
+
38
+ def __dir__():
39
+ return sorted(__all__ + [
40
+ "__all__", "__builtins__", "__cached__", "__doc__", "__file__",
41
+ "__loader__", "__name__", "__package__", "__path__", "__spec__",
42
+ ])
@@ -0,0 +1,10 @@
1
+ from typing import Final
2
+
3
+ # NOTE: uncomment these to include any queries that this grammar contains:
4
+
5
+ HIGHLIGHTS_QUERY: Final[str]
6
+ # INJECTIONS_QUERY: Final[str]
7
+ # LOCALS_QUERY: Final[str]
8
+ # TAGS_QUERY: Final[str]
9
+
10
+ def language() -> object: ...
@@ -4,8 +4,8 @@ typedef struct TSLanguage TSLanguage;
4
4
 
5
5
  TSLanguage *tree_sitter_sql(void);
6
6
 
7
- static PyObject* _binding_language(PyObject *self, PyObject *args) {
8
- return PyLong_FromVoidPtr(tree_sitter_sql());
7
+ static PyObject* _binding_language(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args)) {
8
+ return PyCapsule_New(tree_sitter_sql(), "tree_sitter.Language", NULL);
9
9
  }
10
10
 
11
11
  static PyMethodDef methods[] = {
@@ -1,19 +1,21 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tree-sitter-sql
3
- Version: 0.3.5
4
- Summary: Sql grammar for tree-sitter
3
+ Version: 0.3.7
4
+ Summary: Tree-sitter Grammar for SQL
5
+ Author: derek stride
5
6
  License: MIT
6
- Project-URL: Homepage, https://github.com/tree-sitter/tree-sitter-sql
7
+ Project-URL: Homepage, https://github.com/derekstride/tree-sitter-sql.git
7
8
  Keywords: incremental,parsing,tree-sitter,sql
8
9
  Classifier: Intended Audience :: Developers
9
10
  Classifier: License :: OSI Approved :: MIT License
10
11
  Classifier: Topic :: Software Development :: Compilers
11
12
  Classifier: Topic :: Text Processing :: Linguistic
12
13
  Classifier: Typing :: Typed
13
- Requires-Python: >=3.8
14
+ Requires-Python: >=3.9
14
15
  Description-Content-Type: text/markdown
15
- Provides-Extra: core
16
16
  License-File: LICENSE
17
+ Provides-Extra: core
18
+ Requires-Dist: tree-sitter~=0.22; extra == "core"
17
19
 
18
20
  # tree-sitter-sql
19
21
 
@@ -62,18 +64,24 @@ Tree-sitter parsers need to be compiled as a shared-object / dynamic-library, yo
62
64
  cc -shared -fPIC -I./src src/parser.c src/scanner.c -o sql.so
63
65
  ```
64
66
 
65
- ### Using [Cargo](https://crates.io/crates/tree-sitter-sequel)
67
+ ### Using [cargo](https://crates.io/crates/tree-sitter-sequel)
66
68
 
67
69
  ```bash
68
70
  cargo add tree-sitter-sequel
69
71
  ```
70
72
 
71
- ### Using [NPM](https://www.npmjs.com/package/@derekstride/tree-sitter-sql)
73
+ ### Using [npm](https://www.npmjs.com/package/@derekstride/tree-sitter-sql)
72
74
 
73
75
  ```bash
74
76
  npm i @derekstride/tree-sitter-sql
75
77
  ```
76
78
 
79
+ ### Using [pip](https://pypi.org/project/tree-sitter-sql/0.3.5/)
80
+
81
+ ```bash
82
+ pip install tree-sitter-sql
83
+ ```
84
+
77
85
  ## Development
78
86
 
79
87
  See [CONTRIBUTING.md](CONTRIBUTING.md) for documentation on how to set up the project for development.
@@ -12,4 +12,5 @@ bindings/python/tree_sitter_sql.egg-info/dependency_links.txt
12
12
  bindings/python/tree_sitter_sql.egg-info/not-zip-safe
13
13
  bindings/python/tree_sitter_sql.egg-info/requires.txt
14
14
  bindings/python/tree_sitter_sql.egg-info/top_level.txt
15
+ src/parser.c
15
16
  src/scanner.c
@@ -0,0 +1,3 @@
1
+
2
+ [core]
3
+ tree-sitter~=0.22
@@ -4,26 +4,27 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "tree-sitter-sql"
7
- description = "Sql grammar for tree-sitter"
8
- version = "0.3.5"
7
+ description = "Tree-sitter Grammar for SQL"
8
+ version = "0.3.7"
9
9
  keywords = ["incremental", "parsing", "tree-sitter", "sql"]
10
10
  classifiers = [
11
11
  "Intended Audience :: Developers",
12
12
  "License :: OSI Approved :: MIT License",
13
13
  "Topic :: Software Development :: Compilers",
14
14
  "Topic :: Text Processing :: Linguistic",
15
- "Typing :: Typed"
15
+ "Typing :: Typed",
16
16
  ]
17
- requires-python = ">=3.8"
17
+ authors = [{ name = "derek stride" }]
18
+ requires-python = ">=3.9"
18
19
  license.text = "MIT"
19
20
  readme = "README.md"
20
21
 
21
22
  [project.urls]
22
- Homepage = "https://github.com/tree-sitter/tree-sitter-sql"
23
+ Homepage = "https://github.com/derekstride/tree-sitter-sql.git"
23
24
 
24
25
  [project.optional-dependencies]
25
- core = ["tree-sitter~=0.21"]
26
+ core = ["tree-sitter~=0.22"]
26
27
 
27
28
  [tool.cibuildwheel]
28
- build = "cp38-*"
29
+ build = "cp39-*"
29
30
  build-frontend = "build"