function luaY.singlevaraux(w,g,p,J,I)if g==nil then w:init_exp(J,"\086\071\076\079\066\065\076",luaP.NO_REG)return"\086\071\076\079\066\065\076"else local k=w:searchvar(g,p)if k>=0 then w:init_exp(J,"\086\076\079\067\065\076",k)if I==0 then w:markupval(g,k)end return"\086\076\079\067\065\076"else if w:singlevaraux(g.prev,p,J,0)=="\086\071\076\079\066\065\076"then return"\086\071\076\079\066\065\076"end J.info=w:indexupvalue(g,p,J)J.k="\086\085\080\086\065\076"return"\086\085\080\086\065\076"end end end
------------------------------------------------------------------------
-- handle locals, globals and upvalues and related processing
-- * search mechanism is recursive, calls itself to search parents
-- * used only in singlevar()
------------------------------------------------------------------------
function luaY:singlevaraux(fs, n, var, base)
	if fs == nil then -- no more levels?
		self:init_exp(var, "VGLOBAL", luaP.NO_REG) -- default is global variable
		return "VGLOBAL"
	else
		local v = self:searchvar(fs, n) -- look up at current level
		if v >= 0 then
			self:init_exp(var, "VLOCAL", v)
			if base == 0 then
				self:markupval(fs, v) -- local will be used as an upval
			end
			return "VLOCAL"
		else -- not found at current level; try upper one
			if self:singlevaraux(fs.prev, n, var, 0) == "VGLOBAL" then
				return "VGLOBAL"
			end
			var.info = self:indexupvalue(fs, n, var) -- else was LOCAL or UPVAL
			var.k = "VUPVAL" -- upvalue in this level
			return "VUPVAL"
		end --if v
	end --if fs
end
