function luaY.fornum(O,C,c,r)local p=C.fs local b=p.freereg O:new_localvarliteral(C,"\040\102\111\114 \105\110\100\101\120\041",0)O:new_localvarliteral(C,"\040\102\111\114 \108\105\109\105\116\041",1)O:new_localvarliteral(C,"\040\102\111\114 \115\116\101\112\041",2)O:new_localvar(C,c,3)O:checknext(C,"\061")O:exp1(C)O:checknext(C,"\044")O:exp1(C)if O:testnext(C,"\044")then O:exp1(C)else luaK:codeABx(p,"\079\080\095\076\079\065\068\075",p.freereg,luaK:numberK(p,1))luaK:reserveregs(p,1)end O:forbody(C,b,r,1,true)end

function luaY:fornum(ls, varname, line)
  -- fornum -> NAME = exp1,exp1[,exp1] forbody
  local fs = ls.fs
  local base = fs.freereg
  self:new_localvarliteral(ls, "(for index)", 0)
  self:new_localvarliteral(ls, "(for limit)", 1)
  self:new_localvarliteral(ls, "(for step)", 2)
  self:new_localvar(ls, varname, 3)
  self:checknext(ls, '=')
  self:exp1(ls)  -- initial value
  self:checknext(ls, ",")
  self:exp1(ls)  -- limit
  if self:testnext(ls, ",") then
    self:exp1(ls)  -- optional step
  else  -- default step = 1
    luaK:codeABx(fs, "OP_LOADK", fs.freereg, luaK:numberK(fs, 1))
    luaK:reserveregs(fs, 1)
  end
  self:forbody(ls, base, line, 1, true)
end
