tree-sitter-pgn 1.0.6__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.

Potentially problematic release.


This version of tree-sitter-pgn might be problematic. Click here for more details.

@@ -0,0 +1,25 @@
1
+ BSD 2-Clause License
2
+
3
+ Copyright (c) 2021, Roland Walker
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
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,39 @@
1
+ Metadata-Version: 2.1
2
+ Name: tree-sitter-pgn
3
+ Version: 1.0.6
4
+ Summary: PGN grammar for tree-sitter
5
+ License: BSD
6
+ Project-URL: Homepage, https://github.com/rolandwalker/tree-sitter-pgn
7
+ Keywords: incremental,parsing,tree-sitter,PGN,chess
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: License :: OSI Approved :: BSD License
10
+ Classifier: Topic :: Software Development :: Compilers
11
+ Classifier: Topic :: Text Processing :: Linguistic
12
+ Classifier: Typing :: Typed
13
+ Requires-Python: >=3.8
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Provides-Extra: core
17
+ Requires-Dist: tree-sitter~=0.23.0; extra == "core"
18
+
19
+ # tree-sitter-pgn
20
+
21
+ ## Overview
22
+
23
+ Chess Portable Game Notation (PGN) grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).
24
+
25
+ ## Used in
26
+
27
+ * [Emacs pygn-mode](https://github.com/dwcoates/pygn-mode)
28
+
29
+ ## Example
30
+
31
+ <a href="/doc/images/pgn_syntax_highlight.png">
32
+ <img src="/doc/images/pgn_syntax_highlight.png" width=500/>
33
+ </a>
34
+
35
+ ## References
36
+
37
+ * [PGN specification](http://www.saremba.de/chessgml/standards/pgn/pgn-complete.htm)
38
+ * [Commonly-used extensions](https://www.enpassant.dk/chess/palview/enhancedpgn.htm)
39
+ * [Commonly-used annotation glyphs](https://en.wikipedia.org/wiki/Numeric_Annotation_Glyphs)
@@ -0,0 +1,21 @@
1
+ # tree-sitter-pgn
2
+
3
+ ## Overview
4
+
5
+ Chess Portable Game Notation (PGN) grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).
6
+
7
+ ## Used in
8
+
9
+ * [Emacs pygn-mode](https://github.com/dwcoates/pygn-mode)
10
+
11
+ ## Example
12
+
13
+ <a href="/doc/images/pgn_syntax_highlight.png">
14
+ <img src="/doc/images/pgn_syntax_highlight.png" width=500/>
15
+ </a>
16
+
17
+ ## References
18
+
19
+ * [PGN specification](http://www.saremba.de/chessgml/standards/pgn/pgn-complete.htm)
20
+ * [Commonly-used extensions](https://www.enpassant.dk/chess/palview/enhancedpgn.htm)
21
+ * [Commonly-used annotation glyphs](https://en.wikipedia.org/wiki/Numeric_Annotation_Glyphs)
@@ -0,0 +1,5 @@
1
+ "Pgn grammar for tree-sitter"
2
+
3
+ from ._binding import language
4
+
5
+ __all__ = ["language"]
@@ -0,0 +1 @@
1
+ def language() -> int: ...
@@ -0,0 +1,27 @@
1
+ #include <Python.h>
2
+
3
+ typedef struct TSLanguage TSLanguage;
4
+
5
+ TSLanguage *tree_sitter_pgn(void);
6
+
7
+ static PyObject* _binding_language(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args)) {
8
+ return PyCapsule_New(tree_sitter_pgn(), "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,39 @@
1
+ Metadata-Version: 2.1
2
+ Name: tree-sitter-pgn
3
+ Version: 1.0.6
4
+ Summary: PGN grammar for tree-sitter
5
+ License: BSD
6
+ Project-URL: Homepage, https://github.com/rolandwalker/tree-sitter-pgn
7
+ Keywords: incremental,parsing,tree-sitter,PGN,chess
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: License :: OSI Approved :: BSD License
10
+ Classifier: Topic :: Software Development :: Compilers
11
+ Classifier: Topic :: Text Processing :: Linguistic
12
+ Classifier: Typing :: Typed
13
+ Requires-Python: >=3.8
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Provides-Extra: core
17
+ Requires-Dist: tree-sitter~=0.23.0; extra == "core"
18
+
19
+ # tree-sitter-pgn
20
+
21
+ ## Overview
22
+
23
+ Chess Portable Game Notation (PGN) grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).
24
+
25
+ ## Used in
26
+
27
+ * [Emacs pygn-mode](https://github.com/dwcoates/pygn-mode)
28
+
29
+ ## Example
30
+
31
+ <a href="/doc/images/pgn_syntax_highlight.png">
32
+ <img src="/doc/images/pgn_syntax_highlight.png" width=500/>
33
+ </a>
34
+
35
+ ## References
36
+
37
+ * [PGN specification](http://www.saremba.de/chessgml/standards/pgn/pgn-complete.htm)
38
+ * [Commonly-used extensions](https://www.enpassant.dk/chess/palview/enhancedpgn.htm)
39
+ * [Commonly-used annotation glyphs](https://en.wikipedia.org/wiki/Numeric_Annotation_Glyphs)
@@ -0,0 +1,18 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ setup.py
5
+ bindings/python/tree_sitter_pgn/__init__.py
6
+ bindings/python/tree_sitter_pgn/__init__.pyi
7
+ bindings/python/tree_sitter_pgn/binding.c
8
+ bindings/python/tree_sitter_pgn/py.typed
9
+ bindings/python/tree_sitter_pgn.egg-info/PKG-INFO
10
+ bindings/python/tree_sitter_pgn.egg-info/SOURCES.txt
11
+ bindings/python/tree_sitter_pgn.egg-info/dependency_links.txt
12
+ bindings/python/tree_sitter_pgn.egg-info/not-zip-safe
13
+ bindings/python/tree_sitter_pgn.egg-info/requires.txt
14
+ bindings/python/tree_sitter_pgn.egg-info/top_level.txt
15
+ src/parser.c
16
+ src/tree_sitter/alloc.h
17
+ src/tree_sitter/array.h
18
+ src/tree_sitter/parser.h
@@ -0,0 +1,3 @@
1
+
2
+ [core]
3
+ tree-sitter~=0.23.0
@@ -0,0 +1,2 @@
1
+ _binding
2
+ tree_sitter_pgn
@@ -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-pgn"
7
+ description = "PGN grammar for tree-sitter"
8
+ version = "1.0.6"
9
+ keywords = ["incremental", "parsing", "tree-sitter", "PGN", "chess"]
10
+ classifiers = [
11
+ "Intended Audience :: Developers",
12
+ "License :: OSI Approved :: BSD License",
13
+ "Topic :: Software Development :: Compilers",
14
+ "Topic :: Text Processing :: Linguistic",
15
+ "Typing :: Typed"
16
+ ]
17
+ requires-python = ">=3.8"
18
+ license.text = "BSD"
19
+ readme = "README.md"
20
+
21
+ [project.urls]
22
+ Homepage = "https://github.com/rolandwalker/tree-sitter-pgn"
23
+
24
+ [project.optional-dependencies]
25
+ core = ["tree-sitter~=0.23.0"]
26
+
27
+ [tool.cibuildwheel]
28
+ build = "cp38-*"
29
+ build-frontend = "build"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,60 @@
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_pgn", "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 = "cp38", "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_pgn": ["*.pyi", "py.typed"],
30
+ "tree_sitter_pgn.queries": ["*.scm"],
31
+ },
32
+ ext_package="tree_sitter_pgn",
33
+ ext_modules=[
34
+ Extension(
35
+ name="_binding",
36
+ sources=[
37
+ "bindings/python/tree_sitter_pgn/binding.c",
38
+ "src/parser.c",
39
+ # NOTE: if your language uses an external scanner, add it here.
40
+ ],
41
+ extra_compile_args=[
42
+ "-std=c11",
43
+ ] if system() != "Windows" else [
44
+ "/std:c11",
45
+ "/utf-8",
46
+ ],
47
+ define_macros=[
48
+ ("Py_LIMITED_API", "0x03080000"),
49
+ ("PY_SSIZE_T_CLEAN", None)
50
+ ],
51
+ include_dirs=["src"],
52
+ py_limited_api=True,
53
+ )
54
+ ],
55
+ cmdclass={
56
+ "build": Build,
57
+ "bdist_wheel": BdistWheel
58
+ },
59
+ zip_safe=False
60
+ )