[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lpeg with file handles?
- From: David Manura <dm.lua@...>
- Date: Wed, 6 Jan 2010 22:10:06 -0500
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