[augeas-devel] Optional quotes with square lens

David Lutterkort lutter at redhat.com
Fri Oct 26 23:05:40 UTC 2012


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

David





More information about the augeas-devel mailing list