Re: lpeg re.lua bug and provided fix
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: lpeg re.lua bug and provided fix
- From: Roberto Ierusalimschy <roberto@...>
- Date: 2018年1月31日 11:37:40 -0200
> > = re.match("aaand", "[a]^2")
> > .\re.lua: attempt to perform arithmetic on local 'p' (a string value)
> >
> > the fix is simple, just make sure class range ALWAYS return lpeg object
>
> Thanks for the report.
>
> -- Roberto
BTW, a cleaner fix seems to be this:
-local item = defined + Range + m.C(any)
+local item = defined + Range + m.P(any)
Then, 'item' always results in a pattern.
-- Roberto