凭什么是什么意思| 冬阴功汤是什么味道| 子宫增大是什么原因| 西瓜虫喜欢吃什么| 肥波是什么品种的猫| 牛百叶是什么| 补钙什么时间段最好| 白细胞偏低是什么病| hcd是什么意思| 女性外阴瘙痒用什么药| 子宫瘢痕憩室是什么病| 灰指甲长什么样子图片| 农历11月25日是什么星座| 睡醒手麻是什么原因引起的| 高铁特等座有什么待遇| 憋是什么意思| 铁蛋白高是什么原因| 糖类抗原50是什么指标| 芙蓉花是什么花| ab型血和b型血的孩子是什么血型| 外阴过敏用什么药| 月经血是黑色的是什么原因| 呼吸道感染挂什么科| 一只什么| 倒模是什么意思| 原发性肝ca什么意思| 罗汉果是什么| 嗓子疼吃什么消炎药| 泥丸宫在什么位置| 来大姨妈血块多是什么原因| 高诊是什么意思| 爆竹声中一岁除下一句是什么| 身心健康是什么意思| 浅表性胃炎伴糜烂吃什么药效果好| 大姨妈期间同房有什么影响| 边际贡献是什么意思| 摩卡棕是什么颜色| 治疗腱鞘炎用什么药效果好| 风声鹤唳的意思是什么| 红糖和黑糖有什么区别| 耳朵发痒是什么原因| 为什么会得静脉曲张| 甲亢吃什么药| 海马是什么类动物| 甲状腺肿物是什么意思| 做梦梦见兔子是什么意思| 消防队属于什么编制| 人体缺钠会出现什么症状| 什么叫桑黄| 煮花生放什么调料好吃| 安踏属于什么档次| 夏天适合穿什么衣服| 乳腺结节应该挂什么科| hsv是什么| 肺部肿瘤切除后吃什么| 十年粤语版叫什么名字| 天赋是什么| 胎停了有什么明显症状| 人体缺钾会有什么症状| 蛋糕粉是什么面粉| 为什么心率过快| 2012年是什么年| 双脚麻木是什么病的前兆| 4.29是什么星座| mcv是什么意思| 亚硝酸钠是什么| 六味地黄丸有什么副作用吗| 幻听一般会听到什么| 什么是动态口令| 女人喜欢什么样的男人| 安罗替尼适合什么肿瘤| 不期而遇什么意思| 洛五行属性是什么| 虎年是什么年| sandisk是什么牌子| 一什么沙发| 睡醒咳嗽是什么原因| 糖尿病吃什么主食最好| 借口是什么意思| 奕五行属性是什么| 人瘦了是什么原因| 大年初一是什么星座| 3680是什么罩杯| 什么属相不能住西户| 梦见情敌什么预兆| tt什么意思| 反讽是什么意思| 阴道真菌感染用什么药| 梳子什么材质的好| 牛欢喜是什么| 主动脉弓钙化什么意思| 检查肺结节挂什么科| 什么是切线| 院士是什么级别| 眩晕症是什么原因引起| 小米配什么熬粥最好| 什么病不能吃西兰花| 穿梭是什么意思| 五月什么星座| 胃烧灼感吃什么药| 芒果有什么好处和坏处| 梦见自己爷爷死了是什么预兆| 头麻是什么病的前兆| 小腿肌肉抽筋是什么原因引起的| 梦见生了个孩子是什么意思| 为什么手麻| 女性什么时候最容易怀孕| 楚门的世界是什么意思| 吃什么水果对肠胃好| 雪梨百合炖冰糖有什么功效| π是什么意思| 李自成为什么会失败| 什么是职务| 大象的鼻子为什么那么长| 司空见惯的惯是什么意思| 换手率什么意思| 尿酸升高是什么原因| 子宫肥大是什么原因| 秋葵有什么功效| 什么叫凤凰男| 吃榴莲有什么好处和坏处| 不一般是什么意思| 五险一金包括什么| x光是检查什么的| 什么叫tct检查| 子宫小结节是什么意思| 变态反应是什么意思| 两情相悦什么意思| 传奇是什么意思| 痕迹是什么意思| 痴男怨女是什么意思| 治疗灰指甲用什么药| covu是什么药| 北海有什么好玩的| 血沉高是什么意思| complex是什么意思| 姑息是什么意思| 红色血痣是什么原因| 凌寒独自开的凌是什么意思| 牙齿痛什么原因| 矢量图是什么格式| 肠息肉有什么症状| 躺平什么意思| 尿蛋白是什么原因造成的| 大腿外侧麻木是什么原因| 兵马俑在什么地方| 什么的跳舞| 颈椎痛看什么科| 平仓什么意思| 血栓吃什么药可以疏通血管| 心肌缺血是什么意思| 处暑吃什么传统食物| 带状疱疹后遗神经痛用什么药| 怕热易出汗是什么原因| 西宁有什么好玩的| 尿毒症的尿是什么颜色| 屈臣氏是卖什么的| 为什么水晶要消磁| 虎落平阳被犬欺是什么生肖| a4腰什么意思| 吃姜对身体有什么好处| 头大适合什么发型| 甘油三酯高什么原因| 为什么生理期过后最容易掉秤| 吃什么能补肾| 古代质子是什么意思| 鲶鱼效应是什么意思| 4月21日什么星座| 6.27什么星座| 大疱性皮肤病是什么病| 相逢是什么意思| 黄精有什么功效| 区委副书记是什么级别| 为什么三角形具有稳定性| 冠脉cta是什么检查| 喝什么茶减肥效果最好| 少阳病是什么意思| 童子是什么意思| 咬指甲是什么心理疾病| 什么蔬菜补铁效果最好| 梦见自己来月经了什么预兆| 连锁反应是什么意思| 素手是什么意思| 柠檬泡水有什么好处| 对乙酰氨基酚片是什么药| c肽是什么意思| 怀孕第一个月有什么反应| 肠梗阻是什么病| 成吉思汗属什么生肖| 叶酸什么牌子好| 鸡头米是什么东西| 印尼用什么货币| 清明为什么插柳枝| 舌头灼热感是什么原因| 缜密是什么意思| 摘环后需要注意什么| 直肠炎有什么症状| 8月11是什么星座| 处暑是什么意思| 战国时期是什么时候| 脚发热是什么病| 橘络的功效与作用是什么| catl是什么意思| 砒霜是什么| 什么是阴阳水| hp代表什么意思| 备孕需要做什么| 宝宝满周岁送什么礼物| 集体户口是什么意思| 标本是什么意思| 朱砂有什么作用与功效| 格格不入是什么意思| 阴茎进入阴道什么感觉| 什么是潜规则| p53阳性是什么意思| 海星吃什么食物| 圆形脸适合什么样的发型| 脸颊两侧长斑是什么原因怎么调理| 夏天什么时候最热| 尿里红细胞高什么原因| 鱼油对身体有什么好处| 孕妇可以喝什么汤| 过敏打什么针| 阴道清洁度三度什么意思| 南通在江苏什么位置| 笑靥什么意思| rh血型阳性是什么血型| 为什么会早产| 鹏字五行属什么| 骨质增生挂什么科| 铭是什么意思| 胸闷气短什么原因| 叠是什么意思| 公务员是做什么工作的| 月经前有褐色分泌物是什么原因| 忘川是什么意思| 丧偶什么意思| 按摩是什么意思| dbm是什么意思| 布灵布灵是什么意思| 经期喝酒会有什么危害| 精神什么意思| 看血脂高挂什么科| 止血敏又叫什么名| 味淋可以用什么代替| 迂回战术什么意思| 七七事变是什么生肖| 听吧新征程号角吹响是什么歌| 化妆水是什么| 梦见自己洗衣服是什么意思| gbm是什么意思| 左心增大是什么意思| 心室早复极是什么意思| 痔疮吃什么好| 晕车的人是什么体质| 金鸡报晓是什么意思| 苍鹰是什么意思| 撒丫子是什么意思| 更年期什么症状| erdos是什么牌子| 芒果什么品种最好吃| 400年前是什么朝代| 血氧低有什么症状| 办健康证需要带什么证件| 百度
百度 其实从1988年奥迪A8的鼻祖奥迪V8开始,奥迪就从没说过A8是一台只针对舒适不针对驾驶的车,不信你去看看玩命快递。



