From patchwork Sat Dec 21 17:14:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Gibbons X-Patchwork-Id: 19419 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7045317968; Sat, 21 Dec 2019 17:15:16 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 2B13717964 for ; Sat, 21 Dec 2019 17:15:16 +0000 (GMT) Received: from localhost ([::1]:41074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iiiLT-0006Cd-G2 for patchwork@mira.cbaines.net; Sat, 21 Dec 2019 12:15:15 -0500 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 X-Loop: help-debbugs@gnu.org Subject: [bug#38554] [PATCH v2 2/3] gnu: Add python-funcparserlib. References: <660a10a1f02b4818a28dfea58b544956437d4b66.camel@gmail.com> In-Reply-To: <660a10a1f02b4818a28dfea58b544956437d4b66.camel@gmail.com> Resent-From: Jesse Gibbons Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 21 Dec 2019 17:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38554 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 38554 <38554@debbugs.gnu.org> Received: via spool by 38554-submit@debbugs.gnu.org id=B38554.157694847021391 (code B ref 38554); Sat, 21 Dec 2019 17:15:02 +0000 Received: (at 38554) by debbugs.gnu.org; 21 Dec 2019 17:14:30 +0000 Received: from localhost ([127.0.0.1]:48737 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iiiKj-0005Yx-NT for submit@debbugs.gnu.org; Sat, 21 Dec 2019 12:14:29 -0500 Received: from mail-pf1-f174.google.com ([209.85.210.174]:36806) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iiiKi-0005Ym-Mt for 38554@debbugs.gnu.org; Sat, 21 Dec 2019 12:14:29 -0500 Received: by mail-pf1-f174.google.com with SMTP id x184so6981675pfb.3 for <38554@debbugs.gnu.org>; Sat, 21 Dec 2019 09:14:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:mime-version:user-agent :content-transfer-encoding; bh=AyNb6AVmxPSaL98n2f/d3MEti0XYMsUc6HQE1hOhGEo=; b=MPxpnlaCHJSY/xNHDfjh6yI1e2yZWTeMiv8a/Ahem3j6eFjY0YCT8dSWrC7Xfzmo+K Ft+zsV0+Pw1OQfSFEbfFnzB9zCKQBEFQt3lePSNtxlsU6BzPws1BwZ5uxN6Vow1WBCaF qZgWBI/ixGiLaKIz9XtXhK31mT5ypsmLiHAGCIaCFVCxhbwpCuL1E6AeVC9vcY5rVqXs KD2N0kE1kAQ3GSM9K1SkHOnc3i5IfY2bYNRUl9mofjW+E5JoZBU2+OOYDZdjTmhG3GLs TfuHN5jY6+VnpDlDCD/tw+qZjAjzQWujWLM8VF+0Il8w77j6jSNADgNrATC2W4UUo+0t 2q/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:mime-version :user-agent:content-transfer-encoding; bh=AyNb6AVmxPSaL98n2f/d3MEti0XYMsUc6HQE1hOhGEo=; b=kH9sG8zWJv3gbqVkC+ZQG/Mp+Qi3XHdy3YYx+nkyeNPiAAjBDJuZw0UndxYAOSy+q1 fYiGkNkADIgS2UIL72GlD44GYGAIh12V9dl3A1rh8AMVRloJRn3vfueqCXiWpS7iIlpo sdrzHhFGTlNmYzX1w8AYOiGOtj8xA7aNiCsQCfpbUAEHFPMFA51YAWKH2SbbyIGUmEfF KdeWeemb3xa8LSX/s4zeCnsn8xaxTT/jUP9z8UgL1wXhLvAObBc+vUcC/wRZBPnenQ2A MS/kFFS36XWlty1C75+UugUn6FTFhcSZLJAsFXMocA3EetN8ae9WVObwf/lrgWIw+QaG h+VQ== X-Gm-Message-State: APjAAAUh1lZhsz3E6bUfUAC5DuLsD1ioFaEAzwhgXOTwiPS+N2LcLMiU UgPPDdJ+wV6lp/tfxDMwlbcMiEhM X-Google-Smtp-Source: APXvYqzdVIxLMAT6xWRb859SuBbCK+57HDs1ox18hdtE4riMDt36FVKsFS2PPvA/XzVP4fYo6uBazA== X-Received: by 2002:a62:1783:: with SMTP id 125mr3544679pfx.189.1576948462457; Sat, 21 Dec 2019 09:14:22 -0800 (PST) Received: from piranhaplant.local ([199.68.53.171]) by smtp.googlemail.com with ESMTPSA id o14sm15063423pgm.67.2019.12.21.09.14.21 for <38554@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2019 09:14:21 -0800 (PST) Message-ID: From: Jesse Gibbons Date: Sat, 21 Dec 2019 10:14:21 -0700 MIME-Version: 1.0 User-Agent: Evolution 3.32.4 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/python-xyz.scm (python-funcparserlib): New variable. --- gnu/packages/python-xyz.scm | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) +DSLs (domain specific languages).") + (license license:expat))) + +(define-public python2-funcparserlib + (package-with-python2 python-funcparserlib)) 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