From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 046E5431FAF for ; Thu, 13 Sep 2012 05:07:50 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ScyUEzSTN-Fq for ; Thu, 13 Sep 2012 05:07:49 -0700 (PDT) Received: from mail-qc0-f181.google.com (mail-qc0-f181.google.com [209.85.216.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 0FE7F431FAE for ; Thu, 13 Sep 2012 05:07:49 -0700 (PDT) Received: by qcpx40 with SMTP id x40so2153443qcp.26 for ; Thu, 13 Sep 2012 05:07:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type:x-gm-message-state; bh=TkWYKbfMEBYF1D9Q9ebVgsTJFvUfB4GkF8f1oLusMLo=; b=YnptO4/WWqbasf+ZN7KNGdYA/xRfmfGyXlIgsa8nCmr5eLIu7dMlCFTCpeKIkjLCnn kUCMpZXKGFz0RgxFLF8ODXCzR/rIJCO+GGhXPJjCoAu5afCnruhMigv1Yykt5H/vKD5o EYAzQUnx3jLjAkn0CGniGue00Z3xfKHDd0HUfIZd5X/yVmEQg8imJlHjm5dR+vHB5hEy d408pC5aXWa8IJmBAeNHsKDdlH/BKCyH05DR7byb1IrLMDb1ZUD9FbNfQfSL3rWPmgcE Abjj5+aYVE1l2lUahsA5GBY5hx3cPkWayO4VmpVzuHeieki0AQlmo7c5tiP09Oa+l3IX hlvQ== Received: by 10.229.137.68 with SMTP id v4mr1040217qct.51.1347538067079; Thu, 13 Sep 2012 05:07:47 -0700 (PDT) Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3]) by mx.google.com with ESMTPS id go9sm13819503qab.21.2012.09.13.05.07.43 (version=SSLv3 cipher=OTHER); Thu, 13 Sep 2012 05:07:45 -0700 (PDT) From: Jani Nikula To: Michal Nazarewicz , notmuch@notmuchmail.org, David Bremner Subject: Re: [PATCH v3 2/9] parse-time-string: add a date/time parser to notmuch In-Reply-To: References: <89741ec9a9687fca8b30aa1a4877392d355dd3ce.1347484177.git.jani@nikula.org> User-Agent: Notmuch/0.14+43~gd23e654 (http://notmuchmail.org) Emacs/23.2.1 (x86_64-pc-linux-gnu) Date: Thu, 13 Sep 2012 14:07:35 +0200 Message-ID: <878vcerurc.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gm-Message-State: ALoCoQmSVufALqY/8E8qDcmfq2u2TGu+4kc/a7qtkKfkMy+V7Bbhk/JWrWghk57BkOykd7QqA1D8 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2012 12:07:50 -0000 On Thu, 13 Sep 2012, Michal Nazarewicz wrote: > On Wed, Sep 12 2012, Jani Nikula wrote: >> Add a date/time parser to notmuch, to be used for adding date range >> query support for notmuch lib later on. Add the parser to a directory >> of its own to make it independent of the rest of the notmuch code >> base. >> >> Signed-off-by: Jani Nikula > > Have you consider doing the same in bison? I consider the code totally > unreadable and unmaintainable. I do not think you could easily do everything that this parser does in bison. But then I'm not an expert in bison, and I have zero ambition to become one. So I'm biased, and I'm open about it. Even so, if you're suggesting doing this in bison would make this totally readable and maintainable, I urge you to have a good look at [1]. Note that it also does less in more lines of code. (And using it as-is in notmuch has pretty much been turned down in the past.) Finally, I also suggest you actually read and review the code, pointing out concrete issues in readability or maintainability that you see. Especially since an earlier version has received comment "[I]t looks very nice to me. It is pleasantly nice to read." [2]. What you're doing is worthless bikeshedding otherwise. BR, Jani. [1] http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=lib/parse-datetime.y [2] id:"87mx86dlul.fsf@qmul.ac.uk"