lua-users home
lua-l archive

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


On 1/3/07, Mike Pall <mikelu-0701@mike.de> wrote:
Hi,

I found no closed PEG for properly parsing Lua 5.1 long strings
and long comments. This is easy for any finite subset:

  "[==[" * (P(1)-"]==]")^0 * "]==]"

Could this be solved w/ a recursive PEG?
Ex:
[<recurse>]
recurse:=<recurse>=
recurse:[<innertext>]
innertext:  (Hrm... what here?)

... Hrm, just realized the error there... don't think we can have it
backstep out to try the end-sequence match.

However... my approach 'might' be practical in an extension to the
matching system.
--
Thomas Harning Jr.