欢迎来到偶像大师中文维基,本站仍在筹备阶段,如有兴趣参与建设可加群申请账号:
542540342
《
偶像大师 全力以赴
》汉化补丁现已发布,
点击此处
转至发布页查看详情
查看“︁Module:GetParameters”︁的源代码
←
Module:GetParameters
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于这些用户组的用户执行:
用户
、editor
您可以查看和复制此页面的源代码。
local p = {} --[[ Helper function that populates the argument list given that user may need to use a mix of named and unnamed parameters. This is relevant because named parameters are not identical to unnamed parameters due to string trimming, and when dealing with strings we sometimes want to either preserve or remove that whitespace depending on the application. ]] function p.getParameters( frame_args, arg_list ) local new_args = {}; local index = 1; local value; for i,arg in ipairs( arg_list ) do value = frame_args[arg] if value == nil then value = frame_args[index]; index = index + 1; end new_args[arg] = value; end return new_args; end --[[ Helper Function to interpret boolean strings ]] function p.getBoolean( boolean_str ) local boolean_value; if type( boolean_str ) == 'string' then boolean_str = boolean_str:lower(); if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0' or boolean_str == '' then boolean_value = false; else boolean_value = true; end elseif type( boolean_str ) == 'boolean' then boolean_value = boolean_str; else error( 'No boolean value found' ); end return boolean_value end function p.defined(frame) local arg = mw.text.trim(frame.args[1]) --if arg == tostring(tonumber(arg)) then -- undesired result for '-0' -- arg = tonumber(arg) --end --if mw.ustring.find(arg, '^%s*-?[1-9][0-9]*%s*$') ~= nil or arg == '0' then -- arg = tonumber(arg) --end if mw.ustring.find(arg, '^-?[1-9][0-9]*$') ~= nil then arg = tonumber(arg) elseif arg == '0' then arg = 0 end return frame:getParent().args[arg] ~= nil end return p
该页面使用的模板:
Module:GetParameters/doc
(
查看源代码
)
返回
Module:GetParameters
。
首页
复制短链接
反馈与建议
管理与编辑
编辑指南
最近更改
维护列表
探索
官方网站
偶像大师 PORTAL
交流群组
友情链接
论坛社区
iM@S制作人同好会
作品汉化
偶像大师SP汉化组
偶像大师OFA汉化组
闪耀色彩汉化小组
学园偶像大师汉化
百科网站
灰姑娘女孩中文维基
闪耀色彩资料库
学园偶像大师图鉴
资讯情报
学园偶像大师同好会
偶像大师闪耀色彩报社
活动组织
偶像大师F@N EXPO
偶像大师国际协力机构
工具
导航菜单
个人工具
登录
命名空间
模块
讨论
English
查看
阅读
查看源代码
查看历史
更多
刷新
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
工具
链入页面
相关更改
特殊页面
页面信息