fbpx
วิกิพีเดีย

มอดูล:Escape

คู่มือการใช้งานมอดูล[สร้าง]
local escape = {  char = function(self, chr, args)  args = args or {}  local safe = args.safeChr or string.char(13)  chr = tostring(chr or '\\')  self[1] = ('%s0%%s%s'):format(  ('%x%s%s'):format(chr:byte(), safe, safe),  ('%s%x'):format(safe, chr:byte())  )  if not self[self[1]] then  self[self[1]] = {  char = chr,  text = ('%s(.)'):format(chr),  undo = self[1]:format'(%d+)'  }  end  return args.text and self:text(args.text)  or args.undo and self:undo(args.undo, chr)  or args.kill and self:kill(args.kill)  or self  end,  exec = function(self, text, mode, newEscape)  local target = self[self[1] or self:char() and self[1]]  for v in text:gfind(target[mode]) do  text = text:gsub(  mode == 'text' and  ('%s%s'):format(target.char, v:gsub('%W', '%%%1'))  or self[1]:format(v),  mode == 'text' and  self[1]:format(v:byte())  or (newEscape or '') .. v:char()  )  end  return text  end,  text = function(self, text)  return self:exec(type(text) == 'table' and text[1] or text, 'text')  end,  undo = function(self, text, newEscape)  if type(text) == 'table' then  text, newEscape = unpack(text)  end  return self:exec(text, 'undo', newEscape)  end,  kill = function(self, text, chars, newEscape)  if type(text) == 'table' then  text, chars, newEscape = unpack(text)  end  return self:undo(self:text(text):gsub(chars or '', ''), newEscape)  end }  function escape.main(frame)  local args, family = {}, {frame:getParent(), frame}  for f = 1, 2 do  for k, v in pairs(family[f] and family[f].args or {}) do  args[k] = args[k] or v:match('^%s*(.-)%s*$')  end  end  if args.mode == 'char' then  return escape:char(args.char or args[2], args)  end  return escape[args.mode](escape:char(args.char), args) end  return escape 

มอด, escape, อการใช, งานมอด, สร, าง, ณอาจจะต, องการสร, างค, อการใช, งานของมอด, ลน, เข, ยนสามารถทำการทดลองได, กระบะทราย, สร, าง, ดลอก, และช, ดทดสอบ, สร, าง, ของมอด, ลน, โปรดเพ, มหมวดหม, ไปท, หน, าย, อย, หน, าย, อยของมอด, ลน, local, escape, char, function, self,. khumuxkarichnganmxdul srang khunxaccatxngkarsrangkhumuxkarichngankhxngmxdulniphuekhiynsamarththakarthdlxngidthikrabathray srang khdlxk aelachudthdsxb srang khxngmxdulnioprdephimhmwdhmuipthihnayxy doc hnayxykhxngmxdulnilocal escape char function self chr args args args or local safe args safeChr or string char 13 chr tostring chr or self 1 s0 s s format x s s format chr byte safe safe s x format safe chr byte if not self self 1 then self self 1 char chr text s format chr undo self 1 format d end return args text and self text args text or args undo and self undo args undo chr or args kill and self kill args kill or self end exec function self text mode newEscape local target self self 1 or self char and self 1 for v in text gfind target mode do text text gsub mode text and s s format target char v gsub W 1 or self 1 format v mode text and self 1 format v byte or newEscape or v char end return text end text function self text return self exec type text table and text 1 or text text end undo function self text newEscape if type text table then text newEscape unpack text end return self exec text undo newEscape end kill function self text chars newEscape if type text table then text chars newEscape unpack text end return self undo self text text gsub chars or newEscape end function escape main frame local args family frame getParent frame for f 1 2 do for k v in pairs family f and family f args or do args k args k or v match s s end end if args mode char then return escape char args char or args 2 args end return escape args mode escape char args char args end return escape ekhathungcak https th wikipedia org w index php title mxdul Escape amp oldid 6420877, wikipedia, วิกิ หนังสือ, หนังสือ, ห้องสมุด,

บทความ

, อ่าน, ดาวน์โหลด, ฟรี, ดาวน์โหลดฟรี, mp3, วิดีโอ, mp4, 3gp, jpg, jpeg, gif, png, รูปภาพ, เพลง, เพลง, หนัง, หนังสือ, เกม, เกม