summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 495dfe8)
raw | patch | inline | side by side (parent: 495dfe8)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 6 Apr 2014 12:17:55 +0000 (14:17 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 6 Apr 2014 12:17:55 +0000 (14:17 +0200) |
src/frontend/grammar.y | patch | blob | history | |
t/frontend/parser_test.c | patch | blob | history |
diff --git a/src/frontend/grammar.y b/src/frontend/grammar.y
index abc51656934edcffc8c6f32ddf7320f985541d77..4bade3b47af690eae54b703eb12d8b1fd477464c 100644 (file)
--- a/src/frontend/grammar.y
+++ b/src/frontend/grammar.y
%left AND
%left CMP_EQUAL
%left CMP_REGEX
+%left '(' ')'
+%left '.'
%type <list> statements
%type <node> statement
;
matcher:
+ '(' matcher ')'
+ {
+ $$ = $2;
+ }
+ |
matcher AND matcher
{
$$ = sdb_store_con_matcher($1, $3);
index 705e7322370ee370fb0d3c2434f85a5668d44cb4..ffeca8f68b091d50e5c90c5d165edf2867986b1f 100644 (file)
--- a/t/frontend/parser_test.c
+++ b/t/frontend/parser_test.c
"service.name = 'name' OR "
"attribute.name = 'name' AND "
"attribute.foo = 'bar'", -1, MATCHER_OR },
+ { "(host.name = 'name' OR "
+ "service.name = 'name') AND "
+ "(attribute.name = 'name' OR "
+ "attribute.foo = 'bar')", -1, MATCHER_AND },
/* syntax errors */
{ "LIST", -1, -1 },