tree-sitter-scala 0.23.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
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Max Brunsfeld and GitHub
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,50 @@
1
+ Metadata-Version: 2.1
2
+ Name: tree-sitter-scala
3
+ Version: 0.23.0
4
+ Summary: Scala grammar for tree-sitter
5
+ License: MIT
6
+ Project-URL: Homepage, https://github.com/tree-sitter/tree-sitter-scala
7
+ Keywords: incremental,parsing,tree-sitter,scala
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Topic :: Software Development :: Compilers
11
+ Classifier: Topic :: Text Processing :: Linguistic
12
+ Classifier: Typing :: Typed
13
+ Requires-Python: >=3.9
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Provides-Extra: core
17
+ Requires-Dist: tree-sitter~=0.21; extra == "core"
18
+
19
+ # tree-sitter-scala
20
+
21
+ [![CI][ci]](https://github.com/tree-sitter/tree-sitter-scala/actions/workflows/ci.yml)
22
+ [![discord][discord]](https://discord.gg/w7nTvsVJhm)
23
+ [![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)
24
+ [![crates][crates]](https://crates.io/crates/tree-sitter-scala)
25
+ [![npm][npm]](https://www.npmjs.com/package/tree-sitter-scala)
26
+
27
+ Scala grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter)
28
+ covering both Scala 2 and 3.
29
+
30
+ ## References
31
+
32
+ _Scala 2_
33
+
34
+ - [The Scala 2 Language Specification](https://www.scala-lang.org/files/archive/spec/2.13/)
35
+ - [Scala 2 Syntax Summary](https://www.scala-lang.org/files/archive/spec/2.13/13-syntax-summary.html)
36
+
37
+ _Scala 3_
38
+
39
+ - [Scala 3 Syntax Summary](https://docs.scala-lang.org/scala3/reference/syntax.html)
40
+
41
+ ## Development and Contributing
42
+
43
+ Please refer to the [CONTRIBUTING.md](./CONTRIBUTING.md) for instructions on
44
+ getting set up.
45
+
46
+ [ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter/tree-sitter-scala/ci.yml?logo=github&label=CI
47
+ [discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord
48
+ [matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix
49
+ [npm]: https://img.shields.io/npm/v/tree-sitter-scala?logo=npm
50
+ [crates]: https://img.shields.io/crates/v/tree-sitter-scala?logo=rust
@@ -0,0 +1,32 @@
1
+ # tree-sitter-scala
2
+
3
+ [![CI][ci]](https://github.com/tree-sitter/tree-sitter-scala/actions/workflows/ci.yml)
4
+ [![discord][discord]](https://discord.gg/w7nTvsVJhm)
5
+ [![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)
6
+ [![crates][crates]](https://crates.io/crates/tree-sitter-scala)
7
+ [![npm][npm]](https://www.npmjs.com/package/tree-sitter-scala)
8
+
9
+ Scala grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter)
10
+ covering both Scala 2 and 3.
11
+
12
+ ## References
13
+
14
+ _Scala 2_
15
+
16
+ - [The Scala 2 Language Specification](https://www.scala-lang.org/files/archive/spec/2.13/)
17
+ - [Scala 2 Syntax Summary](https://www.scala-lang.org/files/archive/spec/2.13/13-syntax-summary.html)
18
+
19
+ _Scala 3_
20
+
21
+ - [Scala 3 Syntax Summary](https://docs.scala-lang.org/scala3/reference/syntax.html)
22
+
23
+ ## Development and Contributing
24
+
25
+ Please refer to the [CONTRIBUTING.md](./CONTRIBUTING.md) for instructions on
26
+ getting set up.
27
+
28
+ [ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter/tree-sitter-scala/ci.yml?logo=github&label=CI
29
+ [discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord
30
+ [matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix
31
+ [npm]: https://img.shields.io/npm/v/tree-sitter-scala?logo=npm
32
+ [crates]: https://img.shields.io/crates/v/tree-sitter-scala?logo=rust
@@ -0,0 +1,34 @@
1
+ """Scala grammar for tree-sitter"""
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
+ if name == "HIGHLIGHTS_QUERY":
16
+ return _get_query("HIGHLIGHTS_QUERY", "highlights.scm")
17
+ if name == "LOCALS_QUERY":
18
+ return _get_query("LOCALS_QUERY", "locals.scm")
19
+
20
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
21
+
22
+
23
+ __all__ = [
24
+ "language",
25
+ "HIGHLIGHTS_QUERY",
26
+ "LOCALS_QUERY",
27
+ ]
28
+
29
+
30
+ def __dir__():
31
+ return sorted(__all__ + [
32
+ "__all__", "__builtins__", "__cached__", "__doc__", "__file__",
33
+ "__loader__", "__name__", "__package__", "__path__", "__spec__",
34
+ ])
@@ -0,0 +1,6 @@
1
+ from typing import Final
2
+
3
+ HIGHLIGHTS_QUERY: Final[str]
4
+ LOCALS_QUERY: Final[str]
5
+
6
+ def language() -> object: ...
@@ -0,0 +1,27 @@
1
+ #include <Python.h>
2
+
3
+ typedef struct TSLanguage TSLanguage;
4
+
5
+ TSLanguage *tree_sitter_scala(void);
6
+
7
+ static PyObject* _binding_language(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args)) {
8
+ return PyCapsule_New(tree_sitter_scala(), "tree_sitter.Language", NULL);
9
+ }
10
+
11
+ static PyMethodDef methods[] = {
12
+ {"language", _binding_language, METH_NOARGS,
13
+ "Get the tree-sitter language for this grammar."},
14
+ {NULL, NULL, 0, NULL}
15
+ };
16
+
17
+ static struct PyModuleDef module = {
18
+ .m_base = PyModuleDef_HEAD_INIT,
19
+ .m_name = "_binding",
20
+ .m_doc = NULL,
21
+ .m_size = -1,
22
+ .m_methods = methods
23
+ };
24
+
25
+ PyMODINIT_FUNC PyInit__binding(void) {
26
+ return PyModule_Create(&module);
27
+ }
@@ -0,0 +1,50 @@
1
+ Metadata-Version: 2.1
2
+ Name: tree-sitter-scala
3
+ Version: 0.23.0
4
+ Summary: Scala grammar for tree-sitter
5
+ License: MIT
6
+ Project-URL: Homepage, https://github.com/tree-sitter/tree-sitter-scala
7
+ Keywords: incremental,parsing,tree-sitter,scala
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Topic :: Software Development :: Compilers
11
+ Classifier: Topic :: Text Processing :: Linguistic
12
+ Classifier: Typing :: Typed
13
+ Requires-Python: >=3.9
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Provides-Extra: core
17
+ Requires-Dist: tree-sitter~=0.21; extra == "core"
18
+
19
+ # tree-sitter-scala
20
+
21
+ [![CI][ci]](https://github.com/tree-sitter/tree-sitter-scala/actions/workflows/ci.yml)
22
+ [![discord][discord]](https://discord.gg/w7nTvsVJhm)
23
+ [![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)
24
+ [![crates][crates]](https://crates.io/crates/tree-sitter-scala)
25
+ [![npm][npm]](https://www.npmjs.com/package/tree-sitter-scala)
26
+
27
+ Scala grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter)
28
+ covering both Scala 2 and 3.
29
+
30
+ ## References
31
+
32
+ _Scala 2_
33
+
34
+ - [The Scala 2 Language Specification](https://www.scala-lang.org/files/archive/spec/2.13/)
35
+ - [Scala 2 Syntax Summary](https://www.scala-lang.org/files/archive/spec/2.13/13-syntax-summary.html)
36
+
37
+ _Scala 3_
38
+
39
+ - [Scala 3 Syntax Summary](https://docs.scala-lang.org/scala3/reference/syntax.html)
40
+
41
+ ## Development and Contributing
42
+
43
+ Please refer to the [CONTRIBUTING.md](./CONTRIBUTING.md) for instructions on
44
+ getting set up.
45
+
46
+ [ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter/tree-sitter-scala/ci.yml?logo=github&label=CI
47
+ [discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord
48
+ [matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix
49
+ [npm]: https://img.shields.io/npm/v/tree-sitter-scala?logo=npm
50
+ [crates]: https://img.shields.io/crates/v/tree-sitter-scala?logo=rust
@@ -0,0 +1,16 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ setup.py
5
+ bindings/python/tree_sitter_scala/__init__.py
6
+ bindings/python/tree_sitter_scala/__init__.pyi
7
+ bindings/python/tree_sitter_scala/binding.c
8
+ bindings/python/tree_sitter_scala/py.typed
9
+ bindings/python/tree_sitter_scala.egg-info/PKG-INFO
10
+ bindings/python/tree_sitter_scala.egg-info/SOURCES.txt
11
+ bindings/python/tree_sitter_scala.egg-info/dependency_links.txt
12
+ bindings/python/tree_sitter_scala.egg-info/not-zip-safe
13
+ bindings/python/tree_sitter_scala.egg-info/requires.txt
14
+ bindings/python/tree_sitter_scala.egg-info/top_level.txt
15
+ src/parser.c
16
+ src/scanner.c
@@ -0,0 +1,2 @@
1
+ _binding
2
+ tree_sitter_scala
@@ -0,0 +1,29 @@
1
+ [build-system]
2
+ requires = ["setuptools>=42", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "tree-sitter-scala"
7
+ description = "Scala grammar for tree-sitter"
8
+ version = "0.23.0"
9
+ keywords = ["incremental", "parsing", "tree-sitter", "scala"]
10
+ classifiers = [
11
+ "Intended Audience :: Developers",
12
+ "License :: OSI Approved :: MIT License",
13
+ "Topic :: Software Development :: Compilers",
14
+ "Topic :: Text Processing :: Linguistic",
15
+ "Typing :: Typed"
16
+ ]
17
+ requires-python = ">=3.9"
18
+ license.text = "MIT"
19
+ readme = "README.md"
20
+
21
+ [project.urls]
22
+ Homepage = "https://github.com/tree-sitter/tree-sitter-scala"
23
+
24
+ [project.optional-dependencies]
25
+ core = ["tree-sitter~=0.21"]
26
+
27
+ [tool.cibuildwheel]
28
+ build = "cp39-*"
29
+ build-frontend = "build"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,62 @@
1
+ from os.path import isdir, join
2
+ from platform import system
3
+
4
+ from setuptools import Extension, find_packages, setup
5
+ from setuptools.command.build import build
6
+ from wheel.bdist_wheel import bdist_wheel
7
+
8
+
9
+ class Build(build):
10
+ def run(self):
11
+ if isdir("queries"):
12
+ dest = join(self.build_lib, "tree_sitter_scala", "queries")
13
+ self.copy_tree("queries", dest)
14
+ super().run()
15
+
16
+
17
+ class BdistWheel(bdist_wheel):
18
+ def get_tag(self):
19
+ python, abi, platform = super().get_tag()
20
+ if python.startswith("cp"):
21
+ python, abi = "cp39", "abi3"
22
+ return python, abi, platform
23
+
24
+
25
+ setup(
26
+ packages=find_packages("bindings/python"),
27
+ package_dir={"": "bindings/python"},
28
+ package_data={
29
+ "tree_sitter_scala": ["*.pyi", "py.typed"],
30
+ "tree_sitter_scala.queries": ["*.scm"],
31
+ },
32
+ ext_package="tree_sitter_scala",
33
+ ext_modules=[
34
+ Extension(
35
+ name="_binding",
36
+ sources=[
37
+ "bindings/python/tree_sitter_scala/binding.c",
38
+ "src/parser.c",
39
+ "src/scanner.c",
40
+ ],
41
+ extra_compile_args=[
42
+ "-std=c11",
43
+ "-fvisibility=hidden",
44
+ ] if system() != "Windows" else [
45
+ "/std:c11",
46
+ "/utf-8",
47
+ ],
48
+ define_macros=[
49
+ ("Py_LIMITED_API", "0x03090000"),
50
+ ("PY_SSIZE_T_CLEAN", None),
51
+ ("TREE_SITTER_HIDE_SYMBOLS", None),
52
+ ],
53
+ include_dirs=["src"],
54
+ py_limited_api=True,
55
+ )
56
+ ],
57
+ cmdclass={
58
+ "build": Build,
59
+ "bdist_wheel": BdistWheel
60
+ },
61
+ zip_safe=False
62
+ )