['args_schema'] = {ts.shape{
limit = ts.number + ts.string / tonumber,
esld_limit = (ts.number + ts.string / tonumber):is_optional(),
+ flags = ts.array_of(ts.one_of{
+ 'content',
+ 'has_port',
+ 'has_user',
+ 'host_encoded',
+ 'html_displayed',
+ 'idn',
+ 'image',
+ 'missing_slahes', -- sic
+ 'no_tld',
+ 'numeric',
+ 'obscured',
+ 'path_encoded',
+ 'query',
+ 'query_encoded',
+ 'redirected',
+ 'schema_encoded',
+ 'schemaless',
+ 'subject',
+ 'text',
+ 'unnormalised',
+ 'url_displayed',
+ 'zw_spaces',
+ 'phished',
+ }):is_optional(),
+ flags_mode = ts.one_of{'explicit'}:is_optional(),
prefix = ts.string:is_optional(),
+ need_content = (ts.boolean + ts.string / lua_util.toboolean):is_optional(),
need_emails = (ts.boolean + ts.string / lua_util.toboolean):is_optional(),
need_images = (ts.boolean + ts.string / lua_util.toboolean):is_optional(),
ignore_redirected = (ts.boolean + ts.string / lua_util.toboolean):is_optional(),
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((l.V("ARG") * comma^0)^0),
- ARG = l.Cf(tbl_obrace * l.V("NAMED_ARG") * tbl_ebrace, rawset) + argument,
- NAMED_ARG = (l.Ct("") * l.Cg(argument * eqsign * argument * comma^0)^0),
+ ARG = l.Cf(tbl_obrace * l.V("NAMED_ARG") * tbl_ebrace, rawset) + argument + l.V("LIST_ARGS"),
+ NAMED_ARG = (l.Ct("") * l.Cg(argument * eqsign * (argument + l.V("LIST_ARGS")) * comma^0)^0),
+ LIST_ARGS = l.Ct(tbl_obrace * l.V("LIST_ARG") * tbl_ebrace),
+ LIST_ARG = l.Cg(argument * comma^0)^0,
}
end