summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e4925ba)
raw | patch | inline | side by side (parent: e4925ba)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 21 Oct 2014 05:45:31 +0000 (07:45 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Tue, 21 Oct 2014 05:49:59 +0000 (07:49 +0200) |
This is a matcher checking if a value is included in an array. It's mostly
meant to be used to match backends at the moment.
meant to be used to match backends at the moment.
src/frontend/grammar.y | patch | blob | history | |
src/frontend/scanner.l | patch | blob | history |
diff --git a/src/frontend/grammar.y b/src/frontend/grammar.y
index 78b45d295a1585fe93dfa9e1bb0e9b3bdd504879..23ba07ffaed4a72425173ab890d9eb3d4e690d28 100644 (file)
--- a/src/frontend/grammar.y
+++ b/src/frontend/grammar.y
%token AND OR IS NOT MATCHING FILTER
%token CMP_EQUAL CMP_NEQUAL CMP_REGEX CMP_NREGEX
-%token CMP_LT CMP_LE CMP_GE CMP_GT
+%token CMP_LT CMP_LE CMP_GE CMP_GT IN
%token CONCAT
%token START END
%left CMP_EQUAL CMP_NEQUAL
%left CMP_LT CMP_LE CMP_GE CMP_GT
%nonassoc CMP_REGEX CMP_NREGEX
+%nonassoc IN
%left CONCAT
%nonassoc IS
%left '+' '-'
$$ = sdb_store_isnnull_matcher($1);
sdb_object_deref(SDB_OBJ($1));
}
+ |
+ expression IN expression
+ {
+ $$ = sdb_store_in_matcher($1, $3);
+ sdb_object_deref(SDB_OBJ($1));
+ sdb_object_deref(SDB_OBJ($3));
+ }
;
expression:
diff --git a/src/frontend/scanner.l b/src/frontend/scanner.l
index 9d8e73d7d73cf01e8e80f552e8e90742cd345991..33b762cce6dfa416a6b5e9869b40013a74df2b34 100644 (file)
--- a/src/frontend/scanner.l
+++ b/src/frontend/scanner.l
{ "END", END },
{ "FETCH", FETCH },
{ "FILTER", FILTER },
+ { "IN", IN },
{ "IS", IS },
{ "LIST", LIST },
{ "LOOKUP", LOOKUP },