Expr: convert Json bool to 1/0 numerical type.
This commit is contained in:
@@ -53,7 +53,7 @@ all: vset.so
|
||||
.c.xo:
|
||||
$(CC) -I. $(CFLAGS) $(SHOBJ_CFLAGS) -fPIC -c $< -o $@
|
||||
|
||||
vset.xo: redismodule.h
|
||||
vset.xo: redismodule.h expr.c
|
||||
|
||||
vset.so: vset.xo hnsw.xo cJSON.xo
|
||||
$(CC) -o $@ $^ $(SHOBJ_LDFLAGS) $(LIBS) -lc
|
||||
|
||||
@@ -715,6 +715,10 @@ exprtoken *exprJsonToToken(cJSON *js) {
|
||||
obj->str.start = obj->str.heapstr;
|
||||
obj->str.len = strlen(obj->str.heapstr);
|
||||
return obj;
|
||||
} else if (cJSON_IsBool(js)) {
|
||||
exprtoken *obj = exprNewToken(EXPR_TOKEN_NUM);
|
||||
obj->num = cJSON_IsTrue(js);
|
||||
return obj;
|
||||
} else if (cJSON_IsArray(js)) {
|
||||
// First, scan the array to ensure it only
|
||||
// contains strings and numbers. Otherwise the
|
||||
|
||||
Reference in New Issue
Block a user