Module:ScriptItem2: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 409: Line 409:
end
end


return returnType
return p.loadTemplate(
..' '..p.getDisplayedName(frame)
frame,
..'('..(#argsText == 0 and 'void' or table.concat(argsText, ', ')..')')
'code',
returnType
..' '..p.getDisplayedName(frame)
..'('..(#argsText == 0 and 'void' or table.concat(argsText, ', ')..')')
)
end
end


Line 449: Line 453:
local isOptional = tokens[1]:sub(1, 1) == '['
local isOptional = tokens[1]:sub(1, 1) == '['
if isOptional then
if isOptional then
tokens[1] = tokens[1]:sub(2, tokens[1]:len())
tokens[1] = tokens[1]:sub(2, tokens[1]:len())
tokens[4] = tokens[4]:sub(1, tokens[4]:len() - 1)
tokens[4] = tokens[4]:sub(1, tokens[4]:len() - 1)
end
end
local defaultValue = isOptional and "<span style='font-family: \"Source Code Pro\", monospace;'>"..tokens[4].."</span>" or "n/a"
local defaultValue = isOptional and "<span style='font-family: \"Source Code Pro\", monospace;'>"..tokens[4].."</span>" or "n/a"
local description = p.formatDescription(table.concat(tokens, ' ', isOptional and 5 or 3))
local description = p.formatDescription(table.concat(tokens, ' ', isOptional and 5 or 3))
6,834

edits