精油有什么功效| 微信什么时候有的| 浙江有什么旅游景点| 中央候补委员什么级别| 筋是什么组织| 晒伤擦什么药| 吃什么壮阳| 体检前一天要注意什么| 大惊小怪是什么生肖| 头发白缺什么| 牙龈疼是什么问题| 咕噜是什么意思| 癞皮狗是什么意思| 尿蛋白1十是什么意思| 梦见一个人代表什么| 什么颜色加什么颜色等于灰色| 网名取什么好听| 为什么会得手足口病| 绊倒是什么意思| 心肌是什么意思| 哺乳期感冒吃什么药不影响哺乳| 人大副主任是什么级别| 养囊是什么意思| 光绪帝叫什么名字| 趴着睡觉有什么坏处| 保质期是什么意思| 熬夜伤什么| 头很容易出汗什么原因| 每个月月经都提前是什么原因| 啐了一口是什么意思| 什么降肌酐| 尿频是什么原因| 7月8日什么星座| 大便隐血弱阳性是什么意思| 一岁宝宝发烧吃什么药| 跑龙套是什么意思| 后背疼挂什么科| 降压药什么时候吃比较好| 农历八月初五是什么星座| 武则天是什么朝代的| 皮肤炎症用什么药| 婴儿老打嗝是什么原因| dm代表什么| 钥匙像什么| 马代表什么数字| 什么的色彩| ol是什么意思| 什么颜色的衣服显白| 捋一捋是什么意思| 白带多是为什么| 吃什么降血糖| 做梦吃饺子是什么意思| 人体有365个什么| 自律性是什么意思| 吃坏东西拉肚子吃什么药| 右乳钙化灶是什么意思| 感冒嗓子痒咳嗽吃什么药| 媱字五行属什么| 九月初十是什么星座| 声带息肉有什么危害| ug什么意思| 天蝎座和什么星座不合| 安乃近是什么药| 蛇跟什么生肖相冲| 睾丸长什么样| 起风疹的原因是什么引起的| 人中长痘痘是什么原因| 澳门用什么币种| 怀孕上火吃什么降火| 男人吃生蚝补什么| 纯爱是什么意思| 见招拆招下一句是什么| 五戒十善是什么| 早上起来心慌是什么原因| 柠檬片泡水喝有什么功效和作用| 纯字五行属什么| 心灵的洗礼是什么意思| 老是想咳嗽是什么原因| 埋汰什么意思| 2型糖尿病吃什么药降糖效果好| 佛心果是什么东西| 休克的本质是什么| 纳差是什么意思| 彩铃是什么意思| b型血rh阳性是什么意思| 微博会员有什么功能| 6月15日是什么日子| 心律不齐房颤吃什么药| 打佛七什么意思| 投其所好是什么意思| 宫腔镜是什么检查| 气胸是什么意思| 狂躁症吃什么药| 晚安安是什么意思| 什么是生理盐水| 椒盐是什么调料| 蹲不下去是什么原因| 以什么当什么| 现在吃什么水果| 什么植物最老实| 尿毒症吃什么最好| 什么地指挥| 人造海蜇丝是什么做的| 利空是什么意思| 蒲公英和玫瑰花一起泡有什么功效| 哪吒的武器是什么| 大便干燥一粒一粒的吃什么药| 不偏不倚是什么意思| 为什么月经每个月提前| 佛度有缘人是什么意思| 头皮起疙瘩是什么原因| 红颜知己是什么意思| 1900年属什么生肖| 忘不了鱼在中国叫什么| 15年什么婚| 鸡奸是什么意思| 甲状腺结节低回声什么意思| 吃羊肉不能吃什么| 痛经什么原因| 妊娠囊是什么| 冠字五行属什么| 胃黏膜病变是什么意思| 葡萄糖偏高有什么问题| 为什么会脚麻| 鼠目寸光是什么生肖| 西加一横读什么| 什么是补铁的食物| 女人腿肿是什么原因引起的| npv是什么意思| 妈宝女是什么意思| 翠花是什么意思| 睡意是什么意思| 湿疹用什么药膏| 排长是什么军衔| 世界上最高的高原是什么| 目赤肿痛吃什么药最好| 取什么网名好听| 寄大件用什么物流便宜| 什么是疣图片| 梦到上坟是什么意思| 高血压吃什么药效果好| 12月25日什么星座| 辞退和开除有什么区别| 胖大海是什么| ak是什么| 什么是意境| 那的反义词是什么| 燚是什么意思| 葛根粉有什么作用| 晚生是什么意思| 洗牙有什么好处和坏处| 状况是什么意思| 康复是什么意思| 怀孕呕吐吃什么可以缓解| 见血是什么兆头| 青城之恋是什么生肖| 贲门ca是什么意思| 护肝吃什么药| 三花鱼是什么鱼| DNA是什么意思啊| 年上年下是什么意思| 小孩子肚子疼吃什么药| 言字旁的字和什么有关| 鼻子里流出黄水是什么原因| 花痴什么意思| 艾迪生病是什么病| 心电图能检查出什么| 稳重什么意思| 什么家| 梦见青蛇是什么预兆| 紫癜是一种什么病严重吗| 焦虑抑郁症吃什么药| 琼花是什么意思| 咳嗽不能吃什么食物| 为什么不建议做冠脉cta检查| 指甲盖凹陷是什么原因| 脱发缺什么维生素| ccs医学是什么意思| 妹控是什么意思| cyl是什么意思| 参军是什么官职| 冬虫夏草有什么好处| 梦见生娃娃是什么意思| 凯乐石属于什么档次| 龙的本命佛是什么佛| 腔隙性脑梗吃什么药| 农历六月十八是什么星座| 闭角型青光眼是什么意思| gs什么意思| 嗣后是什么意思| 爱吃甜食是缺乏什么| 天秤座什么性格| 心房颤动是什么意思| 六味地黄丸的功效是什么| 女生胸部发育到什么年龄| 牙齿吃甜的就会疼什么原因| 为什么会长瘊子| 什么是酮体| 印堂发红是什么的征兆| 火龙果和什么不能一起吃| 咖啡豆是什么动物粪便| 腹泻输液用什么药| pi是什么意思| 白色属于五行属什么| 去迪拜打工需要什么条件| espresso什么意思| 鼻饲是什么意思| 红细胞高是什么原因| 谭咏麟属什么生肖| 迁单是什么意思| 左派是什么意思| 前夫是什么意思| 孜然是什么| 种植什么最赚钱农村| 罐肠什么意思| 身份证借给别人有什么危害性| 血肌酐高吃什么食物| 做梦梦见自己生孩子是什么意思| 金牛座是什么象星座| 按摩头皮有什么好处| 囊肿与肿瘤有什么区别| 朋友妻不可欺是什么意思| 尿ph值是什么| 苁蓉有什么功效| 更年期潮热出汗吃什么药| 头部ct挂什么科| 荷花是什么季节开放的| 子宫内膜增生有什么症状| 尖锐湿疣是什么样的| 糖醋里脊是什么菜系| 心肌缺血挂什么科| 大姨妈为什么会推迟| 什么级别可以配秘书| 耿耿于怀是什么意思| 五彩绳什么时候扔掉| 普乐安片治什么病| 吃什么药死的快| 灵芝有什么功效与作用| 什么烟好抽| 皮蛋和什么不能一起吃| 蘑菇不能和什么一起吃| 梦见蛇咬我是什么意思| 哑巴是什么生肖| 痔疮用什么药膏| 内分泌失调吃什么药效果最好| 易烊千玺的爸爸是干什么的| 老鹰代表什么生肖| 假正经是什么意思| 什么叫慢性萎缩性胃炎| 梦见自己掉牙齿是什么征兆| 啃老是什么意思| 肺部有问题一般会出现什么症状| 贫乳是什么意思| 什么是滑脉| 网名取什么好听| 修缮是什么意思| 紫菜和海苔有什么区别| 前额头疼是什么原因引起的| 88年属龙是什么命| 锅底灰能治什么病| 1922年属什么生肖| 什么叫入伏| 28度穿什么衣服合适| cpp是什么| 百度Jump to content

