commit ab21a6f: [Minor] Allow argument atoms to start from `-`

Vsevolod Stakhov vsevolod at rspamd.com
Thu Nov 16 15:49:03 UTC 2023


Author: Vsevolod Stakhov
Date: 2023-11-16 15:47:23 +0000
URL: https://github.com/rspamd/rspamd/commit/ab21a6f65f545534d85268292bc3186e4eedb07e (HEAD -> master)

[Minor] Allow argument atoms to start from `-`

---
 lualib/lua_selectors/init.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lualib/lua_selectors/init.lua b/lualib/lua_selectors/init.lua
index 22877f513..5fcdb3833 100644
--- a/lualib/lua_selectors/init.lua
+++ b/lualib/lua_selectors/init.lua
@@ -243,7 +243,7 @@ local function make_grammar()
   local utf8_high = l.R("\194\223") * cont
       + l.R("\224\239") * cont * cont
       + l.R("\240\244") * cont * cont * cont
-  local atom_start = (l.R("az") + l.R("AZ") + l.R("09") + utf8_high) ^ 1
+  local atom_start = (l.R("az") + l.R("AZ") + l.R("09") + utf8_high + l.S "-") ^ 1
   local atom_end = (l.R("az") + l.R("AZ") + l.R("09") + l.S "-_" + utf8_high) ^ 1
   local atom_mid = (1 - l.S("'\r\n\f\\,)(}{= " .. '"')) ^ 1
   local atom_argument = l.C(atom_start * atom_mid ^ 0 * atom_end ^ 0) -- We allow more characters for the arguments


More information about the Commits mailing list