lua-users home
lua-l archive

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


Hi all,

The original token filter patch had an awkward dependency on a global
Lua function called FILTER. This version provides a public Lua API
which allows you to register the two different kinds of callback
needed.

For instance, a simple pass-through debug filter:

tokenf.module(function(get,source)
	print("FILTER",source)
	tokenf.filter(function ()
		local line,token,value=get()
		print("FILTER",line,token,value)
		return line,token,value
	end)
end)

It also allows for classic C token filters to be registered. However,
only one filter at a time, so this cannot be combined with Lua
filters.

For those wishing to play with macros, there is a new version of
macro/init.lua which is a drop-in replacement for the current LuaMacro
file.

It's still very young, but the best way to find problems is to invoke
the curiosity of the community. (Only tested on Windows and Debian so
far.)

steve d.

http://mysite.mweb.co.za/residents/sdonovan/lua/tokenf-2.0.zip