On Mon, 30 Jan 2017 08:37:16 +0100 Willy Tarreau <w...@1wt.eu> wrote:
> Hi Thierry, > > On Sat, Jan 28, 2017 at 09:38:13AM +0100, thierry.fourn...@arpalert.org wrote: > > >From dc3695a41af3d3a77681cec0ba23005d0370fc07 Mon Sep 17 00:00:00 2001 > > From: Thierry FOURNIER <thierry.fourn...@ozon.io> > > Date: Sat, 28 Jan 2017 08:33:08 +0100 > > Subject: [PATCH 1/2] BUG/MINOR: lua: Map.end are not reliable because "end" > > is a reserved keyword > > > > This patch change the names prefixing it by a "_". So "end" becomes "_end". > > The backward compatibility with names without the prefix "_" is assured. > > In other way, another the keyword "end" can be used like this: Map['end']. > > > > Thanks Robin H. Johnson for the bug repport > > > > This should be backported in version 1.6 and 1.7 > > Thanks for doing this, I think it's the right way to address it. Do you think > there is a way to emit a warning when the deprecated names are used ? That > would be nice for next version, though it's not critical. I don't known. I dont think that it is possible. I don't think that Lua can hook some object / function during parsing for sending warnings. I hesitate to mention the deprecated in the documentation, but, finally I don't. > I noticed a typo below, I'll try to think about fixing it by hand when > applying it : > > > +.. js:attribute:: Map._ip > > > > See the HAProxy configuration.txt file, chapter "Using ACLs and fetching > > samples" ans subchapter "ACL basics" to understand this pattern matching > > method. > > > > -.. js:attribute:: Map.str > > + Note that :js:attr:`Map.p` is also available for compatibility. > > That's "Map.ip". Ok, do you want another patch. Thierry