aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_selectors.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-09-18 14:39:08 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-09-18 15:38:30 +0100
commit22b8f221c6a46e5e94ef6568066020c185ce1de1 (patch)
tree65b3428fe8a499988791b06a4230c0a21ab487a7 /lualib/lua_selectors.lua
parent413beccaaaa15e5e5f8f25f4fe6fccc0b2193622 (diff)
downloadrspamd-22b8f221c6a46e5e94ef6568066020c185ce1de1.tar.gz
rspamd-22b8f221c6a46e5e94ef6568066020c185ce1de1.zip
[Project] Add method concept
Diffstat (limited to 'lualib/lua_selectors.lua')
-rw-r--r--lualib/lua_selectors.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/lualib/lua_selectors.lua b/lualib/lua_selectors.lua
index 80126d43d..f57d069da 100644
--- a/lualib/lua_selectors.lua
+++ b/lualib/lua_selectors.lua
@@ -667,17 +667,19 @@ local function make_grammar()
local doublequoted_string = l.P '"' * l.C(((1 - l.S'"\r\n\f\\') + (l.P'\\' * 1))^0) * '"'
local argument = atom + singlequoted_string + doublequoted_string
local dot = l.P(".")
+ local semicolon = l.P(":")
local obrace = "(" * spc
local ebrace = spc * ")"
local comma = spc * "," * spc
- local sel_separator = spc * l.S":;*" * spc
+ local sel_separator = spc * l.S";*" * spc
return l.P{
"LIST";
LIST = l.Ct(l.V("EXPR")) * (sel_separator * l.Ct(l.V("EXPR")))^0,
- EXPR = l.V("FUNCTION") * (dot * l.V("PROCESSOR"))^0,
+ EXPR = l.V("FUNCTION") * (semicolon * l.V("METHOD"))^-1 * (dot * l.V("PROCESSOR"))^0,
PROCESSOR = l.Ct(atom * spc * (obrace * l.V("ARG_LIST") * ebrace)^0),
FUNCTION = l.Ct(atom * spc * (obrace * l.V("ARG_LIST") * ebrace)^0),
+ METHOD = l.Ct(atom / function(e) return '__' .. e end * spc * (obrace * l.V("ARG_LIST") * ebrace)^0),
ARG_LIST = l.Ct((argument * comma^0)^0)
}
end