<br><br><div class="gmail_quote">On Fri, Jul 11, 2008 at 12:41 AM, David Lutterkort <<a href="mailto:lutter@watzmann.net">lutter@watzmann.net</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Thu, 2008-07-10 at 12:33 +0200, Raphaël Pinson wrote:<br>
> I'm trying to work on the following file, but I get :<br>
><br>
> bbwarnrules.aug:45.4-.43:Failed to compile lns<br>
> bbwarnrules.aug:45.14-.43:exception: ambiguous tree iteration<br>
>       'host/host/' can be split into<br>
>       'host/|=|host/'<br>
><br>
>      and<br>
>       'host/host/|=|'<br>
><br>
>     Iterated lens: bbwarnrules.aug:45.16-.40<br>
><br>
> bbwarnrules.aug: error: Loading failed<br>
<br>
</div>The error message says 'If I see a tree that has two "host" nodes next<br>
to each other, I get confused' (note that it says 'tree iteration') -<br>
this error message is about the 'put' direction from tree back to the<br>
file.<br>
<div class="Ih2E3d"><br>
>     let record  = notmark? .<br>
>                        host . ( sep_spc . host )*                    .<br>
> semi_col .<br>
>                        ([ label "exhosts"    . value_to_semi_col ])? .<br>
> semi_col .<br>
>                        ([ label "services"   . value_to_semi_col ])? .<br>
> semi_col .<br>
>                        ([ label "exservices" . value_to_semi_col ])? .<br>
> semi_col .<br>
>                        ([ label "day"        . value_to_semi_col ])? .<br>
> semi_col .<br>
>                        ([ label "time"       . value_to_semi_col ])? .<br>
> semi_col .<br>
>                        ([ label "recipients" . value_to_eol      ])?<br>
>                   . eol_no_spc<br>
><br>
>     (* Define lens *)<br>
><br>
>     let lns = ( comment | empty | record )*<br>
<br>
</div>The problem is that a tree with two adjacent host nodes can either be<br>
processed as one 'record' that has two hosts or as two 'record'<br>
instances with one host each, i.e. in the first case the correct output<br>
would be<br>
        host1 host2<br>
whereas in the second, the correct output would be<br>
        host1<br>
        host2<br>
(since record ends with a eol_no_spc) </blockquote><div><br><br><br>What I don't really get is that I think I specify a record as something that looks like <br>! myhost;a;b;c;d;e;f<br><br>or <br><br>myhost;a;b;c;d;e;f<br>
<br>as in, there _must_ be semi-colons on each record line, so a line like 'host/host/' is just not possible in this lens. Am I missing something to specify this ?<br><br><br><br>Raphaël<br><br></div></div><br>