function luaY.repeatstat(P,k,q)local L=k.fs local b=luaK:getlabel(L)local w,u={},{}P:enterblock(L,w,true)P:enterblock(L,u,false)luaX:next(k)P:chunk(k)P:check_match(k,"\084\075\095\085\078\084\073\076","\084\075\095\082\069\080\069\065\084",q)local C=P:cond(k)if not u.upval then P:leaveblock(L)luaK:patchlist(k.fs,C,b)else P:breakstat(k)luaK:patchtohere(k.fs,C)P:leaveblock(L)luaK:patchlist(k.fs,luaK:jump(L),b)end P:leaveblock(L)end
------------------------------------------------------------------------
-- parse a repeat-until control structure, body parsed by chunk()
-- * used in statements()
------------------------------------------------------------------------
function luaY:repeatstat(ls, line)
	-- repeatstat -> REPEAT block UNTIL cond
	local fs = ls.fs
	local repeat_init = luaK:getlabel(fs)
	local bl1, bl2 = {}, {} -- BlockCnt
	self:enterblock(fs, bl1, true) -- loop block
	self:enterblock(fs, bl2, false) -- scope block
	luaX:next(ls) -- skip REPEAT
	self:chunk(ls)
	self:check_match(ls, "TK_UNTIL", "TK_REPEAT", line)
	local condexit = self:cond(ls) -- read condition (inside scope block)
	if not bl2.upval then -- no upvalues?
		self:leaveblock(fs) -- finish scope
		luaK:patchlist(ls.fs, condexit, repeat_init) -- close the loop
	else -- complete semantics when there are upvalues
		self:breakstat(ls) -- if condition then break
		luaK:patchtohere(ls.fs, condexit) -- else...
		self:leaveblock(fs) -- finish scope...
		luaK:patchlist(ls.fs, luaK:jump(fs), repeat_init) -- and repeat
	end
	self:leaveblock(fs) -- finish loop
end
