<feed xmlns='http://www.w3.org/2005/Atom'>
<title>notmuch/lib/parse-sexp.cc, branch 0.35</title>
<subtitle>thread-based email index, search, and tagging</subtitle>
<id>https://git.notmuchmail.org/git/notmuch/atom?h=0.35</id>
<link rel='self' href='https://git.notmuchmail.org/git/notmuch/atom?h=0.35'/>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/'/>
<updated>2022-01-27T11:48:27Z</updated>
<entry>
<title>lib: strip trailing '/' from pathnames (sexp queries).</title>
<updated>2022-01-27T11:48:27Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2022-01-21T23:38:53Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=2c1d1107f5dacdb4a2c514909fd96f45f83e2f3c'/>
<id>urn:sha1:2c1d1107f5dacdb4a2c514909fd96f45f83e2f3c</id>
<content type='text'>
This changes makes the sexp query parser consistent with the infix one
in ignoring trailing '/'. Here we do a bit better and ignore any
number of trailing '/'.
</content>
</entry>
<entry>
<title>lib/parse-sexp: handle lastmod queries.</title>
<updated>2022-01-26T11:41:02Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2022-01-20T13:36:05Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=0a32741fceb7778ced34064eacb7b5aac2c71638'/>
<id>urn:sha1:0a32741fceb7778ced34064eacb7b5aac2c71638</id>
<content type='text'>
This particular choice of converting strings to integers requires C++11.
</content>
</entry>
<entry>
<title>lib/parse-sexp: support actual date queries.</title>
<updated>2022-01-26T11:41:02Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2022-01-20T13:36:03Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=77ab961a1dce3a31d1f0edf5c9bd83c295575835'/>
<id>urn:sha1:77ab961a1dce3a31d1f0edf5c9bd83c295575835</id>
<content type='text'>
The default argument processing overlaps somewhat with what is already
done in _notmuch_date_strings_to_query, but we can give more specific
error messages for the s-expression context.

The extra generality of _sexp_parse_range will be useful when we
implement additional range prefixes (at least 'lastmod' is needed).
</content>
</entry>
<entry>
<title>lib/parse-sexp: support zero argument date queries</title>
<updated>2022-01-26T11:41:02Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2022-01-20T13:36:01Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=303f207a54325158105aba400702637e670decda'/>
<id>urn:sha1:303f207a54325158105aba400702637e670decda</id>
<content type='text'>
These are not too practical, although they may simplify some user
query generation code. Mainly this adds a new prefix keyword to the
parser.
</content>
</entry>
<entry>
<title>lib/parse-sexp: apply macros</title>
<updated>2021-09-05T00:07:19Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2021-08-24T15:17:41Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=551254eb76c9bb558078f04f21df1f6089cb03d6'/>
<id>urn:sha1:551254eb76c9bb558078f04f21df1f6089cb03d6</id>
<content type='text'>
Macros implement lazy evaluation and lexical scope.  The former is
needed to make certain natural constructs work sensibly (e.g. (tag
,param)) but the latter is mainly future-proofing in case the DSL is
is extended to allow local bindings.

For technical background, see chapters 6 and 17 of [1] (or some other
intermediate programming languages textbook).

[1] http://cs.brown.edu/courses/cs173/2012/book/
</content>
</entry>
<entry>
<title>lib/parse-sexp: thread environment argument through parser</title>
<updated>2021-09-05T00:07:19Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2021-08-24T15:17:40Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=3eca7fcf10a63e642e627539442271872fca58fd'/>
<id>urn:sha1:3eca7fcf10a63e642e627539442271872fca58fd</id>
<content type='text'>
No functionality change, just an extra argument carried everywhere.
</content>
</entry>
<entry>
<title>lib/parse-sexp: support saved s-expression queries</title>
<updated>2021-09-05T00:07:19Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2021-08-24T15:17:39Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=9b9eb1d8bd6464f044facef9507c5988c3d953ca'/>
<id>urn:sha1:9b9eb1d8bd6464f044facef9507c5988c3d953ca</id>
<content type='text'>
It turns out there is not really much code in query-fp.cc useful for
supporting the new syntax. The code we could potentially factor out
amounts to calling notmuch_database_get_config; both the key
construction and the parsing of the results are specific to the query
syntax involved.
</content>
</entry>
<entry>
<title>lib/parse-sexp: handle saved queries</title>
<updated>2021-09-05T00:07:19Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2021-08-24T15:17:37Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=6ab2d9b1a2e62b76960df8e80ff2a45d9c6a8551'/>
<id>urn:sha1:6ab2d9b1a2e62b76960df8e80ff2a45d9c6a8551</id>
<content type='text'>
This provides functionality analogous to query: in the Xapian
QueryParser based parser. Perhaps counterintuitively, the saved
queries currently have to be in the original query syntax (i.e. not
s-expressions).
</content>
</entry>
<entry>
<title>lib/parse-sexp: parse user headers</title>
<updated>2021-09-05T00:07:19Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2021-08-24T15:17:35Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=a07ef8abf5248c1128ddc75b8139ae807a88abd9'/>
<id>urn:sha1:a07ef8abf5248c1128ddc75b8139ae807a88abd9</id>
<content type='text'>
One subtle aspect is the replacement of _find_prefix with
_notmuch_database_prefix, which understands user headers. Otherwise
the code mainly consists of creating a fake prefix record (since the
user prefixes are not in the prefix table) and error handling.
</content>
</entry>
<entry>
<title>lib/parse-sexp: support infix subqueries</title>
<updated>2021-09-05T00:07:19Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2021-08-24T15:17:34Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=cc5992a30470222791c24849da04a3c0403ecce5'/>
<id>urn:sha1:cc5992a30470222791c24849da04a3c0403ecce5</id>
<content type='text'>
This is necessary so that programs can take infix syntax queries from
a user and use the sexp query syntax to construct e.g. a refinement of
that query.
</content>
</entry>
</feed>
