Aller au contenu

« Module:Episode » : différence entre les versions

De Stargate Wiki Sémantique
Contenu supprimé Contenu ajouté
Aucun résumé des modifications
Balise : Révoqué
Aucun résumé des modifications
Balise : Révoqué
Ligne 1 : Ligne 1 :
------------------------------------------------------------
------------------------------------------------------------
-- DIAGNOSTIC : Version instrumentée de Module:Episode
-- DIAGNOSTIC ULTIME : ne peut pas planter
-- (TEMPORAIRE — à retirer après analyse)
------------------------------------------------------------
------------------------------------------------------------


local function dump(o)
local function dump_table(t)
if type(o) ~= "table" then
if type(t) ~= "table" then
return tostring(o)
return tostring(t)
end
end
local s = "{ "
local out = {}
for k,v in pairs(o) do
for k,v in pairs(t) do
s = s .. tostring(k) .. "=" .. tostring(v) .. ", "
table.insert(out, tostring(k) .. "=" .. tostring(v))
end
end
return s .. " }"
return "{ " .. table.concat(out, ", ") .. " }"
end
end


local Index = require("Module:Episode/MultiSeries")
local name = "Module:Episode/MultiSeries"

local before = package.loaded[name]

local ok, result = pcall(require, name)

local after = package.loaded[name]


-- Affichage du diagnostic
return table.concat({
return table.concat({
"=== DIAGNOSTIC MODULE:EPISODE ===",
"=== DIAGNOSTIC ULTIME ===",
"",
"Type(Index) = " .. type(Index),
"Index = " .. tostring(Index),
"Nom require() = >" .. name .. "<",
"",
"Index.normalize = " .. tostring(Index and Index.normalize),
"--- AVANT require() ---",
tostring(before),
"",
"--- RESULTAT require() ---",
"pcall ok = " .. tostring(ok),
"result = " .. tostring(result),
"type(result) = " .. type(result),
"",
"",
"--- package.loaded[\"Module:Episode/MultiSeries\"] ---",
"--- APRES require() ---",
tostring(package.loaded["Module:Episode/MultiSeries"]),
tostring(after),
"",
"",
"--- Liste des modules Episode dans package.loaded ---",
"--- package.loaded[name] ---",
dump(package.loaded),
tostring(package.loaded[name]),
"",
"",
"--- Vérification du nom exact chargé ---",
"--- package.loaded (extrait Episode/*) ---",
"Nom require() = >" .. "Module:Episode/MultiSeries" .. "<",
}, "\n")
}, "\n")

Version du 3 juin 2026 à 14:08

Documentation icon Documentation module[créer]
------------------------------------------------------------
-- DIAGNOSTIC ULTIME : ne peut pas planter
------------------------------------------------------------

local function dump_table(t)
    if type(t) ~= "table" then
        return tostring(t)
    end
    local out = {}
    for k,v in pairs(t) do
        table.insert(out, tostring(k) .. "=" .. tostring(v))
    end
    return "{ " .. table.concat(out, ", ") .. " }"
end

local name = "Module:Episode/MultiSeries"

local before = package.loaded[name]

local ok, result = pcall(require, name)

local after = package.loaded[name]

return table.concat({
    "=== DIAGNOSTIC ULTIME ===",
    "",
    "Nom require() = >" .. name .. "<",
    "",
    "--- AVANT require() ---",
    tostring(before),
    "",
    "--- RESULTAT require() ---",
    "pcall ok = " .. tostring(ok),
    "result = " .. tostring(result),
    "type(result) = " .. type(result),
    "",
    "--- APRES require() ---",
    tostring(after),
    "",
    "--- package.loaded[name] ---",
    tostring(package.loaded[name]),
    "",
    "--- package.loaded (extrait Episode/*) ---",
}, "\n")