function luaY.retstat(e,t)local o=t.fs local R={}local s,q luaX:next(t)if e:block_follow(t.t.token)or t.t.token=="\059"then s,q=0,0 else q=e:explist1(t,R)if e:hasmultret(R.k)then luaK:setmultret(o,R)if R.k=="\086\067\065\076\076"and q==1 then luaP:SET_OPCODE(luaK:getcode(o,R),"\079\080\095\084\065\073\076\067\065\076\076")assert(luaP:GETARG_A(luaK:getcode(o,R))==o.nactvar)end s=o.nactvar q=e.LUA_MULTRET else if q==1 then s=luaK:exp2anyreg(o,R)else luaK:exp2nextreg(o,R)s=o.nactvar assert(q==o.freereg-s)end end end luaK:ret(o,s,q)end
------------------------------------------------------------------------
-- parse a return statement
-- * used in statements()
------------------------------------------------------------------------
function luaY:retstat(ls)
	-- stat -> RETURN explist
	local fs = ls.fs
	local e = {} -- expdesc
	local first, nret -- registers with returned values
	luaX:next(ls) -- skip RETURN
	if self:block_follow(ls.t.token) or ls.t.token == ";" then
		first, nret = 0, 0 -- return no values
	else
		nret = self:explist1(ls, e) -- optional return values
		if self:hasmultret(e.k) then
			luaK:setmultret(fs, e)
			if e.k == "VCALL" and nret == 1 then -- tail call?
				luaP:SET_OPCODE(luaK:getcode(fs, e), "OP_TAILCALL")
				assert(luaP:GETARG_A(luaK:getcode(fs, e)) == fs.nactvar)
			end
			first = fs.nactvar
			nret = self.LUA_MULTRET -- return all values
		else
			if nret == 1 then -- only one single value?
				first = luaK:exp2anyreg(fs, e)
			else
				luaK:exp2nextreg(fs, e) -- values must go to the 'stack'
				first = fs.nactvar -- return all 'active' values
				assert(nret == fs.freereg - first)
			end
		end --if
	end --if
	luaK:ret(fs, first, nret)
end
