summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ee48af6)
raw | patch | inline | side by side (parent: ee48af6)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 23 Jun 2014 18:40:24 +0000 (20:40 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 23 Jun 2014 18:40:24 +0000 (20:40 +0200) |
src/frontend/grammar.y | patch | blob | history |
diff --git a/src/frontend/grammar.y b/src/frontend/grammar.y
index 402e17087f692744f2dea73068654daced1d1134..c4c47755caa9b2c032ff0593b2a2134130a2c607 100644 (file)
--- a/src/frontend/grammar.y
+++ b/src/frontend/grammar.y
const char *sstr; /* static string */
char *str;
+ sdb_data_t data;
+
sdb_llist_t *list;
sdb_conn_node_t *node;
%type <sstr> op
+%type <data> data
+
%destructor { free($$); } <str>
%destructor { sdb_object_deref(SDB_OBJ($$)); } <node> <m>
* Parse matchers comparing object attributes with a value.
*/
compare_matcher:
- IDENTIFIER '.' IDENTIFIER op STRING
+ IDENTIFIER '.' IDENTIFIER op data
{
- sdb_data_t data = { SDB_TYPE_STRING, { .string = $5 } };
- $$ = sdb_store_matcher_parse_cmp($1, $3, $4, &data);
+ $$ = sdb_store_matcher_parse_cmp($1, $3, $4, &$5);
free($1); $1 = NULL;
free($3); $3 = NULL;
- free($5); $5 = NULL;
+ sdb_data_free_datum(&$5);
}
;
CMP_NREGEX { $$ = "!~"; }
;
+data:
+ STRING { $$.type = SDB_TYPE_STRING; $$.data.string = $1; }
+ ;
+
%%
void