tree-sitter-daslang 0.6.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.
Files changed (23) hide show
  1. tree_sitter_daslang-0.6.0/LICENSE +29 -0
  2. tree_sitter_daslang-0.6.0/PKG-INFO +71 -0
  3. tree_sitter_daslang-0.6.0/README.md +51 -0
  4. tree_sitter_daslang-0.6.0/bindings/python/tree_sitter_daslang/__init__.py +45 -0
  5. tree_sitter_daslang-0.6.0/bindings/python/tree_sitter_daslang/__init__.pyi +17 -0
  6. tree_sitter_daslang-0.6.0/bindings/python/tree_sitter_daslang/binding.c +35 -0
  7. tree_sitter_daslang-0.6.0/bindings/python/tree_sitter_daslang/py.typed +0 -0
  8. tree_sitter_daslang-0.6.0/bindings/python/tree_sitter_daslang.egg-info/PKG-INFO +71 -0
  9. tree_sitter_daslang-0.6.0/bindings/python/tree_sitter_daslang.egg-info/SOURCES.txt +15 -0
  10. tree_sitter_daslang-0.6.0/bindings/python/tree_sitter_daslang.egg-info/dependency_links.txt +1 -0
  11. tree_sitter_daslang-0.6.0/bindings/python/tree_sitter_daslang.egg-info/not-zip-safe +1 -0
  12. tree_sitter_daslang-0.6.0/bindings/python/tree_sitter_daslang.egg-info/requires.txt +3 -0
  13. tree_sitter_daslang-0.6.0/bindings/python/tree_sitter_daslang.egg-info/top_level.txt +2 -0
  14. tree_sitter_daslang-0.6.0/pyproject.toml +29 -0
  15. tree_sitter_daslang-0.6.0/queries/highlights.scm +524 -0
  16. tree_sitter_daslang-0.6.0/queries/tags.scm +104 -0
  17. tree_sitter_daslang-0.6.0/setup.cfg +4 -0
  18. tree_sitter_daslang-0.6.0/setup.py +78 -0
  19. tree_sitter_daslang-0.6.0/src/parser.c +998957 -0
  20. tree_sitter_daslang-0.6.0/src/scanner.c +1186 -0
  21. tree_sitter_daslang-0.6.0/src/tree_sitter/alloc.h +54 -0
  22. tree_sitter_daslang-0.6.0/src/tree_sitter/array.h +336 -0
  23. tree_sitter_daslang-0.6.0/src/tree_sitter/parser.h +286 -0
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, Gaijin Entertainment
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,71 @@
1
+ Metadata-Version: 2.4
2
+ Name: tree-sitter-daslang
3
+ Version: 0.6.0
4
+ Summary: Daslang grammar for tree-sitter
5
+ Author: Gaijin Entertainment
6
+ Author-email: Anton Zinovyev <xog3@yandex.ru>
7
+ License: BSD-3-Clause
8
+ Project-URL: Homepage, https://github.com/GaijinEntertainment/tree-sitter-daslang
9
+ Keywords: incremental,parsing,tree-sitter,daslang
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Topic :: Software Development :: Compilers
12
+ Classifier: Topic :: Text Processing :: Linguistic
13
+ Classifier: Typing :: Typed
14
+ Requires-Python: >=3.10
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Provides-Extra: core
18
+ Requires-Dist: tree-sitter~=0.25; extra == "core"
19
+ Dynamic: license-file
20
+
21
+ # tree-sitter-daslang
22
+
23
+ [![CI][ci]](https://github.com/GaijinEntertainment/tree-sitter-daslang/actions/workflows/ci.yml)
24
+ [![crates][crates]](https://crates.io/crates/tree-sitter-daslang)
25
+ [![npm][npm]](https://www.npmjs.com/package/tree-sitter-daslang)
26
+ [![pypi][pypi]](https://pypi.org/project/tree-sitter-daslang)
27
+
28
+ Daslang grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter). [Daslang](https://daslang.io/) is a
29
+ statically typed programming language for games and real-time applications. Its compiler is in the daslang repository,
30
+ [GaijinEntertainment/daScript](https://github.com/GaijinEntertainment/daScript).
31
+
32
+ The grammar follows the gen2 syntax of the daslang compiler. It does not read the gen1 syntax, which a file selects with
33
+ `options gen2 = false`. The grammar checks the syntax only: it does not do the checks that the compiler does after it
34
+ reads a file, such as type inference and name lookup.
35
+
36
+ ## Contributing
37
+
38
+ The grammar is the `tree-sitter-daslang` directory of the daslang repository,
39
+ [GaijinEntertainment/daScript](https://github.com/GaijinEntertainment/daScript).
40
+ [GaijinEntertainment/tree-sitter-daslang](https://github.com/GaijinEntertainment/tree-sitter-daslang) is a read-only
41
+ copy of that directory and publishes the packages. Report problems and open pull requests in the daslang repository.
42
+
43
+ ## Versioning
44
+
45
+ The version of the grammar is `X.Y.P`. It is not a semantic version.
46
+
47
+ ```text
48
+ 0.6.1
49
+ | |
50
+ | +-- P: the number of the grammar release for that daslang version; the first release is 0
51
+ +------ X.Y: the newest daslang version that the grammar covers
52
+ ```
53
+
54
+ - `X.Y` is the major and minor number of the newest daslang version that the grammar covers. Each `0.6.P` covers
55
+ daslang 0.6, and the first release for daslang 0.7 is `0.7.0`.
56
+ - `P` is the grammar's own number. It counts the releases of the grammar for one daslang version, and it does not
57
+ follow the patch number of the compiler. `0.6.1` is the second release of the grammar for daslang 0.6. It is not a
58
+ grammar for the compiler release 0.6.1.
59
+
60
+ A new `P` is a new release of the grammar for the same daslang version: a correction of the trees or of the queries. A
61
+ new `X.Y` adds the syntax of a newer daslang version.
62
+
63
+ ## References
64
+
65
+ - [The daslang parser](https://github.com/GaijinEntertainment/daScript/tree/master/src/parser)
66
+ - [The daslang language reference](https://github.com/GaijinEntertainment/daScript/tree/master/doc/source/reference/language)
67
+
68
+ [ci]: https://img.shields.io/github/actions/workflow/status/GaijinEntertainment/tree-sitter-daslang/ci.yml?logo=github&label=CI
69
+ [crates]: https://img.shields.io/crates/v/tree-sitter-daslang?logo=rust
70
+ [npm]: https://img.shields.io/npm/v/tree-sitter-daslang?logo=npm
71
+ [pypi]: https://img.shields.io/pypi/v/tree-sitter-daslang?logo=pypi&logoColor=ffd242
@@ -0,0 +1,51 @@
1
+ # tree-sitter-daslang
2
+
3
+ [![CI][ci]](https://github.com/GaijinEntertainment/tree-sitter-daslang/actions/workflows/ci.yml)
4
+ [![crates][crates]](https://crates.io/crates/tree-sitter-daslang)
5
+ [![npm][npm]](https://www.npmjs.com/package/tree-sitter-daslang)
6
+ [![pypi][pypi]](https://pypi.org/project/tree-sitter-daslang)
7
+
8
+ Daslang grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter). [Daslang](https://daslang.io/) is a
9
+ statically typed programming language for games and real-time applications. Its compiler is in the daslang repository,
10
+ [GaijinEntertainment/daScript](https://github.com/GaijinEntertainment/daScript).
11
+
12
+ The grammar follows the gen2 syntax of the daslang compiler. It does not read the gen1 syntax, which a file selects with
13
+ `options gen2 = false`. The grammar checks the syntax only: it does not do the checks that the compiler does after it
14
+ reads a file, such as type inference and name lookup.
15
+
16
+ ## Contributing
17
+
18
+ The grammar is the `tree-sitter-daslang` directory of the daslang repository,
19
+ [GaijinEntertainment/daScript](https://github.com/GaijinEntertainment/daScript).
20
+ [GaijinEntertainment/tree-sitter-daslang](https://github.com/GaijinEntertainment/tree-sitter-daslang) is a read-only
21
+ copy of that directory and publishes the packages. Report problems and open pull requests in the daslang repository.
22
+
23
+ ## Versioning
24
+
25
+ The version of the grammar is `X.Y.P`. It is not a semantic version.
26
+
27
+ ```text
28
+ 0.6.1
29
+ | |
30
+ | +-- P: the number of the grammar release for that daslang version; the first release is 0
31
+ +------ X.Y: the newest daslang version that the grammar covers
32
+ ```
33
+
34
+ - `X.Y` is the major and minor number of the newest daslang version that the grammar covers. Each `0.6.P` covers
35
+ daslang 0.6, and the first release for daslang 0.7 is `0.7.0`.
36
+ - `P` is the grammar's own number. It counts the releases of the grammar for one daslang version, and it does not
37
+ follow the patch number of the compiler. `0.6.1` is the second release of the grammar for daslang 0.6. It is not a
38
+ grammar for the compiler release 0.6.1.
39
+
40
+ A new `P` is a new release of the grammar for the same daslang version: a correction of the trees or of the queries. A
41
+ new `X.Y` adds the syntax of a newer daslang version.
42
+
43
+ ## References
44
+
45
+ - [The daslang parser](https://github.com/GaijinEntertainment/daScript/tree/master/src/parser)
46
+ - [The daslang language reference](https://github.com/GaijinEntertainment/daScript/tree/master/doc/source/reference/language)
47
+
48
+ [ci]: https://img.shields.io/github/actions/workflow/status/GaijinEntertainment/tree-sitter-daslang/ci.yml?logo=github&label=CI
49
+ [crates]: https://img.shields.io/crates/v/tree-sitter-daslang?logo=rust
50
+ [npm]: https://img.shields.io/npm/v/tree-sitter-daslang?logo=npm
51
+ [pypi]: https://img.shields.io/pypi/v/tree-sitter-daslang?logo=pypi&logoColor=ffd242
@@ -0,0 +1,45 @@
1
+ """Daslang grammar for tree-sitter"""
2
+
3
+ from ._binding import language
4
+
5
+
6
+ def _get_query(name, file):
7
+ files = globals().get("_files")
8
+ if files is None:
9
+ from importlib.resources import files
10
+ globals()["_files"] = files
11
+ try:
12
+ query = files(f"{__package__}") / file
13
+ globals()[name] = query.read_text()
14
+ except FileNotFoundError:
15
+ globals()[name] = None
16
+ return globals()[name]
17
+
18
+
19
+ def __getattr__(name):
20
+ if name == "HIGHLIGHTS_QUERY":
21
+ return _get_query("HIGHLIGHTS_QUERY", "queries/highlights.scm")
22
+ if name == "INJECTIONS_QUERY":
23
+ return _get_query("INJECTIONS_QUERY", "queries/injections.scm")
24
+ if name == "LOCALS_QUERY":
25
+ return _get_query("LOCALS_QUERY", "queries/locals.scm")
26
+ if name == "TAGS_QUERY":
27
+ return _get_query("TAGS_QUERY", "queries/tags.scm")
28
+
29
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
30
+
31
+
32
+ __all__ = [
33
+ "language",
34
+ "HIGHLIGHTS_QUERY",
35
+ "INJECTIONS_QUERY",
36
+ "LOCALS_QUERY",
37
+ "TAGS_QUERY",
38
+ ]
39
+
40
+
41
+ def __dir__():
42
+ return sorted(__all__ + [
43
+ "__all__", "__builtins__", "__cached__", "__doc__", "__file__",
44
+ "__loader__", "__name__", "__package__", "__path__", "__spec__",
45
+ ])
@@ -0,0 +1,17 @@
1
+ from typing import Final
2
+ from typing_extensions import CapsuleType
3
+
4
+ HIGHLIGHTS_QUERY: Final[str] | None
5
+ """The syntax highlighting query for this grammar."""
6
+
7
+ INJECTIONS_QUERY: Final[str] | None
8
+ """The language injection query for this grammar."""
9
+
10
+ LOCALS_QUERY: Final[str] | None
11
+ """The local variable query for this grammar."""
12
+
13
+ TAGS_QUERY: Final[str] | None
14
+ """The symbol tagging query for this grammar."""
15
+
16
+ def language() -> CapsuleType:
17
+ """The tree-sitter language function for this grammar."""
@@ -0,0 +1,35 @@
1
+ #include <Python.h>
2
+
3
+ typedef struct TSLanguage TSLanguage;
4
+
5
+ TSLanguage *tree_sitter_daslang(void);
6
+
7
+ static PyObject* _binding_language(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args)) {
8
+ return PyCapsule_New(tree_sitter_daslang(), "tree_sitter.Language", NULL);
9
+ }
10
+
11
+ static struct PyModuleDef_Slot slots[] = {
12
+ #ifdef Py_GIL_DISABLED
13
+ {Py_mod_gil, Py_MOD_GIL_NOT_USED},
14
+ #endif
15
+ {0, NULL}
16
+ };
17
+
18
+ static PyMethodDef methods[] = {
19
+ {"language", _binding_language, METH_NOARGS,
20
+ "Get the tree-sitter language for this grammar."},
21
+ {NULL, NULL, 0, NULL}
22
+ };
23
+
24
+ static struct PyModuleDef module = {
25
+ .m_base = PyModuleDef_HEAD_INIT,
26
+ .m_name = "_binding",
27
+ .m_doc = NULL,
28
+ .m_size = 0,
29
+ .m_methods = methods,
30
+ .m_slots = slots,
31
+ };
32
+
33
+ PyMODINIT_FUNC PyInit__binding(void) {
34
+ return PyModuleDef_Init(&module);
35
+ }
@@ -0,0 +1,71 @@
1
+ Metadata-Version: 2.4
2
+ Name: tree-sitter-daslang
3
+ Version: 0.6.0
4
+ Summary: Daslang grammar for tree-sitter
5
+ Author: Gaijin Entertainment
6
+ Author-email: Anton Zinovyev <xog3@yandex.ru>
7
+ License: BSD-3-Clause
8
+ Project-URL: Homepage, https://github.com/GaijinEntertainment/tree-sitter-daslang
9
+ Keywords: incremental,parsing,tree-sitter,daslang
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Topic :: Software Development :: Compilers
12
+ Classifier: Topic :: Text Processing :: Linguistic
13
+ Classifier: Typing :: Typed
14
+ Requires-Python: >=3.10
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Provides-Extra: core
18
+ Requires-Dist: tree-sitter~=0.25; extra == "core"
19
+ Dynamic: license-file
20
+
21
+ # tree-sitter-daslang
22
+
23
+ [![CI][ci]](https://github.com/GaijinEntertainment/tree-sitter-daslang/actions/workflows/ci.yml)
24
+ [![crates][crates]](https://crates.io/crates/tree-sitter-daslang)
25
+ [![npm][npm]](https://www.npmjs.com/package/tree-sitter-daslang)
26
+ [![pypi][pypi]](https://pypi.org/project/tree-sitter-daslang)
27
+
28
+ Daslang grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter). [Daslang](https://daslang.io/) is a
29
+ statically typed programming language for games and real-time applications. Its compiler is in the daslang repository,
30
+ [GaijinEntertainment/daScript](https://github.com/GaijinEntertainment/daScript).
31
+
32
+ The grammar follows the gen2 syntax of the daslang compiler. It does not read the gen1 syntax, which a file selects with
33
+ `options gen2 = false`. The grammar checks the syntax only: it does not do the checks that the compiler does after it
34
+ reads a file, such as type inference and name lookup.
35
+
36
+ ## Contributing
37
+
38
+ The grammar is the `tree-sitter-daslang` directory of the daslang repository,
39
+ [GaijinEntertainment/daScript](https://github.com/GaijinEntertainment/daScript).
40
+ [GaijinEntertainment/tree-sitter-daslang](https://github.com/GaijinEntertainment/tree-sitter-daslang) is a read-only
41
+ copy of that directory and publishes the packages. Report problems and open pull requests in the daslang repository.
42
+
43
+ ## Versioning
44
+
45
+ The version of the grammar is `X.Y.P`. It is not a semantic version.
46
+
47
+ ```text
48
+ 0.6.1
49
+ | |
50
+ | +-- P: the number of the grammar release for that daslang version; the first release is 0
51
+ +------ X.Y: the newest daslang version that the grammar covers
52
+ ```
53
+
54
+ - `X.Y` is the major and minor number of the newest daslang version that the grammar covers. Each `0.6.P` covers
55
+ daslang 0.6, and the first release for daslang 0.7 is `0.7.0`.
56
+ - `P` is the grammar's own number. It counts the releases of the grammar for one daslang version, and it does not
57
+ follow the patch number of the compiler. `0.6.1` is the second release of the grammar for daslang 0.6. It is not a
58
+ grammar for the compiler release 0.6.1.
59
+
60
+ A new `P` is a new release of the grammar for the same daslang version: a correction of the trees or of the queries. A
61
+ new `X.Y` adds the syntax of a newer daslang version.
62
+
63
+ ## References
64
+
65
+ - [The daslang parser](https://github.com/GaijinEntertainment/daScript/tree/master/src/parser)
66
+ - [The daslang language reference](https://github.com/GaijinEntertainment/daScript/tree/master/doc/source/reference/language)
67
+
68
+ [ci]: https://img.shields.io/github/actions/workflow/status/GaijinEntertainment/tree-sitter-daslang/ci.yml?logo=github&label=CI
69
+ [crates]: https://img.shields.io/crates/v/tree-sitter-daslang?logo=rust
70
+ [npm]: https://img.shields.io/npm/v/tree-sitter-daslang?logo=npm
71
+ [pypi]: https://img.shields.io/pypi/v/tree-sitter-daslang?logo=pypi&logoColor=ffd242
@@ -0,0 +1,15 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ setup.py
5
+ bindings/python/tree_sitter_daslang/__init__.py
6
+ bindings/python/tree_sitter_daslang/__init__.pyi
7
+ bindings/python/tree_sitter_daslang/binding.c
8
+ bindings/python/tree_sitter_daslang/py.typed
9
+ bindings/python/tree_sitter_daslang.egg-info/PKG-INFO
10
+ bindings/python/tree_sitter_daslang.egg-info/SOURCES.txt
11
+ bindings/python/tree_sitter_daslang.egg-info/dependency_links.txt
12
+ bindings/python/tree_sitter_daslang.egg-info/not-zip-safe
13
+ bindings/python/tree_sitter_daslang.egg-info/requires.txt
14
+ bindings/python/tree_sitter_daslang.egg-info/top_level.txt
15
+ src/parser.c
@@ -0,0 +1,2 @@
1
+ _binding
2
+ tree_sitter_daslang
@@ -0,0 +1,29 @@
1
+ [build-system]
2
+ build-backend = "setuptools.build_meta"
3
+ requires = [ "setuptools>=62.4.0", "wheel" ]
4
+
5
+ [project]
6
+ authors = [ { name = "Gaijin Entertainment" }, { email = "xog3@yandex.ru", name = "Anton Zinovyev" } ]
7
+ classifiers = [
8
+ "Intended Audience :: Developers",
9
+ "Topic :: Software Development :: Compilers",
10
+ "Topic :: Text Processing :: Linguistic",
11
+ "Typing :: Typed",
12
+ ]
13
+ description = "Daslang grammar for tree-sitter"
14
+ keywords = [ "incremental", "parsing", "tree-sitter", "daslang" ]
15
+ license.text = "BSD-3-Clause"
16
+ name = "tree-sitter-daslang"
17
+ readme = "README.md"
18
+ requires-python = ">=3.10"
19
+ version = "0.6.0"
20
+
21
+ [project.urls]
22
+ Homepage = "https://github.com/GaijinEntertainment/tree-sitter-daslang"
23
+
24
+ [project.optional-dependencies]
25
+ core = [ "tree-sitter~=0.25" ]
26
+
27
+ [tool.cibuildwheel]
28
+ build = "cp310-*"
29
+ build-frontend = "build"