Commit 415c6a27 authored by François Perrad's avatar François Perrad
Browse files

refactor with has_named_params

parent 8425d644
Pipeline #433757 passed with stages
in 25 seconds
......@@ -39,6 +39,12 @@ local legal_op = {
['&'] = true, -- form-style query continuation
}
local has_named_params = {
[';'] = true,
['?'] = true,
['&'] = true,
}
local future_op = {
['='] = true,
[','] = true,
......@@ -111,7 +117,7 @@ local function compile (patt)
if c == ',' then
op[#op+1] = uniq(sub(s, j, i - 1))
j = i + 1
elseif c == '*' and j == i and (op[1] == ';' or op[1] == '?' or op[1] == '&') then
elseif c == '*' and j == i and has_named_params[op[1]] then
-- extension
elseif c == '%' then
if not is_hexa[sub(s, i+1, i+1)] or not is_hexa[sub(s, i+2, i+2)] then
......@@ -198,7 +204,7 @@ local function match (s, ops)
return
end
end
elseif oper == ';' or oper == '?' or oper == '&' then
elseif has_named_params[oper] then
local c = sub(s, i, i)
if c == oper then
if c == '?' then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment