模块:沙盒/CS1-output/debug

local p = {}
 
function p.testidiots() 
    dumb=require( "Module:Citation/CS1/Configuration")
    stupid="<source lang=\"C\">\nstatic void ini_marks_test()\n{\n\tvoid *pt=NULL;\n\tCS1_args=hashini();\n"
    table.sort(dumb.aliases)
    for idiot, jackass in pairs(dumb.aliases) do
        if(string.find(tostring(idiot),"#")==nil) then
            if(type(jackass)=="table") then
                for fool, retarded in ipairs(jackass) do
                    if(string.find(tostring(retarded),"#")==nil) then 
                        stupid=stupid.."\tif(!str_hashquery(CS1_args, \""..string.gsub(tostring(retarded),"_"," ").."\", &pt))\n\t{\n"
                        stupid=stupid.."\t\tstr_hashadd(CS1_args, \""..string.gsub(tostring(retarded),"_"," ").."\", offset_table+O_"..tostring(idiot)..");\n"
                        stupid=stupid.."\t}\n\telse printf(\"aliases <%s> duplicated.\\n\", \""..string.gsub(tostring(retarded),"_"," ").."\");\n"
                    end
                end
            else 
                if(type(jackass)=="string") then
                        stupid=stupid.."\tif(!str_hashquery(CS1_args, \""..string.gsub(jackass,"_"," ").."\", &pt))\n\t{\n"
                        stupid=stupid.."\t\tstr_hashadd(CS1_args, \""..string.gsub(jackass,"_"," ").."\", offset_table+O_"..tostring(idiot)..");\n"
                        stupid=stupid.."\t}\n\telse printf(\"aliases <%s> duplicated.\\n\", \""..string.gsub(jackass,"_"," ").."\");\n"
                end
            end
        end
    end
    table.sort(dumb.id_handlers)
    for idiot, jackass in pairs(dumb.id_handlers) do
    	for fool, retarded in ipairs(jackass.parameters) do
    		stupid=stupid.."\tif(!str_hashquery(CS1_args, \""..string.gsub(tostring(retarded),"_"," ").."\", &pt))\n\t{\n"
    		stupid=stupid.."\t\tstr_hashadd(CS1_args, \""..string.gsub(tostring(retarded),"_"," ").."\", offset_table+O_"..tostring(idiot)..");\n"
    		stupid=stupid.."\t}\n\telse printf(\"aliases <%s> duplicated.\\n\", \""..string.gsub(tostring(retarded),"_"," ").."\");\n"
    	end
    end
    stupid=stupid.."\treturn;\n}\n</source>"
    return stupid
end

return p