6,834
edits
No edit summary  | 
				No edit summary  | 
				||
| Line 404: | Line 404: | ||
	local headers  | 	local headers  | ||
	local widths  | 	local widths  | ||
	local isVoidReturn = false  | |||
	rows = {}  | 	rows = {}  | ||
| Line 419: | Line 420: | ||
			local description  | 			local description  | ||
			if type:lower() == "void" then  | 			if type:lower() == "void" then  | ||
				isVoidReturn = true  | |||
				description = "This "..args.type.." doesn't return any values on success."  | 				description = "This "..args.type.." doesn't return any values on success."  | ||
			elseif tokens[2] then  | 			elseif tokens[2] then  | ||
| Line 426: | Line 428: | ||
			end  | 			end  | ||
			rows[i] = { p.formatType(tokens[1], frame), description }  | 			rows[i] = { '', p.formatType(tokens[1], frame), description }  | ||
		end  | 		end  | ||
		headers = nil-- { "Type", "Description" }  | 		headers = nil-- { "Type", "Description" }  | ||
		widths = {   | 		widths = { 30, 80, 400 }  | ||
		text = text..p.table(headers, rows, widths, 'wikitable-returns wikitable')  | 		text = text..p.table(headers, rows, widths, 'wikitable-returns wikitable')  | ||
	end  | 	end  | ||
	rows = {}  | 	if not isVoidReturn then  | ||
		rows = {}  | |||
		entries = p.getIndexedArgs(frame, 'returnFail')  | |||
		text = text.."'''Failure Returns'''\n\n"  | |||
		if #entries == 0 then  | |||
			text = text..p.documentationMissing(frame, "Failure returns")  | |||
		else  | |||
			for i,arg in ipairs(entries) do  | |||
				local tokens = p.split(arg, ' ')  | |||
				local type = tokens[1]  | |||
				type = p.standardizeNullType(type)  | |||
				local value  | |||
				if type:lower() == 'void' then  | |||
					value = "n/a"  | |||
				elseif tokens[2] then  | |||
					value = p.formatSource(table.concat(tokens, ' ', 2), frame)  | |||
				else  | |||
					value = p.formatSource(p.documentationMissing(frame, "Description for failure return value"), frame)  | |||
				end  | |||
				rows[i] = { '', p.formatType(tokens[1], frame), value }  | |||
			end  | 			end  | ||
			headers = nil--{ "Type", "Value" }  | |||
			widths = { 30, 100, 400 }  | |||
			text = text..p.table(headers, rows, widths, 'wikitable-returns wikitable')  | |||
		end  | 		end  | ||
	end  | 	end  | ||
edits