a1d139de ("lib: add sexp: prefix to Xapian (infix) query parser.",
2022-04-09) introduced sfsexp infix queries. This requires the infix
preprocessor to be built in in a way which does not require sfsexp when
notmuch is built without it.
Make the preprocessor throw a Xapian error in this case (and fix the
build).
Signed-off-by: Michael J Gruber <git@grubix.eu>
std::string query_string,
Xapian::Query &output,
std::string &msg);
-/* parse-sexp.cc */
-notmuch_status_t
-_notmuch_sexp_string_to_xapian_query (notmuch_database_t *notmuch, const char *querystr,
- Xapian::Query &output);
notmuch_status_t
_notmuch_query_expand (notmuch_database_t *notmuch, const char *field, Xapian::Query subquery,
return NOTMUCH_STATUS_SUCCESS;
}
+#if HAVE_SFSEXP
static notmuch_status_t
_notmuch_query_ensure_parsed_sexpr (notmuch_query_t *query)
{
_notmuch_query_cache_terms (query);
return NOTMUCH_STATUS_SUCCESS;
}
+#endif
static notmuch_status_t
_notmuch_query_ensure_parsed (notmuch_query_t *query)
notmuch_status_t status;
Xapian::Query output;
+#if HAVE_SFSEXP
status = _notmuch_sexp_string_to_xapian_query (notmuch, query_string.c_str (), output);
if (status) {
throw Xapian::QueryParserError ("error parsing " + query_string);
}
+#else
+ throw Xapian::QueryParserError ("sexp query parser not available");
+#endif
return output;