Actually, what if I wanted to allow spaces in the value, but only if it is surrounded by quotes?<br><br>I've tried this:<br><br>let entry =<br>     let lquote = del /("[\t ]*)?/ "\""<br>  in let rquote = del /([\t ]*")?/ "\""<br>
  in let body = store /[^\n\t "]([^\n"]*[^\n\t "])?/<br>  in let sto = square lquote body rquote<br>  in Build.key_value_line Rx.word Sep.space_equal sto<br><br><br>but augparse says:<br><br>lenses/vmware_config.aug:28.15-.40:exception: Inconsistency in lens square<br>
<br><br>I guess the problem is that opening and closing quotes should match, which doesn't make sense if the spaces are included in them… Is there a way to do this?<br><br><br>Raphaël<br><br><div class="gmail_quote">On Sat, Oct 27, 2012 at 10:44 AM, Raphaël Pinson <span dir="ltr"><<a href="mailto:raphael.pinson@camptocamp.com" target="_blank">raphael.pinson@camptocamp.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br><div class="gmail_quote"><div><div class="h5">On Sat, Oct 27, 2012 at 1:05 AM, David Lutterkort <span dir="ltr"><<a href="mailto:lutter@redhat.com" target="_blank">lutter@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Fri, 2012-10-26 at 15:50 +0200, Raphaël Pinson wrote:<br>
> Hello,<br>
><br>
><br>
> I'm trying to use the square lens to manage entries with optional quotes:<br>
><br>
>   let entry =<br>
>        let quote = del /"?/ "\""<br>
>     in let body = store /[^\n"]+/<br>
>     in let sto = square quote body quote<br>
>     in Build.key_value_line Rx.word Sep.space_equal sto<br>
><br>
><br>
> This works with quoted entries, but not with entries that don't have<br>
> quotes, such as:<br>
><br>
>   key = value<br>
<br>
</div>There's a bug in how the ctype for square lenses gets rewritten - it<br>
doesn't account for the first argument of square accepting the empty<br>
word, making your quote in effect del /"/ "\""<br>
<br>
I've fixed that in commit 51922f9b<br></blockquote></div></div><div><br><br>Great, it works now. Thank you!<br><br clear="all"></div></div><div class="HOEnZb"><div class="h5"><br>-- <br>Raphaël Pinson<br>Administrateur Systèmes & Réseaux<br>

Camptocamp France<br>
Savoie Technolac<br>
BP 352<br>
48, avenue du Lac du Bourget<br>
73372 Le Bourget du Lac, Cedex<br>
<a href="http://www.camptocamp.com" target="_blank">www.camptocamp.com</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Raphaël Pinson<br>Administrateur Systèmes & Réseaux<br>
Camptocamp France<br>
Savoie Technolac<br>
BP 352<br>
48, avenue du Lac du Bourget<br>
73372 Le Bourget du Lac, Cedex<br>
<a href="http://www.camptocamp.com" target="_blank">www.camptocamp.com</a><br>
<br>