Skip to content

Commit

Permalink
Addl changes to support pmatch operator
Browse files Browse the repository at this point in the history
The lua parser api hooks need to be aware of the operator as well.
  • Loading branch information
mstemm committed Sep 22, 2016
1 parent ae80918 commit f44c7e3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion userspace/libsinsp/lua_parser_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ cmpop string_to_cmpop(const char* str)
{
return CO_IN;
}
else if(strcmp(str, "pmatch") == 0)
{
return CO_PMATCH;
}
else if(strcmp(str, "exists") == 0)
{
return CO_EXISTS;
Expand Down Expand Up @@ -216,7 +220,7 @@ int lua_parser_cbacks::rel_expr(lua_State *ls)
// "exists" is the only unary comparison op
if(strcmp(cmpop, "exists"))
{
if (strcmp(cmpop, "in") == 0)
if (strcmp(cmpop, "in") == 0 || strcmp(cmpop, "pmatch") == 0)
{
if (!lua_istable(ls, 3))
{
Expand Down

0 comments on commit f44c7e3

Please sign in to comment.