From 443e78f2e7d7894a1a9cb3cac79e4b1a84ec7a11 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 5 Jul 2011 23:42:31 +0100 Subject: [PATCH] The static function bool(), which is part of cql_to_ccl_r(), now makes some attempt to recognise and deal with proximity. Right now, all it does it recognise the CQL operator name "prox" and map it to the CCL operator "!" rather than the unrecognised plain word "prox" -- this suffices to get SOME indication of proximity into the resulting CCL, which is a big step forward for bug #4407. We ought to check for a an /ordered=0 relation modifier and emit "%" instead in that case. --- src/cql2ccl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cql2ccl.c b/src/cql2ccl.c index f427e7c..4a3932e 100644 --- a/src/cql2ccl.c +++ b/src/cql2ccl.c @@ -133,15 +133,19 @@ static int bool(struct cql_node *cn, void (*pr)(const char *buf, void *client_data), void *client_data) { + char *value = cn->u.boolean.value; int r; + /* Rather lame initial attempt at interpreting proximity */ + if (!strcmp(value, "prox")) value = "!"; + pr("(", client_data); r = cql_to_ccl_r(cn->u.boolean.left, pr, client_data); if (r) return r; pr(" ", client_data); - pr(cn->u.boolean.value, client_data); + pr(value, client_data); pr(" ", client_data); r = cql_to_ccl_r(cn->u.boolean.right, pr, client_data); -- 1.7.10.4