Module:ScriptItem2: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 377: Line 377:
returnType = tokens[1]
returnType = tokens[1]
returnType = p.standardizeNullType(returnType)
returnType = p.standardizeNullType(returnType)
end
end
end
end
Line 393: Line 393:
local tokens = p.split(arg, ' ')
local tokens = p.split(arg, ' ')
local isOptional = tokens[3] == 'optional'
local isOptional = tokens[1]:sub(1, 1) == '['
if isOptional then
tokens[1] = tokens[1]:sub(2, tokens[1]:len())
tokens[4] = tokens[4]:sub(1, tokens[4]:len() - 1)
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"
Line 444: Line 448:
local tokens = p.split(arg, ' ')
local tokens = p.split(arg, ' ')
local isOptional = tokens[3] == 'optional'
local isOptional = tokens[1]:sub(1, 1) == '['
if isOptional then
tokens[1] = tokens[1]:sub(2, tokens[1]:len())
tokens[4] = tokens[4]:sub(1, tokens[4]:len() - 1)
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))