Module:Var
Appearance
From Wikipedia, the free encyclopedia
You might want to create a documentation page for this Scribunto module.
Editors can experiment in this module's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this module.
Editors can experiment in this module's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this module.
localp={} locallib_arg={} locallib_str=mw.ustring localyesno=require('Module:Yesno') localmain_template_name="Variable" localmodule_call="#invoke:Var" localsoft_subst_main="Softsubst" localmessages,_L,lib_es,lib_tc,command_list={ magic_space='127円'..string.char(0xC2,0xA0), strip_mark="127円'\"`UNIQ--%s-%s-QINU`\"'127円", strip_mark_pattern="127円'\"`UNIQ%%-%%-%s%%-%s%%-QINU`\"'127円", arg_global='_arg_process', cant_subst='Variables cannot be accessed during the substitution phase.', cat_subst_not_done="Pages with unresolved replacement references", not_support_strip_warning_cmt="<!--可能需要手動調整的擴展標籤-->", not_support_strip_warning="[[Template:softsubst]]警告:欲顯示替換引用原碼的模板中包含了擴展標籤,可能導致結果不準確,或替換引用失敗。", do_subst='<p class="notice metadata" id="spoiler" style="font-size: small">以下内容為[[WP:Subst|替換引用]]後的預期內容,請自行拷貝原始碼完成替換引用。</p><div style="clear: both; overflow: auto; border: 1px solid #cccccc; padding: 4px; text-align: left; background: transparency;">', remove_hide_strip_mark="<span%s+style%s*=%s*[\"\']%s*display%s*:%s*none%s*;?%s*[\"\']%s*>[^<]+UNIQ%-%-nowiki[^<]+<%s*/%s*span%s*>", var_undefine='變數 "%s" 未定義。', NullPointerException='[[NullPointerException|空指標]]錯誤'},{p=p},require("Module:EditState"), require("Module:TrackingCategory"),{'none', set={'set','設定','設置'}, get={'get','取值','取','取得'}, getconst={'getconst'}, ref={'ref','取址'}, refget={'refget','refgetname'}, hide={'hide','隱藏'}, subst={'subst'}, call={'call','callconst','呼叫','執行','運行'}, hist={'hist','歷史'}, delete={'del','delete','刪除'}, new={'new'}, }; localnotsupport_strip=false localno_color=false localprintf=lib_str.format localsub=lib_str.sub localgsub=lib_str.gsub localtrim=mw.text.trim localsplit=mw.text.split localfunction_test_cmd(cmd_names,test) localresult,trim_test=false,trim(lib_str.lower(test)) fori=1,#cmd_namesdoresult=resultor(trim_test==cmd_names[i])end returnresult end localfunctionaddWarning(msg) returnmw.addWarning(require('Module:Error').error{[1]=msg}) end localfunctioncodeNowikiWithColor(frame,code_lang,text) ifno_colorthenreturnframe:extensionTag('nowiki',text)end returnframe:extensionTag('syntaxhighlight',text,{inline='',lang=code_lang}) end localstrip_code_color_map={} localignore_strip_code={ indicator=true, h=true, item=true } localfunctionstrip_code_color(frame,strip_code) localstrip_type=strip_code:lower() ifignore_strip_code[strip_type]==truethenreturn{'',''}end ifno_colorthenreturn{messages.not_support_strip_warning_cmt..'<'..strip_type..'>','</'..strip_type..'>'}end localresult=strip_code_color_map[strip_type] ifresultthenreturnresultelse strip_code_color_map[strip_type]={ codeNowikiWithColor(frame,'xml',messages.not_support_strip_warning_cmt..'<'..strip_type..'>'), codeNowikiWithColor(frame,'xml','</'..strip_type..'>') } end returnstrip_code_color_map[strip_type] end localfunctionno_color_check(frame,text) ifno_colorthenreturnframe:extensionTag('pre',text)end returntext end localfunctionout_new_line() ifno_colorthenreturn'\n'end returntostring(mw.html.create('br')) end localsubst_pattern="%s*[Ss][Uu][Bb][Ss][Tt]%s*:%s*" localsafesubst_pattern="%s*[Ss][Aa][Ff][Ee][Ss][Uu][Bb][Ss][Tt]%s*:%s*" localmsg_pattern="%s*[Mm][Ss][Gg]%s*:%s*" localmsgnw_pattern="%s*[Mm][Ss][Gg][Nn][Ww]%s*:%s*" --區域變數結尾 local_jsonEncode=require('Module:EncoderUtil')._jsonEncode --函數本體 functionp.Varfunc(frame,from_meta_table) localargs,working_frame=p._arg_process(frame) ifmw.isSubsting()thenreturn require('Module:Template invocation').invocation(string.format("%s|%s",module_call,'softSubst_msg'),args) end localcommand=args['1']orargs[1]or'' if_test_cmd(command_list.set,command)or_test_cmd(command_list.new,command)or_test_cmd(command_list.delete,command)then localm_mode='VAR' if_test_cmd(command_list.delete,command)thenm_mode='DELETE' elseif_test_cmd(command_list.new,command)thenm_mode='NEW'end localcall_args={} forkey,valinpairs(args)do localchecker=tonumber(key) ifchecker~=1thencall_args[key]=valend end returnp.makeVar(call_args,m_mode,from_meta_table) elseif_test_cmd(command_list.get,command)then returnp.getVar({args['2']orargs[2]or'',args['3']orargs[3],default=args.default},'value',false,from_meta_table) elseif_test_cmd(command_list.ref,command)then returnp.getVar({args['2']orargs[2]or''},'addr',false,from_meta_table) elseif_test_cmd(command_list.getconst,command)then returnp.getVar({args['2']orargs[2]or''},'value',true,from_meta_table) elseif_test_cmd(command_list.refget,command)then localaddr=args['2']orargs[2]or'' localresult=p._getRefVarObj('VAR',addr) localremappingTable={refget='value',refgetname='name'} ifresultthen ifresult[remappingTable[command]]thenreturnresult[remappingTable[command]]end end returnmw.getCurrentFrame():expandTemplate{title='Error',args={messages.NullPointerException}} elseif_test_cmd(command_list.hide,command)then iftrim(args['2']orargs[2]or'')~=''then working_frame:extensionTag('ref',args['2']orargs[2]or'',{group='UINQ-VARDEF-BLOCK-QINU'}) working_frame:extensionTag('references','',{group='UINQ-VARDEF-BLOCK-QINU'}) end return'' elseif_test_cmd(command_list.subst,command)then returnp._softSubst({args['2']orargs[2]or''}) elseif_test_cmd(command_list.call,command)then returnp.callVar(p._seek_arg(args,1),command=='callconst') elseif_test_cmd(command_list.hist,command)then returnp.getVarHist(p._seek_arg(args,1),from_meta_table) end return'' end p.Var={ set=function(i)localj=p._seek_arg(i,-1,true);fork,linpairs(i)doj[k]=j[k]orlendj[1]='set';returnp.Varfunc(j,true)end, new=function(i)localj=p._seek_arg(i,-1,true);fork,linpairs(i)doj[k]=j[k]orlendj[1]='new';returnp.Varfunc(j,true)end, delete=function(i)localj=p._seek_arg(i,-1,true);fork,linpairs(i)doj[k]=j[k]orlendj[1]='delete';returnp.Varfunc(j,true)end, get=function(i)localj=p._seek_arg(i,-1,true);j[1]='get';returnp.Varfunc(j,true)end, getconst=function(i)localj=p._seek_arg(i,-1,true);j[1]='getconst';returnp.Varfunc(j,true)end, hist=function(i)localj=p._seek_arg(i,-1,true);j[1]='hist';returnp.Varfunc(j,true)end, call=function(i)localj=p._seek_arg(i,-1,true);j[1]='call';returnp.Varfunc(j,true)end, refget=function(i)localj=p._seek_arg(i,-1,true);j[1]='refget';returnp.Varfunc(j,true)end, refgetname=function(i)localj=p._seek_arg(i,-1,true);j[1]='refgetname';returnp.Varfunc(j,true)end, ref=function(i)localj=p._seek_arg(i,-1,true);j[1]='ref';returnp.Varfunc(j,true)end, vars=function(const) localarg_table=p._getVars("VAR",const) localrestlt={} forkey,valinpairs(arg_table)do localget_result,check_json=mw.ustring.gsub(arg_table[key].value,"^%$JSON%$",'') ifcheck_json>0then restlt[key]=mw.text.jsonDecode(get_result) else restlt[key]=get_result end end returnrestlt end } p.Var=setmetatable(p.Var,{ __index=function(t,k)returnt.get({k})end, __newindex=function(t,k,v) localstored=t.set({[k]=v}) p.Varfunc({'hide',stored}) end }) functionp.makeVar(frame,mode,from_meta_table) localvarMode=modeor'VAR' ifvarMode=='NEW'thenvarMode='VAR'end iftrim(varMode)==''thenvarMode='VAR'end localargs,working_frame=p._arg_process(frame) localout_text=function(out_mode,name,value) returnprintf(messages.magic_space.."$%s_DEF %s=%s"..messages.magic_space,out_mode,name,value) end localbody='' localnew_body='' forkey,valinpairs(args)do localstore_value=val iffrom_meta_table==truethen iftype(store_value)~=type('string')thenstore_value="$JSON$".._jsonEncode(store_value)end end ifmode=='DELETE'thenbody=body..out_text(varMode,store_value,store_value)..';' else ifmode=='NEW'thennew_body=new_body..out_text('DELETE',key,key)..';'end body=body..out_text(varMode,key,store_value)..';' end end ifmode=='NEW'thennew_body=working_frame:extensionTag('nowiki',new_body)end body=new_body..working_frame:extensionTag('nowiki',body) returnmw.text.tag('span',{style="display:none;"},body) end functionp.softSubst(frame) localargs,working_frame=p._arg_process(frame) ifmw.isSubsting()thenreturnrequire('Module:Template invocation').invocation(soft_subst_main,args)end localtemplate_title=trim(args['1']orargs['1']or'') iftemplate_title==''thenreturn''end returnp.softSubst_msg(p._seek_arg(args,1),template_title, yesno(args['no cat']orargs['no_cat']orargs.nocatorargs.NoCatorargs.noCatorfalse)) end localfunctioncheck_is_main_doc(working_frame) localchecker=mw.ustring.lower(working_frame:preprocess("{{BASEPAGENAME}}")) ifchecker==mw.ustring.lower(main_template_name)or checker==mw.ustring.lower(soft_subst_main)orchecker=='var'thenreturntrueend returnfalse end functionp.softSubst_msg(frame,template_title,without_cat) localtemplate_dis=template_titleormain_template_name localargs,working_frame=p._arg_process(frame) ifmw.isSubsting()thenreturnrequire('Module:Template invocation').invocation(string.format("%s|%s",module_call,'softSubst_msg'),args)end localresult=require('Module:Template invocation').invocation(template_dis,args) iflib_es.isPreview()then localpre_result=working_frame:preprocess(result) if#(split(gsub(pre_result,'\r\n','\n'),'\n'))>50thenno_color=trueend result=p._softSubst({working_frame:preprocess(result)}) iftemplate_title==nilthen result=working_frame:expandTemplate{title='Error',args={messages.cant_subst}}..result end ifnotsupport_strip==truethenresult='<p>{{Error|'..messages.not_support_strip_warning..'}}</p>'..resultend else if(check_is_main_doc(working_frame)==false)and(notwithout_cat)thenlib_tc.append(messages.cat_subst_not_done)end end ifnotsupport_strip==truethenaddWarning(messages.not_support_strip_warning)end returnworking_frame:preprocess(result) end functionp._softSubst(frame) localsoftSubst_data,softSubst_warp='arg_global',string.char(0x70) iftype(softSubst_data)~=type({'table'})then --find method between global scope or local scope softSubst_data={(_G[softSubst_warp]or_L[softSubst_warp])[messages[softSubst_data]](frame)} end localwithout_cat=yesno(softSubst_data['no cat']orsoftSubst_data['no_cat']orsoftSubst_data['nocat']orsoftSubst_data['NoCat']orsoftSubst_data['noCat']orfalse) --decode method localfirst_data,second_data,third_data=softSubst_data['1']orsoftSubst_data[1],softSubst_data['2']orsoftSubst_data[2],(_G[softSubst_warp]or_L[softSubst_warp])["_code_getter_wiki"] --2nd layer decode first_data=first_data['1']orfirst_data[1]or'' --second_data = second_data['2'] or second_data[2] or '' --third_data = third_data['3'] or third_data[3] or '' iflib_es.isPreview()~=trueand(notwithout_cat)then if(check_is_main_doc(second_data)==false)thenlib_tc.append(messages.cat_subst_not_done)end end localfourth_data=function(msg_data) localmsg_data_list,result_code=split(msg_data,'\n'),'' fori=1,#msg_data_listdoresult_code=result_code..third_data(second_data,msg_data_list[i])end ifno_colorthenresult_code=no_color_check(second_data,result_code)end returnresult_code end --foreach method do iftrim(first_data)~=''thenreturn mw.clone(messages.do_subst)..fourth_data(gsub( gsub(first_data,messages.remove_hide_strip_mark,'') ,'\r\n','\n'))..'</div>' end return'' end functionp.callVar(frame,const) localargs,working_frame=p._arg_process(frame) localvars=p._getVars('VAR',const) localvar_name=args[1]orargs['1']or'' localget_value=vars[var_name] iftonumber(var_name)andnotget_valuethenget_value=vars[tonumber(var_name)]end ifget_valuethen localfunc_name=trim(mw.clone(get_value.value),"|\t\r\n\f ") func_name=gsub(func_name,subst_pattern,'') func_name=gsub(func_name,safesubst_pattern,'') func_name=gsub(func_name,msg_pattern,'') func_name=gsub(func_name,msgnw_pattern,'') localtail_index=(lib_str.find(func_name,'|')or(lib_str.len(func_name)+1))-1 command_tail=sub(func_name,tail_index+1,-1) func_name=sub(func_name,1,tail_index) localfinal_func_name='' --template: localtemplate_name=mw.title.new(func_name,'Template') iftemplate_nameandtemplate_name.existsthen final_func_name=template_name.fullText iftemplate_name.namespace==0thenfinal_func_name=':'..final_func_nameend end --int: localtemplate_split=split(func_name,':')or{func_name} iffinal_func_name==''then localcheck_mw=func_name if#template_split>1and(sub(template_split[1],1,3)=='int'or (lib_str.find(template_split[1],"[Mm]edia[Ww]iki")))then check_mw=table.concat(template_split,':',2,#template_split) end ifmw.message.new(check_mw):exists()then final_func_name='int:'..check_mw end end --#...: localfix_cs=false iffinal_func_name==''then ifxpcall(function()mw.getCurrentFrame():callParserFunction(func_name,func_name)end,function()end) ==truethen final_func_name=func_name fix_cs=true localparser_tail_check=sub(trim(final_func_name),-1) ifparser_tail_check~=':'andparser_tail_check~='|'thenfinal_func_name=final_func_name..':'end end end --may be magic word iffinal_func_name==''then localchecker,check_text=xpcall(function() returnmw.getCurrentFrame():preprocess(printf("{{%s}}",func_name)) end,function()end) localtest_name=(template_nameor{prefixedText=func_name}).prefixedText ifnotlib_str.find(check_textor'',printf("^{{%s}}$",test_name))and notlib_str.find(check_textor'',printf("^%%[%%[:%s%%]%%]$",test_name))then final_func_name=func_name end end iftrim(final_func_name)~=''then localnum_args=p._seek_arg(args,1) localstr_args=require('Module:Template invocation').invocation(final_func_name..command_tail,num_args) iffix_cs==trueandtrim(command_tail)==''and sub(trim(final_func_name),-1)==':'then str_args=gsub(str_args,"^({{)%s*("..final_func_name..")|","%1%2") end returnworking_frame:preprocess(str_args) end localmax_arg=0 localnum_args={} forkey,valueinpairs(args)do localarg_id=tonumber(keyor'') ifarg_idthen ifarg_id>max_argthenmax_arg=arg_idend num_args[arg_id]=value end end localcall_args={} localget_obj=function(obj)returnmw.text.jsonDecode(obj)end ifmax_arg>1then fori=2,max_argdo ifnum_args[i]then localtry_to_get_obj=mw.clone(num_args[i]) ifnotxpcall(function()--try try_to_get_obj=get_obj(num_args[i]) end,function(msg)returnmsgend)then--catch call_args[i-1]=num_args[i] else--finally call_args[i-1]=try_to_get_obj end elsecall_args[i-1]=''end end end localfunc_path=split(func_name,'%.')or{[1]=func_name} localfunc_body=mw[func_path[1]]orp[func_path[1]]or_G[func_path[1]] iflib_str.find(func_path[1],':')then func_body=require(func_path[1])orfunc_body end iffunc_bodythen localold_obj=func_body fori=2,#func_pathdo func_body=func_body[func_path[i]] iffunc_bodythen old_obj=func_body else return'' end end localfunc_type=type(func_body) localtimes=10 forti=1,timesdo iffunc_type==type(nil)then return'' elseiffunc_type==type(0)then return''..func_body elseiffunc_type==type(true)then iffunc_bodythenreturn'1'end return'' elseiffunc_type==type(type)then ifmax_arg>1then func_body=func_body(unpack(call_args)) iffunc_body==nilthenfunc_body=call_args[1]end elsefunc_body=func_body()end elseiffunc_type==type("string")then returnfunc_body elseiffunc_type==type({})then return_jsonEncode(func_body) end func_type=type(func_body) end end returnfunc_name end iftrim(var_name)~=''then returnworking_frame:expandTemplate{title='Error',args={printf(messages.var_undefine,var_name)}} end return'' end functionp._arg_process(frame) localargs,working_frame ifframe==mw.getCurrentFrame()then -- We're being called via #invoke. The args are passed through to the module -- from the template page, so use the args that were passed into the template. iflib_arg.getArgs==nilthenlib_arg=require('Module:Arguments')end args=lib_arg.getArgs(frame,{ parentFirst=true, trim=false, removeBlanks=false }) working_frame=frame else -- We're being called from another module or from the debug console, so assume -- the args are passed in directly. args=frame working_frame=mw.getCurrentFrame() iftype(args)~=type({})thenargs={frame}end end returnargs,working_frame end functionp.getVar(frame,get_mode,const,from_meta_table) localto_get_mode=get_modeor'value' localargs,working_frame=p._arg_process(frame) localvars=p._getVars('VAR',const) localvar_name=args[1]orargs['1']or'' localget_value=vars[var_name] iftonumber(var_name)andnotget_valuethenget_value=vars[tonumber(var_name)]end ifget_valuethen localget_result,check_json=mw.ustring.gsub(get_value[to_get_mode],"^%$JSON%$",'') ifcheck_json>0andfrom_meta_table==truethen returnmw.text.jsonDecode(get_result) end returnget_result end iftrim(var_name)~=''then ifargs[2]orargs['2']orargs.defaultthenreturnargs[2]orargs['2']orargs.defaultend iffrom_meta_table==truethenreturnerror(printf(messages.var_undefine,var_name))end returnworking_frame:expandTemplate{title='Error',args={printf(messages.var_undefine,var_name)}} end return'' end functionp.getVarHist(frame,from_meta_table) localargs,working_frame=p._arg_process(frame) localvars=p._getVars('VAR') localvar_name=args[1]orargs['1']or'' localget_value=vars[var_name] iftonumber(var_name)andnotget_valuethenget_value=vars[tonumber(var_name)]end ifget_valuethen localformats=args[2]orargs['2']or'$' localseps=args[3]orargs['3']or', ' localhists=split(get_value.hist,'$127円;127円^') localbody='' iffrom_meta_table==truethen localget_result,check_json={},-1 fori=1,#histsdo get_result[i],check_json=mw.ustring.gsub(hists[i],"^%$JSON%$",'') ifcheck_json>0then get_result[i]=mw.text.jsonDecode(get_result[i]) end end returnget_result end fori=1,#histsdo ifi>1thenbody=body..sepsend body=body..gsub(formats,'%$',hists[i]) end returnbody end iftrim(var_name)~=''then iffrom_meta_table==truethenreturnerror(printf(messages.var_undefine,var_name))end returnworking_frame:expandTemplate{title='Error',args={printf(messages.var_undefine,var_name)}} end return'' end functionp._getRefVarObj(VarMode,addr) localaddr_path=split(addr,':') if#addr_path==2then localstrip_id,addr_loc=addr_path[1],addr_path[2] strip_id=tonumber(strip_id) addr_loc=tonumber(addr_loc) ifstrip_idandaddr_locthen localtry_get=mw.text.unstripNoWiki(p._stripMark('nowiki',string.format("%08X",strip_id))) localin_index,arg_data=1,nil gsub(try_get,messages.magic_space.."%$"..VarMode.."_DEF%s+([^=]+)=([^"..messages.magic_space..']*)', function(f_key,f_value) localkey,value=f_key,f_value key=trim(key) ifin_index==addr_locthen arg_data={ name=key, value=value, addr=string.format("%d:%d",strip_id,in_index) }end in_index=in_index+1 end) returnarg_data end end returnnil end functionp._seek_arg(input_args_list,offset,enable_minus) localnum_args={} ifenable_minus~=trueandoffset<=1thenoffset=1end forkey,valueinpairs(input_args_list)do localnum=tonumber(key)or0 localstored=false ifnumthen ifnum>offsetthen num_args[num-offset]=value stored=true end ifnum>=1andnum<=offsetthenstored=trueend end ifstored~=truethennum_args[key]=valueend end returnnum_args end functionp._code_getter_wiki(working_frame,input_code) localcurrent_text,code_lang=input_code,"moin" localflag1=lib_str.find(current_text,"<%s*/?%s*[A-Za-z]") localflag2=lib_str.find(current_text,"[A-Za-z\"']%s*/?%s*>") ifflag1orflag2thencode_lang="html"end localbody='' localstrip_to_remove=split(current_text,'127円') fori=1,#strip_to_removedo localcurrent_strip=strip_to_remove[i] iflib_str.find(current_strip,"'\"`UNIQ%-%-")then iflib_str.find(current_strip,"nowiki")then localtry_unstrip='127円'..current_strip..'127円' try_unstrip=mw.text.unstripNoWiki(try_unstrip) iflib_str.find(try_unstrip,"'\"`UNIQ%-%-")then --不存在的strip entity body=body..'127円'..current_strip..'127円' else try_unstrip=mw.text.decode(try_unstrip) try_unstrip=printf("<nowiki>%s</nowiki>",table.concat(split(try_unstrip,"nowiki"),'</nowiki>nowiki<nowiki>')) body=body..codeNowikiWithColor(working_frame,'xml',try_unstrip) end else --保留原始strip符號令解析器自動替換 localstrip_type='' gsub(current_strip,"UNIQ%-%-([%dA-Za-z]+)%-",function(in_str)strip_type=in_strend) localout_strip_text='127円'..current_strip..'127円' ifstrip_type~=''then localstrip_code_color_data=strip_code_color(working_frame,strip_type) out_strip_text=strip_code_color_data[1]..out_strip_text..strip_code_color_data[2] end body=body..out_strip_text notsupport_strip=true end elseiftrim(current_strip)~=''then localavoid_t=split(current_strip,'%-{')or{avoid_t} fora_i=1,#avoid_tdo locala_ic=avoid_t[a_i] ifa_i~=1thena_ic='{'..a_icend ifa_i~=#avoid_tthena_ic=a_ic..'-'end body=body..codeNowikiWithColor(working_frame,code_lang,a_ic) end end end returnbody..out_new_line() end functionp._getVars(VarMode,const) localframe=mw.getCurrentFrame() localmark_get_mark,max_id=frame:extensionTag('nowiki','nowiki'),'' gsub(mark_get_mark,'nowiki%-([0-9A-Za-z]+)%-',function(id)max_id=idend) localmax_id_num,body=tonumber(max_id,16),'' localsymbol_table={} fori=1,max_id_numdo localtry_get=mw.text.unstripNoWiki(p._stripMark('nowiki',string.format("%08X",i-1))) localin_index=1 gsub(try_get,messages.magic_space.."%$([A-Z]+)_DEF%s+([^=]+)=([^"..messages.magic_space..']*)', function(sub_mode,f_key,f_value)--VarMode localkey,value=f_key,f_value key=trim(key) ifkey~=''then localitifconst==truethenit=symbol_table[key]end localold=symbol_table[key] ifsub_mode=='DELETE'thensymbol_table[key]=nil elseifsub_mode==VarModethen symbol_table[key]=itor{ name=key, value=value, hist=((oldor{}).histand((oldor{}).hist..'$127円;127円^')or'')..value, addr=string.format("%d:%d",(i-1),in_index) }end end in_index=in_index+1 end) end returnsymbol_table end functionp._stripMark(mark_name,mark_id) returnprintf(messages.strip_mark,mark_name,mark_id) end returnp