--local function strcmp (str_a, str_b)local function strcmp (frame) local str_a = frame.args[1]; local str_b = frame.args[2];
str_a = str_a:gsub ('(%-%-templatestyles%-)%x+(%-)', '%100000000%2') str_b = str_b:gsub ('(%-%-templatestyles%-)%x+(%-)', '%100000000%2')
local result = ; local len_a = str_a:len; local len_b = str_b:len; local t_str_a = local t_str_b = local limit = len_a; -- assume that both strings are same length
if len_a
str_b then return 'equal'; end else table.insert (result, 'length mismatch: a: ' .. len_a .. '; b: ' .. len_b); if len_a < len_b then limit = len_a; else limit = len_b; end end
for c in string.gmatch (str_a, '.') do table.insert (t_str_a, c); end for c in str_b:gmatch ('.') do table.insert (t_str_b, c); end local i = 1; while i < limit do if t_str_a[i]
if len_a ~= len_b then -- if length mismatch if not t_str_a[i] and t_str_b[i] or -- if one but not both are nil t_str_a[i] and not t_str_b[i] then i = i + 1; -- point to last matching character end end
if limit
return