Modulo:New Grove/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica
Nessun oggetto della modifica
Riga 2:
 
-- shallow copy di un oggetto table
local function p.table_shallow_copy(obj)
local copy = {}
if type(obj) == 'table' then
copy = {}
for key, val in pairs(obj) do
copy[key] = val
end
else
copy = obj
end
return copy
Riga 20 ⟶ 17:
function p.citation(frame)
local wlpframe = frame.args[8] or frame.args['wl'] or Nil:getParent()
else
local wl = pframe.args[8] or pframe.args['wl'] or Nil
wl = wl and wl ~= ''
local edition = framepframe.args[1] or framepframe.args['edizione'] or Nil
-- shallow copy dei parametri
local inner_args = p.table_shallow_copy(framepframe.args)
-- controllo per parametri posizionali
inner_args['nome'] = framepframe.args[2] or framepframe.args['nome']
inner_args['cognome'] = framepframe.args[3] or framepframe.args['cognome']
inner_args['voce'] = framepframe.args[4] or framepframe.args['voce']
inner_args['volume'] = framepframe.args[5] or framepframe.args['volume']
inner_args['pagine'] = framepframe.args[6] or framepframe.args['pagine']
inner_args['cid'] = framepframe.args[7] or framepframe.args['cid']
-- New Grove ed. 1
Riga 137 ⟶ 136:
local cite_object = {
cite_module = require("Modulo:Citazione"),
args = inner_args,
frame = {
args = inner_args