Module:Correction syntaxique

De Lagny-sur-Marne Wiki
Version datée du 18 octobre 2016 à 11:39 par 0x010D (discussion | contributions) (proprage indentation)
Aller à la navigation Aller à la recherche

local p = {}

function p.verifierLesArguments(frame)

   local passed_args = frame:getParent().args
   local modele_args = frame.args
   local rv = ""
   local nombre = 0
   for a,b in pairs(passed_args) do
       if (modele_args[a] == nil and b ~= "") then
           nombre = nombre + 1

rv = rv .. '

' .. "L'argument " .. a .. "(valeur " .. b .. ") n'existe pas dans le modèle appelé

"

       end
   end
   if (nombre > 10) then
       rv = rv .. ""
   elseif (nombre > 0) then
       rv = rv .. ""
   end
   return rv

end

return p