-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.

local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType

local arguments = {}

-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.

local function tidyValDefault(key, val)
	if type(val) == 'string' then
		val = val:match('^%s*(.-)%s*$')
		if val == '' then
			return nil
		else
			return val
		end
	else
		return val
	end
end

local function tidyValTrimOnly(key, val)
	if type(val) == 'string' then
		return val:match('^%s*(.-)%s*$')
	else
		return val
	end
end

local function tidyValRemoveBlanksOnly(key, val)
	if type(val) == 'string' then
		if val:find('%S') then
			return val
		else
			return nil
		end
	else
		return val
	end
end

local function tidyValNoChange(key, val)
	return val
end

local function matchesTitle(given, title)
	local tp = type( given )
	return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end

local translate_mt = { __index = function(t, k) return k end }

function arguments.getArgs(frame, options)
	checkType('getArgs', 1, frame, 'table', true)
	checkType('getArgs', 2, options, 'table', true)
	frame = frame or {}
	options = options or {}

	--[[
	-- Set up argument translation.
	--]]
	options.translate = options.translate or {}
	if getmetatable(options.translate) == nil then
		setmetatable(options.translate, translate_mt)
	end
	if options.backtranslate == nil then
		options.backtranslate = {}
		for k,v in pairs(options.translate) do
			options.backtranslate[v] = k
		end
	end
	if options.backtranslate and getmetatable(options.backtranslate) == nil then
		setmetatable(options.backtranslate, {
			__index = function(t, k)
				if options.translate[k] ~= k then
					return nil
				else
					return k
				end
			end
		})
	end

	--[[
	-- Get the argument tables. If we were passed a valid frame object, get the
	-- frame arguments (fargs) and the parent frame arguments (pargs), depending
	-- on the options set and on the parent frame's availability. If we weren't
	-- passed a valid frame object, we are being called from another Lua module
	-- or from the debug console, so assume that we were passed a table of args
	-- directly, and assign it to a new variable (luaArgs).
	--]]
	local fargs, pargs, luaArgs
	if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
		if options.wrappers then
			--[[
			-- The wrappers option makes Module:Arguments look up arguments in
			-- either the frame argument table or the parent argument table, but
			-- not both. This means that users can use either the #invoke syntax
			-- or a wrapper template without the loss of performance associated
			-- with looking arguments up in both the frame and the parent frame.
			-- Module:Arguments will look up arguments in the parent frame
			-- if it finds the parent frame's title in options.wrapper;
			-- otherwise it will look up arguments in the frame object passed
			-- to getArgs.
			--]]
			local parent = frame:getParent()
			if not parent then
				fargs = frame.args
			else
				local title = parent:getTitle():gsub('/sandbox$', '')
				local found = false
				if matchesTitle(options.wrappers, title) then
					found = true
				elseif type(options.wrappers) == 'table' then
					for _,v in pairs(options.wrappers) do
						if matchesTitle(v, title) then
							found = true
							break
						end
					end
				end

				-- We test for false specifically here so that nil (the default) acts like true.
				if found or options.frameOnly == false then
					pargs = parent.args
				end
				if not found or options.parentOnly == false then
					fargs = frame.args
				end
			end
		else
			-- options.wrapper isn't set, so check the other options.
			if not options.parentOnly then
				fargs = frame.args
			end
			if not options.frameOnly then
				local parent = frame:getParent()
				pargs = parent and parent.args or nil
			end
		end
		if options.parentFirst then
			fargs, pargs = pargs, fargs
		end
	else
		luaArgs = frame
	end

	-- Set the order of precedence of the argument tables. If the variables are
	-- nil, nothing will be added to the table, which is how we avoid clashes
	-- between the frame/parent args and the Lua args.
	local argTables = {fargs}
	argTables[#argTables + 1] = pargs
	argTables[#argTables + 1] = luaArgs

	--[[
	-- Generate the tidyVal function. If it has been specified by the user, we
	-- use that; if not, we choose one of four functions depending on the
	-- options chosen. This is so that we don't have to call the options table
	-- every time the function is called.
	--]]
	local tidyVal = options.valueFunc
	if tidyVal then
		if type(tidyVal) ~= 'function' then
			error(
				"bad value assigned to option 'valueFunc'"
					.. '(function expected, got '
					.. type(tidyVal)
					.. ')',
				2
			)
		end
	elseif options.trim ~= false then
		if options.removeBlanks ~= false then
			tidyVal = tidyValDefault
		else
			tidyVal = tidyValTrimOnly
		end
	else
		if options.removeBlanks ~= false then
			tidyVal = tidyValRemoveBlanksOnly
		else
			tidyVal = tidyValNoChange
		end
	end

	--[[
	-- Set up the args, metaArgs and nilArgs tables. args will be the one
	-- accessed from functions, and metaArgs will hold the actual arguments. Nil
	-- arguments are memoized in nilArgs, and the metatable connects all of them
	-- together.
	--]]
	local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
	setmetatable(args, metatable)

	local function mergeArgs(tables)
		--[[
		-- Accepts multiple tables as input and merges their keys and values
		-- into one table. If a value is already present it is not overwritten;
		-- tables listed earlier have precedence. We are also memoizing nil
		-- values, which can be overwritten if they are 's' (soft).
		--]]
		for _, t in ipairs(tables) do
			for key, val in pairs(t) do
				if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
					local tidiedVal = tidyVal(key, val)
					if tidiedVal == nil then
						nilArgs[key] = 's'
					else
						metaArgs[key] = tidiedVal
					end
				end
			end
		end
	end

	--[[
	-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
	-- and are only fetched from the argument tables once. Fetching arguments
	-- from the argument tables is the most resource-intensive step in this
	-- module, so we try and avoid it where possible. For this reason, nil
	-- arguments are also memoized, in the nilArgs table. Also, we keep a record
	-- in the metatable of when pairs and ipairs have been called, so we do not
	-- run pairs and ipairs on the argument tables more than once. We also do
	-- not run ipairs on fargs and pargs if pairs has already been run, as all
	-- the arguments will already have been copied over.
	--]]

	metatable.__index = function (t, key)
		--[[
		-- Fetches an argument when the args table is indexed. First we check
		-- to see if the value is memoized, and if not we try and fetch it from
		-- the argument tables. When we check memoization, we need to check
		-- metaArgs before nilArgs, as both can be non-nil at the same time.
		-- If the argument is not present in metaArgs, we also check whether
		-- pairs has been run yet. If pairs has already been run, we return nil.
		-- This is because all the arguments will have already been copied into
		-- metaArgs by the mergeArgs function, meaning that any other arguments
		-- must be nil.
		--]]
		if type(key) == 'string' then
			key = options.translate[key]
		end
		local val = metaArgs[key]
		if val ~= nil then
			return val
		elseif metatable.donePairs or nilArgs[key] then
			return nil
		end
		for _, argTable in ipairs(argTables) do
			local argTableVal = tidyVal(key, argTable[key])
			if argTableVal ~= nil then
				metaArgs[key] = argTableVal
				return argTableVal
			end
		end
		nilArgs[key] = 'h'
		return nil
	end

	metatable.__newindex = function (t, key, val)
		-- This function is called when a module tries to add a new value to the
		-- args table, or tries to change an existing value.
		if type(key) == 'string' then
			key = options.translate[key]
		end
		if options.readOnly then
			error(
				'could not write to argument table key "'
					.. tostring(key)
					.. '"; the table is read-only',
				2
			)
		elseif options.noOverwrite and args[key] ~= nil then
			error(
				'could not write to argument table key "'
					.. tostring(key)
					.. '"; overwriting existing arguments is not permitted',
				2
			)
		elseif val == nil then
			--[[
			-- If the argument is to be overwritten with nil, we need to erase
			-- the value in metaArgs, so that __index, __pairs and __ipairs do
			-- not use a previous existing value, if present; and we also need
			-- to memoize the nil in nilArgs, so that the value isn't looked
			-- up in the argument tables if it is accessed again.
			--]]
			metaArgs[key] = nil
			nilArgs[key] = 'h'
		else
			metaArgs[key] = val
		end
	end

	local function translatenext(invariant)
		local k, v = next(invariant.t, invariant.k)
		invariant.k = k
		if k == nil then
			return nil
		elseif type(k) ~= 'string' or not options.backtranslate then
			return k, v
		else
			local backtranslate = options.backtranslate[k]
			if backtranslate == nil then
				-- Skip this one. This is a tail call, so this won't cause stack overflow
				return translatenext(invariant)
			else
				return backtranslate, v
			end
		end
	end

	metatable.__pairs = function ()
		-- Called when pairs is run on the args table.
		if not metatable.donePairs then
			mergeArgs(argTables)
			metatable.donePairs = true
		end
		return translatenext, { t = metaArgs }
	end

	local function inext(t, i)
		-- This uses our __index metamethod
		local v = t[i + 1]
		if v ~= nil then
			return i + 1, v
		end
	end

	metatable.__ipairs = function (t)
		-- Called when ipairs is run on the args table.
		return inext, t, 0
	end

	return args
end

return arguments
说话鼻音重是什么原因 婴儿第一次发烧叫什么 忠实的什么 什么叫末法时代 流清口水是什么原因
纹身纹什么招财好运 roi是什么 白羊座跟什么星座最配 女人下身干燥无水是什么原因 牙垢是什么
一带一路是指什么 奇异果是什么水果 心悸吃什么中成药 大修基金什么时候缴纳 木隶念什么
公鸡的尾巴有什么作用 屋里有蝙蝠有什么预兆 66年属马的是什么命 太子是什么生肖 品牌背书是什么意思
今年42岁属什么生肖hcv9jop8ns2r.cn 猫的胡须有什么用处hcv7jop6ns6r.cn 6.17什么星座hlguo.com 静脉曲张是什么原因adwl56.com 为什么头出汗特别多cj623037.com
热淋是什么意思hcv9jop2ns9r.cn 五指姑娘是什么意思hkuteam.com 歆是什么意思0735v.com 牙龈肿痛什么原因youbangsi.com 年轻人白头发是什么原因引起的hcv8jop6ns5r.cn
上火咳嗽吃什么药zhiyanzhang.com 有什么放不下hcv7jop7ns4r.cn 番茄和西红柿有什么区别hcv8jop4ns8r.cn 蒙古族的那达慕大会是在什么时候hcv9jop2ns4r.cn 薄荷不能和什么一起吃hcv8jop4ns0r.cn
梦见生孩子是什么征兆wuhaiwuya.com 每天吃洋葱有什么好处jingluanji.com 4月6号是什么星座wmyky.com 月经几个月不来是什么原因hcv9jop1ns9r.cn 经常做噩梦是什么原因hcv7jop5ns3r.cn
百度