lua-users home
lua-l archive

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


On Thu, May 5, 2016 at 10:21 AM, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>> 2. Why has the capture limit been changed from an int to an unsigned
>> char? Does this have something to do with limits on number of return
>> values or number of function arguments (i.e. string.gsub called with a
>> replacement function)?
>
> No. That was to avoid growing the MatchState structure with the addition
> of some variables to control the complexity of the match. With that
> variables removed, the change became pointless. But it does not hurt.
> (The real limit is 32, quite far from 255...)

But what if someone wants to define LUA_MAXCAPTURES as 1000 (for
example) in luaconf.h? Would that have worked before (taking into
account return value/argument limits)? If so, why break it here?