From: Vsevolod Stakhov Date: Tue, 18 Sep 2018 13:39:08 +0000 (+0100) Subject: [Project] Add method concept X-Git-Tag: 1.8.0~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22b8f221c6a46e5e94ef6568066020c185ce1de1;p=thirdparty%2Frspamd.git [Project] Add method concept --- diff --git a/lualib/lua_selectors.lua b/lualib/lua_selectors.lua index 80126d43db..f57d069dae 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