blob: 3a72b5c31021e9360b48f646ba8cb6d8523c4a52 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder
, colorama, mypy, pyyaml, regex
, dataclasses, typing
, pytestrunner, pytest-mypy
}:
buildPythonPackage rec {
pname = "TatSu";
version = "5.5.0";
src = fetchFromGitHub {
owner = "neogeny";
repo = pname;
rev = "v${version}";
sha256 = "07bmdnwh99p60cgzhlb8s5vwi5v4r5zi8shymxnnarannkc66hzn";
};
disabled = pythonOlder "3.8";
nativeBuildInputs = [ pytestrunner ];
propagatedBuildInputs = [ colorama mypy pyyaml regex ]
++ lib.optionals (pythonOlder "3.7") [ dataclasses ]
++ lib.optionals (pythonOlder "3.5") [ typing ];
checkInputs = [ pytest-mypy ];
checkPhase = ''
pytest test/
'';
meta = with lib; {
description = "Generates Python parsers from grammars in a variation of EBNF";
longDescription = ''
TatSu (the successor to Grako) is a tool that takes grammars in a
variation of EBNF as input, and outputs memoizing (Packrat) PEG parsers in
Python.
'';
homepage = "https://tatsu.readthedocs.io/";
license = licenses.bsd2;
maintainers = with maintainers; [ primeos ];
};
}
|