From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id kI6oEC9E8mK56AAAbAwnHQ (envelope-from ) for ; Tue, 09 Aug 2022 13:25:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cNLjEC9E8mJ9pgAA9RJhRA (envelope-from ) for ; Tue, 09 Aug 2022 13:25:35 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CFAEF3D643 for ; Tue, 9 Aug 2022 13:25:34 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 78D245F389; Tue, 9 Aug 2022 11:25:31 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 4ABDA5F375 for ; Tue, 9 Aug 2022 11:25:28 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 2F57F5FBC0; Tue, 9 Aug 2022 07:25:27 -0400 (EDT) Received: (nullmailer pid 1969401 invoked by uid 1000); Tue, 09 Aug 2022 11:25:26 -0000 From: David Bremner To: David Bremner , Ico , notmuch@notmuchmail.org Subject: [PATCH 2/3] WIP/lib: factor out lastmod range handling from sexp parser. Date: Tue, 9 Aug 2022 08:25:17 -0300 Message-Id: <20220809112518.1969385-1-david@tethera.net> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220808115000.1559492-1-david@tethera.net> References: <20220808115000.1559492-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: YITD2NJUVNNXAAJIVVUC6ADOX6J5J6Q6 X-Message-ID-Hash: YITD2NJUVNNXAAJIVVUC6ADOX6J5J6Q6 X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1660044335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=Ivaiwuj4c85FcnoCzDUWVxvgNKN4srCF7w6wCJ1AicM=; b=ZPe92OzyojTfkKmO0kR134ffJS6RJs4b+7DVG6L5tICrl1J1B2jiarvZ2mynZHnBrbclWp /LEdUtWb+QvpcJaYKnLJWwhbZdLrLmXiAKfRl/LRSQFXLBMXsSSaVmlieahQgh39lzhzWK 8F+nyW9RzJnKtafKdYT5r4rb19hmhHZ0cbzDPIAV7I8evfE66++gUlfqNaYdi8CTQztfMe U13OgRMdC+eRMTcQdnmRTOgOc5RrRC8X/mkL2bq4C4ONYxZ+tO+GDhpTXjXyfhJtZtE/os wGFqttGkXmC7ZECyGzN8t3GKddfJ3u2N8wOdILtQnINM3+Y3mPJMOwK0Typ3dA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660044335; a=rsa-sha256; cv=none; b=sfw68y7E9MTtoG+SBQxDSt8zUYhwFYMhfzx1bcoQ60V2Bq1zXTemlun9zYT05XmvlBx1uJ b+zfpXlw4T89FBQsJB/1/fBZ832/14WOfCOPDiiHpP0zE+fRkKWWSLGBuMvQYyltjelf78 +qLRw0vzgSzFLaG1ybVsv+qOboyI+MHpMqQZRwvvk9uReHQhYuDcJoOJl/fOO5CO9GtPns 12j+nr0tr0I00wvK+O3PaOUqFgSV9I74+IrQu+PWkHYD1nMjQPYjwt/FJm9HGC/dL8I2Wt AP1OYbs50YQQA1MQAbtEQ5gko0obSf6w48/i5r9DrM9aWpx6UAL2ionSHDKmqg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 5.72 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: CFAEF3D643 X-Spam-Score: 5.72 X-Migadu-Scanner: scn1.migadu.com X-TUID: oBulGu66PvRi VGhpcyB3aWxsIHBlcm1pdCB0aGUgcmUtdXNlIG9mIHRoZSBzYW1lIGxvZ2ljIGluIHRoZSBpbmZp eCBxdWVyeQ0KcGFyc2VyLiBUaGUgbG9jYXRpb24gb2YgdGhlIHNoYXJlZCBjb2RlIGluIHRoZSBp bmZpeCBzaWRlIGlzIGp1c3QgYQ0KY29udmVudGlvbiBhdCB0aGlzIHBvaW50Lg0KLS0tDQogbGli L01ha2VmaWxlLmxvY2FsICAgICB8ICAzICstDQogbGliL2RhdGFiYXNlLXByaXZhdGUuaCB8ICA2 ICsrKysNCiBsaWIvbGFzdG1vZC1mcC5jYyAgICAgIHwgNjggKysrKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKysrKysrDQogbGliL3Bh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