[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Possible bug in string.gsub
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 18 Mar 2011 14:58:31 -0300
> > The "fix" would be to add an explicit check for unfinished captures. I
> > am not sure it is worth the trouble.
> Depends, if the trouble would be 1 line of code, it would easily be
> worth it, anything that helps coders to catch an error sooner than
> later can safe tons of work in the worst case.
It is not only 1 line. It would be a few lines more to detect the
error when there is a match. It would be much more lines to detect
the error in all cases. (Currently Lua checks the pattern as it
goes along the match. It would need an extra unit to pre-check the
pattern in advance.)
PS: please, do not send messages with Cc: to someone (me, in this
case). Send it only to the list.