【両会】今年前半の訪日を積極的に検討 李克強総理

Викип?д?? · отврьст? ?нк?клоп?д?? · страница
百度 好吧,就算这好歹跟鲁迅先生的苍凉文风有一丢丢相合,可《时光阡陌,你一直未曾走远》是个什么鬼?跟周作人有关系吗?《此去经年,谁许我一纸繁华》愣把胡博士变成了吐半口血扶着丫鬟去看白海棠的酸文人。

Documentation for this module may be created at Module:Arguments/doc

-- 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
粥米是什么米 马什么梅 掉头发吃什么药最有效 小腿浮肿吃什么药 什么的万里长城
丑角是什么意思 侮辱什么意思 血管瘤是什么原因引起的 新生儿黄疸高有什么危害 奶茶里面的珍珠是什么做的
去三亚需要什么证件 梦到亲人死了是什么征兆 脾胃虚寒吃什么中成药 小鸟进屋有什么预兆吗 属虎是什么命
ln是什么 t1什么意思 记忆力衰退吃什么药 去冰和常温有什么区别 iv是什么意思
胎盘做成胶囊吃有什么好处hcv8jop6ns9r.cn 尿结石有什么症状hcv7jop6ns7r.cn 什么样的小溪hcv8jop5ns9r.cn 身上长扁平疣是什么原因造成的hcv9jop1ns5r.cn 高什么亮什么hcv9jop5ns1r.cn
乔迁送什么cj623037.com 9月17日是什么星座hcv7jop5ns1r.cn 吃什么解酒快hcv9jop7ns2r.cn 贫血都有什么症状hcv9jop8ns3r.cn 小米粥和什么搭配最好baiqunet.com
短发适合什么脸型hcv9jop3ns2r.cn 梦见已故老人是什么预兆hcv8jop4ns3r.cn 40岁男人学什么乐器好hcv7jop6ns2r.cn 温柔的动物是什么生肖hcv8jop9ns0r.cn 补维生素吃什么药最好hcv9jop5ns2r.cn
bv中间型是什么意思hcv8jop7ns6r.cn 阳五行属什么hcv8jop8ns3r.cn 舌头黄是什么原因hcv8jop4ns2r.cn 牵牛花又叫什么名字aiwuzhiyu.com 男人为什么会出轨hcv8jop5ns4r.cn
百度