Module:Sandbox/AnataBakka

local p = {} local lib      = require('Module:Feature')

function p.get(frame) local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end x=1 val=string.gsub(string.gsub(string.gsub(string.gsub(string.gsub(string.gsub(args[1]," ",""),"%/"," /"),"%*"," *"),"%+"," +"),"%-"," -"),"x",x) i=1 j=1 while i>0 do       while j>0 do            if string.find(val,"+")~=nil then a=mw.text.split(val,"+") b=mw.text.split(a[2]," ") switcher=last( a[1]," ") switcher2=b[1] switcher3=switcher+switcher2 val=string.gsub(val,switcher.." ".."%+"..switcher2,switcher3) break end i=0 break end end return val end function last(val,sign) local a=mw.text.split(val,sign) local j=1 while j>0 do               if (a[j] ~=nil) and (a[j] ~="") then j=j+1 else break end end return a[j-1] end return p