function luaY.forlist(t,P,F)local s=P.fs local U={}local Y=0 local R=s.freereg t:new_localvarliteral(P,"\040\102\111\114 \103\101\110\101\114\097\116\111\114\041",Y)Y=Y+1 t:new_localvarliteral(P,"\040\102\111\114 \115\116\097\116\101\041",Y)Y=Y+1 t:new_localvarliteral(P,"\040\102\111\114 \099\111\110\116\114\111\108\041",Y)Y=Y+1 t:new_localvar(P,F,Y)Y=Y+1 while t:testnext(P,"\044")do t:new_localvar(P,t:str_checkname(P),Y)Y=Y+1 end t:checknext(P,"\084\075\095\073\078")local C=P.linenumber t:adjust_assign(P,3,t:explist1(P,U),U)luaK:checkstack(s,3)t:forbody(P,R,C,Y-3,false)end

function luaY:forlist(ls, indexname)
  -- forlist -> NAME {,NAME} IN explist1 forbody
  local fs = ls.fs
  local e = {}  -- expdesc
  local nvars = 0
  local base = fs.freereg
  -- create control variables
  self:new_localvarliteral(ls, "(for generator)", nvars)
  nvars = nvars + 1
  self:new_localvarliteral(ls, "(for state)", nvars)
  nvars = nvars + 1
  self:new_localvarliteral(ls, "(for control)", nvars)
  nvars = nvars + 1
  -- create declared variables
  self:new_localvar(ls, indexname, nvars)
  nvars = nvars + 1
  while self:testnext(ls, ",") do
    self:new_localvar(ls, self:str_checkname(ls), nvars)
    nvars = nvars + 1
  end
  self:checknext(ls, "TK_IN")
  local line = ls.linenumber
  self:adjust_assign(ls, 3, self:explist1(ls, e), e)
  luaK:checkstack(fs, 3)  -- extra space to call generator
  self:forbody(ls, base, line, nvars - 3, false)
end
