lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> >You may want to try the _very_dirty_hack_ of creating your tables like
> >this:
> >
> > t = {nil,nil,nil,nil,nil,nil,nil,nil,nil,nil}
> 
> Where are token filters when you need them ;-)

Here :-)

local function F(get,put)
	put("F init")
	while true do
		local line1,token1,value1=get()
		put(line1,token1,value1)
		if token1=="{" then
			local line2,token2,value2=get()
			if token2=="}" then
				for i=1,8 do
					put(line2,"nil")
					put(line2,",")
				end
			end
			put(line2,token2,value2)
		end
	end
end

function FILTER(get,source)
	FILTER=coroutine.wrap(F)
	FILTER(get,coroutine.yield)
end

--lhf