OP_INVALID = 0,
OP_PLUS, /* || or + */
OP_MULT, /* && or * */
+ OP_OR, /* || or | */
+ OP_AND, /* && or & */
OP_NOT, /* ! */
OP_LT, /* < */
OP_GT, /* > */
ret = 5;
break;
case OP_MULT:
+ case OP_AND:
ret = 4;
break;
case OP_PLUS:
+ case OP_OR:
ret = 3;
break;
case OP_GE:
op = OP_NOT;
break;
case '&':
+ op = OP_AND;
+ break;
case '*':
op = OP_MULT;
break;
case '|':
+ op = OP_OR;
+ break;
case '+':
op = OP_PLUS;
break;
if ((gulong)(end - a) >= sizeof ("or") &&
g_ascii_strncasecmp (a, "or", sizeof ("or") - 1) == 0) {
*next = a + sizeof ("or") - 1;
- op = OP_PLUS;
+ op = OP_OR;
}
break;
case 'A':
if ((gulong)(end - a) >= sizeof ("and") &&
g_ascii_strncasecmp (a, "and", sizeof ("and") - 1) == 0) {
*next = a + sizeof ("and") - 1;
- op = OP_MULT;
+ op = OP_AND;
}
break;
case 'N':
}
else {
switch (elt->p.op) {
+ case OP_AND:
+ op_str = "&";
+ break;
+ case OP_OR:
+ op_str = "|";
+ break;
case OP_MULT:
op_str = "*";
break;
local rspamd_expression = require "rspamd_expression"
local rspamd_mempool = require "rspamd_mempool"
-local parse_func(str)
+local function parse_func(str)
-- extract token till the first space character
- local token = table.join('', take_while(function(s) return s <> ' ' end, str)
+ local token = table.join('', take_while(function(s) return s ~= ' ' end, str))
-- Return token name
return token
end
-local process_func(token, task)
+local function process_func(token, task)
-- Do something using token and task
end