[augeas-devel] Bool parsing and overlapping lenses in tree union.put

Michal Hrušecký michal at hrusecky.net
Tue Jun 14 16:59:48 UTC 2011


Hi,

I'm trying to extend already existing lens (xorg one) to support bool
values (because some of the options expect bool values). Parsing
works, but I've got some difficulties to figure out how to fix
"overlapping lenses in tree union.put" error. My current code is:

> let true = del /([Oo]n|[Tt]rue|[Yy]es)/ "True" . value "True"
>
> let false = del /([Oo]ff|[Ff]alse|[Nn]o)/ "False" . value "False"
>
> let bool = del /"?/ "\"" . true | false . del /"?/ "\""
>
> let entry_bool (canon:string) (re:regexp) =
>       [ indent . del re canon . label canon . sep_spc . bool . eol ]

No matter how hard do I try, I don't see any overlapping between true
and false. Full error is:

$ augparse -I . ./tests/test_xorg.aug
Syntax error in lens definition
./xorg.aug:112.0-.23:Failed to compile bool
./xorg.aug:112.11-.23:exception: overlapping lenses in tree union.put
    Example matched by both:
    First lens: ./xorg.aug:108.11-.61:
    Second lens: ./xorg.aug:110.12-.65:

./tests/test_xorg.aug:40.7-.15:Could not load module Xorg for Xorg.lns
./tests/test_xorg.aug:40.7-.15:Undefined variable Xorg.lns

Where line 108 is definition of true, 110 of false and 122 of bool.

What am I overlooking? I admit that this is my first time trying to
improve some lense...

Regards,

Michal Hrusecky




More information about the augeas-devel mailing list