summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 50904af)
raw | patch | inline | side by side (parent: 50904af)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 14 Oct 2014 07:16:09 +0000 (09:16 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Tue, 14 Oct 2014 07:16:09 +0000 (09:16 +0200) |
This is not fully supported yet as expressions may not be used in all places
yet.
yet.
src/core/store_lookup.c | patch | blob | history | |
src/frontend/grammar.y | patch | blob | history |
index 6aa4095bc5de2370f965e88500bc01f8c817cc8d..0c9d36199abca8e6db5fea26e34c0c52c80b852f 100644 (file)
--- a/src/core/store_lookup.c
+++ b/src/core/store_lookup.c
if (! expr)
return NULL;
- if (sdb_store_expr_eval(expr, NULL, &value))
- return NULL;
- if (value.type != SDB_TYPE_STRING) {
+ if (sdb_store_expr_eval(expr, NULL, &value) ||
+ (value.type != SDB_TYPE_STRING)) {
sdb_data_free_datum(&value);
if (type != SDB_ATTRIBUTE)
return NULL;
diff --git a/src/frontend/grammar.y b/src/frontend/grammar.y
index 93616ac07caa9bf7c9419577e89a559b3f6e38dd..0f01bd33e8a12ba517f4f062315c25a2444602d5 100644 (file)
--- a/src/frontend/grammar.y
+++ b/src/frontend/grammar.y
$$ = sdb_store_expr_fieldvalue(field);
}
|
+ IDENTIFIER '[' IDENTIFIER ']'
+ {
+ $$ = sdb_store_expr_attrvalue($3);
+ free($1); $1 = NULL;
+ free($3); $3 = NULL;
+ }
+ |
data
{
$$ = sdb_store_expr_constvalue(&$1);