[augeas-devel] Optional quotes with square lens

Raphaël Pinson raphael.pinson at camptocamp.com
Sat Oct 27 08:44:03 UTC 2012


On Sat, Oct 27, 2012 at 1:05 AM, David Lutterkort <lutter at redhat.com> wrote:

> On Fri, 2012-10-26 at 15:50 +0200, Raphaël Pinson wrote:
> > Hello,
> >
> >
> > I'm trying to use the square lens to manage entries with optional quotes:
> >
> >   let entry =
> >        let quote = del /"?/ "\""
> >     in let body = store /[^\n"]+/
> >     in let sto = square quote body quote
> >     in Build.key_value_line Rx.word Sep.space_equal sto
> >
> >
> > This works with quoted entries, but not with entries that don't have
> > quotes, such as:
> >
> >   key = value
>
> There's a bug in how the ctype for square lenses gets rewritten - it
> doesn't account for the first argument of square accepting the empty
> word, making your quote in effect del /"/ "\""
>
> I've fixed that in commit 51922f9b
>


Great, it works now. Thank you!


-- 
Raphaël Pinson
Administrateur Systèmes & Réseaux
Camptocamp France
Savoie Technolac
BP 352
48, avenue du Lac du Bourget
73372 Le Bourget du Lac, Cedex
www.camptocamp.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20121027/7ee1284a/attachment.htm>


More information about the augeas-devel mailing list