diff --git a/lib/filterx/expr-isset.c b/lib/filterx/expr-isset.c index 69c18d589c..0186c382ab 100644 --- a/lib/filterx/expr-isset.c +++ b/lib/filterx/expr-isset.c @@ -24,7 +24,7 @@ #include "filterx/expr-isset.h" #include "filterx/object-primitive.h" -FilterXObject * +static FilterXObject * _eval(FilterXExpr *s) { FilterXUnaryOp *self = (FilterXUnaryOp *) s; diff --git a/lib/filterx/expr-unset.c b/lib/filterx/expr-unset.c index 1ccee1b3f2..669656147e 100644 --- a/lib/filterx/expr-unset.c +++ b/lib/filterx/expr-unset.c @@ -24,7 +24,7 @@ #include "filterx/expr-unset.h" #include "filterx/object-primitive.h" -FilterXObject * +static FilterXObject * _eval(FilterXExpr *s) { FilterXUnaryOp *self = (FilterXUnaryOp *) s; diff --git a/lib/filterx/filterx-grammar.ym b/lib/filterx/filterx-grammar.ym index 56c67ba5fe..c9eeab4497 100644 --- a/lib/filterx/filterx-grammar.ym +++ b/lib/filterx/filterx-grammar.ym @@ -49,6 +49,8 @@ #include "filterx/filterx-config.h" #include "filterx/expr-function.h" #include "filterx/expr-condition.h" +#include "filterx/expr-isset.h" +#include "filterx/expr-unset.h" #include "template/templates.h" @@ -84,6 +86,8 @@ construct_template_expr(LogTemplate *template) %token KW_TRUE, KW_FALSE %token KW_NULL %token KW_ENUM +%token KW_ISSET +%token KW_UNSET %type stmts %type stmt @@ -156,6 +160,8 @@ expr | expr KW_TAV_NE expr { $$ = filterx_comparison_new($1, $3, FCMPX_TYPE_AND_VALUE_BASED | FCMPX_NE ); } | '(' expr ')' { $$ = $2; } | tenary { $$ = $1; } + | KW_ISSET '(' expr ')' { $$ = filterx_isset_new($3); } + | KW_UNSET '(' expr ')' { $$ = filterx_unset_new($3); } ; expr_value diff --git a/lib/filterx/filterx-parser.c b/lib/filterx/filterx-parser.c index 1baa95a7b7..242978ae95 100644 --- a/lib/filterx/filterx-parser.c +++ b/lib/filterx/filterx-parser.c @@ -48,6 +48,9 @@ static CfgLexerKeyword filterx_keywords[] = { "else", KW_ELSE }, { "elif", KW_ELIF }, + { "isset", KW_ISSET }, + { "unset", KW_UNSET }, + { CFG_KEYWORD_STOP }, };