[augeas-devel] Iterated lens leads to 'ambiguous tree iteration'

Štěpán Balážik stepan.balazik at nic.cz
Tue Mar 21 17:16:14 UTC 2017


Hi,

While writing a lens for Deckard tests 
(https://gitlab.labs.nic.cz/knot/deckard) I ran into a problem.

This lens

     let eol = ws . ((del /[;#]/ ";" . [label "#comment" . store /[^\n]*/]
               . del_str "\n") | (del_str "\n"))* . del_str "\n"

results in this error:

     $ augparse /usr/share/augeas/lenses/dist/deckard.aug
     Syntax error in lens definition
     /usr/share/augeas/lenses/dist/deckard.aug:22.0-.119:Failed to 
compile eol
/usr/share/augeas/lenses/dist/deckard.aug:22.15-.104:exception: 
ambiguous tree iteration
       Iterated regexp: /     { /#comment/ = /[^\001-\004\n]*/ }
       | ()/
       ' { "#comment" }' can be split into
       '|=| { "#comment" }'

      and
       ' { "#comment" }|=|'

     Iterated lens: /usr/share/augeas/lenses/dist/deckard.aug:22.15-.102:

I can't get my head around the notation of Augeas' `tree -> plaintext` 
exception notation so I have no idea what is `augparse` trying to say.

Can anyone help me with an explanation or a fix for the lens?

Thanks for tips and help,

Štěpán




More information about the augeas-devel mailing list