[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LPEG 're' module self-test fails
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 20 Jun 2016 13:40:31 -0300
> On this page: http://www.inf.puc-rio.br/~roberto/lpeg/re.html
>
> there is a self-test for the 're' module grammar (near the end). In particular:
>
> print(re.match(p, p)) -- a self description must match itself
>
> However testing with Lua 5.1.5, LPEG 1.0.0 and re 1.44, the test fails (it prints nil).
>
> After extensive experimentation, it appears that changing the rule:
>
> exp <- S (alternative / grammar)
>
> to:
>
> exp <- S (grammar / alternative)
>
> fixes the problem. Does this seem valid? If so, could the web page be updated please?
Many thanks for the report. You are right about the correct grammar.
I will fix the page soon.
-- Roberto