From: Tomi Ollila Date: Sat, 27 Oct 2012 20:38:00 +0000 (+0300) Subject: Re: [PATCH v5 2/9] parse-time-string: add a date/time parser to notmuch X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=eff7289cca74c91bfdb71d50245b8841275f9d2d;p=notmuch-archives.git Re: [PATCH v5 2/9] parse-time-string: add a date/time parser to notmuch --- diff --git a/c6/f28ffea63134adb2ee62e5d228210ba5ee9174 b/c6/f28ffea63134adb2ee62e5d228210ba5ee9174 new file mode 100644 index 000000000..61463c6ae --- /dev/null +++ b/c6/f28ffea63134adb2ee62e5d228210ba5ee9174 @@ -0,0 +1,106 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id DE6B4431FAF + for ; Sat, 27 Oct 2012 13:38:02 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 K1EhJFdUrBFx for ; + Sat, 27 Oct 2012 13:38:01 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id C3732431FBF + for ; Sat, 27 Oct 2012 13:38:01 -0700 (PDT) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id D49CF100045; + Sat, 27 Oct 2012 23:38:00 +0300 (EEST) +From: Tomi Ollila +To: Austin Clements , Jani Nikula +Subject: Re: [PATCH v5 2/9] parse-time-string: add a date/time parser to + notmuch +In-Reply-To: <20121025185816.GX14861@mit.edu> +References: + + <20121022081444.GM14861@mit.edu> <20121025185816.GX14861@mit.edu> +User-Agent: Notmuch/0.14+59~gf9031cd (http://notmuchmail.org) Emacs/24.2.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +Cc: notmuch@notmuchmail.org +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: Sat, 27 Oct 2012 20:38:03 -0000 + +On Thu, Oct 25 2012, Austin Clements wrote: + +> Quoth myself on Oct 22 at 4:14 am: +>> Overall this looks pretty good to me, and I must say, this parser is +>> amazingly flexible and copes well with a remarkably hostile grammar. +>> +>> A lot of little comments below (sorry if any of this ground has +>> already been covered in the previous four versions). +>> +>> I do have one broad comment. While I'm all for ad hoc parsers for ad +>> hoc grammars like dates, there is one piece of the literature I think +>> this parser suffers for by ignoring: tokenizing. I think it would +>> simplify a lot of this code if it did a tokenizing pass before the +>> parsing pass. It doesn't have to be a serious tokenizer with +>> streaming and keywords and token types and junk; just something that +>> first splits the input into substrings, possibly just non-overlapping +>> matches of [[:digit:]]+|[[:alpha:]]+|[-+:/.]. This would simplify the +>> handling of postponed numbers because, with trivial lookahead in the +>> token stream, you wouldn't have to postpone them. Likewise, it would +>> eliminate last_field. It would simplify keyword matching because you +>> wouldn't have to worry about matching substrings (I spent a long time +>> staring at that code before I figured out what it would and wouldn't +>> accept). Most important, I think it would make the parser more +>> predictable for users; for example, the parser currently accepts +>> things like "saturtoday" because it's aggressively single-pass. +> +> I should add that I am not at all opposed to this patch as it is +> currently designed. We need a date parser. My comment about +> separating tokenization is just a way that this code could probably be +> simplified if someone were so inclined or if simplifying the code +> would help it pass any hurdles. + +What if the current patch set, i.e. messages + +$ grep Message-Id: ~/patch | sed 's/Message-Id: /id:/; y/<>/""/' +id:"e684cadbb5a01b6079ef344b0d6f97541847914a.1350854171.git.jani@nikula.org" +id:"a90d3b687895a26f765539d6c0420038a74ee42f.1350854171.git.jani@nikula.org" +id:"75a8f129d5e0d824b3e04ddfc1816c45fa0ec70d.1350854171.git.jani@nikula.org" +id:"606a94d565e6b21abfc59d6ba9676a807d669127.1350854171.git.jani@nikula.org" +id:"cbd383bfc4bf844bb0366f13f675d48956137c52.1350854171.git.jani@nikula.org" +id:"f21b8702728457c087478b26700e9448bc16c61d.1350854171.git.jani@nikula.org" +id:"37026480956679b12e82e4975f1837e93ef1c531.1350854171.git.jani@nikula.org" +id:"cff9c1dd87b8bc11326dca0b3589c81656500f5e.1350854171.git.jani@nikula.org" + +(patches 1-8 / 9 -- NEWS patch is stale) would just be pushed: there are +just few trivial things to be tuned and NEWS rebased -- which I think +Jani will gladly do... It is just so much easier for him to continue +and us others to review the new diffs than these whole patches again +and again... At least I volunteer to track that these remaining issues +(tokenizer not included :). + +Tomi