aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2023-12-31 18:44:09 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2023-12-31 18:44:58 +0000
commitdca0376383009c19cea98420455feb02ec2da8d9 (patch)
tree6c63e9aa7139ee3d55bf402147ecf82de8fa1386
parentcd0102f62ac51c47c35f6d8d6295f2175e688586 (diff)
textproc/py-TatSu: New port: Generate Python parsers from grammars in a variation of EBNF
This is a successor to textproc/py-grako.
-rw-r--r--textproc/Makefile1
-rw-r--r--textproc/py-TatSu/Makefile30
-rw-r--r--textproc/py-TatSu/distinfo3
-rw-r--r--textproc/py-TatSu/pkg-descr10
4 files changed, 44 insertions, 0 deletions
diff --git a/textproc/Makefile b/textproc/Makefile
index 9626d9770b24..2582dca0305f 100644
--- a/textproc/Makefile
+++ b/textproc/Makefile
@@ -1288,6 +1288,7 @@
SUBDIR += py-Morfessor
SUBDIR += py-QDarkStyle
SUBDIR += py-RTFDE
+ SUBDIR += py-TatSu
SUBDIR += py-Tempita
SUBDIR += py-accessible-pygments
SUBDIR += py-acora
diff --git a/textproc/py-TatSu/Makefile b/textproc/py-TatSu/Makefile
new file mode 100644
index 000000000000..d9f381f5f8e5
--- /dev/null
+++ b/textproc/py-TatSu/Makefile
@@ -0,0 +1,30 @@
+PORTNAME= TatSu
+DISTVERSION= 5.11.2
+CATEGORIES= textproc python
+MASTER_SITES= PYPI
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Generate Python parsers from grammars in a variation of EBNF
+WWW= https://tatsu.readthedocs.io/en/stable/
+
+LICENSE= BSD4CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE.txt
+
+BUILD_DEPENDS= ${PY_SETUPTOOLS} \
+ ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
+
+USES= python:3.11+
+USE_PYTHON= pep517 concurrent autoplist
+
+NO_ARCH= yes
+
+POST_PLIST+= fix-plist
+
+post-install: # workaround https://github.com/neogeny/TatSu/issues/333
+ @${RM} -r ${STAGEDIR}${PYTHON_SITELIBDIR}/test
+
+fix-plist:
+ ${REINPLACE_CMD} -e 's|^.*/test/.*$$||' ${TMPPLIST}
+
+.include <bsd.port.mk>
diff --git a/textproc/py-TatSu/distinfo b/textproc/py-TatSu/distinfo
new file mode 100644
index 000000000000..668f22581a7d
--- /dev/null
+++ b/textproc/py-TatSu/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1704045545
+SHA256 (TatSu-5.11.2.tar.gz) = 5c29d9fad096ce9bb6c9b0758ee182bba6dbd6ba1a893540b3707dc2a4306626
+SIZE (TatSu-5.11.2.tar.gz) = 149641
diff --git a/textproc/py-TatSu/pkg-descr b/textproc/py-TatSu/pkg-descr
new file mode 100644
index 000000000000..a9b64426c1a5
--- /dev/null
+++ b/textproc/py-TatSu/pkg-descr
@@ -0,0 +1,10 @@
+TatSu is a tool that takes grammars in a variation of EBNF as input, and outputs
+memoizing (Packrat) PEG parsers in Python.
+
+TatSu can compile a grammar stored in a string into a tatsu.grammars.Grammar
+object that can be used to parse any given input, much like the re module does
+with regular expressions, or it can generate a Python module that implements the
+parser.
+
+TatSu supports left-recursive rules in PEG grammars, and it honors
+left-associativity in the resulting parse trees.