From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:59744) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iiiLI-0006BA-6s for guix-patches@gnu.org; Sat, 21 Dec 2019 12:15:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iiiLG-0004rh-Kr for guix-patches@gnu.org; Sat, 21 Dec 2019 12:15:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:42768) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iiiLG-0004qs-D4 for guix-patches@gnu.org; Sat, 21 Dec 2019 12:15:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iiiLG-0005aH-8D for guix-patches@gnu.org; Sat, 21 Dec 2019 12:15:02 -0500 Subject: [bug#38554] [PATCH v2 2/3] gnu: Add python-funcparserlib. References: <660a10a1f02b4818a28dfea58b544956437d4b66.camel@gmail.com> In-Reply-To: <660a10a1f02b4818a28dfea58b544956437d4b66.camel@gmail.com> Resent-Message-ID: Message-ID: From: Jesse Gibbons Content-Type: text/plain; charset="UTF-8" Date: Sat, 21 Dec 2019 10:14:21 -0700 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 38554 <38554@debbugs.gnu.org> * gnu/packages/python-xyz.scm (python-funcparserlib): New variable. --- gnu/packages/python-xyz.scm | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 9243272dc9..906bd9c8d2 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -16998,3 +16998,52 @@ load entry points more quickly.") (define-public python2-fastentrypoints (package-with-python2 python-fastentrypoints)) + +(define-public python-funcparserlib + (package + (name "python-funcparserlib") + (version "0.3.6") + (source + (origin + (method url-fetch) + (uri (pypi-uri "funcparserlib" version)) + (sha256 + (base32 + "07f9cgjr3h4j2m67fhwapn8fja87vazl58zsj4yppf9y3an2x6dp")))) + (native-inputs + `(("python-tox" ,python-tox))) + (arguments + `(#:phases + (modify-phases %standard-phases + (replace 'check + (lambda _ + (invoke "tox")))))) + (build-system python-build-system) + (home-page + "https://github.com/vlasovskikh/funcparserlib") + (synopsis + "Recursive descent parsing library based on functional combinators") + (description + "This package is a recurisve descent parsing library for Python based on +functional combinators. Parser combinators are just higher-order functions that +take parsers as their arguments and return them as result values. Parser +combinators are: + +@itemize @bullet +@item First-class values +@item Extremely composable +@item Tend to make the code quite compact +@item Resemble the readable notation of xBNF grammars +@end itemize + +Parsers made with funcparserlib are pure-Python LL(*) parsers. It means that +it's very easy to write them without thinking about look-aheads and all that +hardcore parsing stuff. But the recursive descent parsing is a rather slow +method compared to LL(k) or LR(k) algorithms. + +So the primary domain for funcparserlib is parsing little languages or external +DSLs (domain specific languages).") + (license license:expat))) + +(define-public python2-funcparserlib + (package-with-python2 python-funcparserlib))