lua-users home
lua-l archive

Re: Lpeg with file handles?

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


On Wed, Jan 6, 2010 at 9:11 PM, Quae Quack wrote:
> Wondering if roberto could modify lpeg to accept file handles as a subject
> for a match....
> or even allow custom functions that can return another chunk of string to
> match upon.....
See [1].
It might not be too hard to patch the code, adding an abstraction over
character access. When I translated the Lua pattern library to Lua
[2], I allowed for strings to be replaced with abstractions of strings
(e.g. objects backed by an underlying file handle).
[1] http://lua-users.org/lists/lua-l/2008-08/msg00411.html
[2] http://lua-users.org/wiki/StringLibraryInLua

AltStyle によって変換されたページ (->オリジナル) /