texmod.read: Make transforms case-insensitive

This commit is contained in:
Lars Mueller 2023-05-26 19:27:47 +02:00
parent 741746613b
commit e07d646203

@ -90,15 +90,16 @@ do
{flip_axis = "y", rotation_deg = 90}, {flip_axis = "y", rotation_deg = 90},
} }
function pr.transform(r) function pr.transform(r)
if r:match"I" then -- Note: While it isn't documented, `[transform` is indeed case-insensitive.
if r:match_charset"[iI]" then
return return
end end
local flip_axis local flip_axis
if r:match"F" then if r:match_charset"[fF]" then
flip_axis = assert(r:match_charset"[XY]", "axis expected"):lower() flip_axis = assert(r:match_charset"[xXyY]", "axis expected"):lower()
end end
local rot_deg local rot_deg
if r:match"R" then if r:match_charset"[rR]" then
rot_deg = r:int() rot_deg = r:int()
end end
if flip_axis or rot_deg then if flip_axis or rot_deg then