Hi Štěpán, I guess, you should not try to match the line break twice. So something similar to the following (which I have not verified to work properly) might work better:
let eol = ws* . [ label "#comment" . del /[;#]/ ";" . store /[^\n]*/ ]? . del_str "\n" Furthermore, I guess that you try to match for comments with a ';' as well as '#', right? Then maybe you could try to use the Util.comment_generic lens, which allows you redefine the #comment node with a different regular expression? Ciao, Xavier. > -----Original Message----- > From: augeas-devel-boun...@redhat.com > [mailto:augeas-devel-boun...@redhat.com] On Behalf Of Štepán Balážik > Sent: Tuesday, March 21, 2017 6:16 PM > To: augeas-devel@redhat.com > Subject: [augeas-devel] Iterated lens leads to 'ambiguous tree iteration' > > 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 > > _______________________________________________ > augeas-devel mailing list > augeas-devel@redhat.com > https://www.redhat.com/mailman/listinfo/augeas-devel
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ augeas-devel mailing list augeas-devel@redhat.com https://www.redhat.com/mailman/listinfo/augeas-devel