Content deleted Content added
remove "x-" prefix from private-use subtag; use table if there's more than one such subtag |
early error if tag doesn't start with language or private-use subtag? |
||
Line 479:
end
if subtag_i == 1 and subtag_type ~= "language" then
break
elseif subtag_type then
if parsed_subtags[subtag_type] then -- Create an array.
if type(parsed_subtags[subtag_type]) == "string" then
Line 502 ⟶ 504:
if potential_subtags[last_matched_subtag_i + 1]
and potential_subtags[last_matched_subtag_i + 1]:lower() ~= "x" then
return parsed_subtags:throw("no language subtag", 1)▼
last_matched_subtag_i + 1)▼
else
return parsed_subtags:throw("invalid subtag",
▲ last_matched_subtag_i + 1)
end
Line 530 ⟶ 536:
end
end
▲ end
▲ return parsed_subtags:throw("no language subtag", 1)
end
|