<div dir="ltr">What's missing in your case is [ ] around your comment definition:<div><br></div><div>    let comment (r:regexp)  = [ del r "" ]<br></div><div><br></div><div><br></div><div>This is to avoid an ambiguous tree (in the direction a → c). That said, I personally prefer to map comments in the tree, if we're going to parse them anyway.</div>
<div><br></div><div><br></div><div>Regards,</div><div><br></div><div>Raphaël</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jun 29, 2014 at 10:45 AM, Raphaël Pinson <span dir="ltr"><<a href="mailto:raphael.pinson@camptocamp.com" target="_blank">raphael.pinson@camptocamp.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">You're using a lot of /.*/, which is rarely a good idea.<div><br></div><div>Could you provide an example of a string that does not parse with the lens I provided, and the tree you expect the lens should produce from it?</div>

<div><br></div><div><br></div><div>Regards,</div><div><br></div><div>Raphaël</div><div><br></div></div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Sun, Jun 29, 2014 at 8:37 AM, Yclept Nemo <span dir="ltr"><<a href="mailto:orbisvicis@gmail.com" target="_blank">orbisvicis@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks,<br><br>Now I'm using your example as guidance since there was one additional restriction I failed to demonstrate. Unfortunately my schema generates an "ambiguous tree iteration" exception:<br>


<br>    let option              = key /[A-Z_]+/<br>    let value               = Sep.colon . Sep.opt_space . store /[^] \t\n:]+/ . Sep.opt_space<br>    let values              = counter "value" . [ seq "value" . value ] +<br>


    let setting             = [ Util.del_str "[" . option . values . Util.del_str "]" ]<br>    let comment (r:regexp)  = del r ""<br>    let entry               = <br>        let not_setting = /.*/ - ( lens_ctype setting . /.*/ )<br>


        in  setting . comment /.*/ | comment not_setting<br>    let line                = entry . Util.del_str "\n"<br>    let lns                 = line *<br><br>    given the input [1]<br><br>If I understand regex subtraction correctly, "re1 - re2" is interpreted as the set of all possible matches generated by re2 subtracted from the set of all possible matches generated by re1. However this generates massively long and complex regexes, is this possibly the root of the problem?<br>


<br>Anyway I'm grateful for your help and I apologize for responding so late and not having provided a proper example.<br><br>Sincerely,<br></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><div class="">-- <br><div dir="ltr">Raphaël Pinson<div>Infrastructure Developer & Trainer</div><div><a href="tel:%2B33%20479%2026%2057%2093" value="+33479265793" target="_blank">+33 479 26 57 93</a><div>
<a href="tel:%2B33%20781%2090%2000%2079" value="+33781900079" target="_blank">+33 781 90 00 79</a></div><div><br></div><div>Camptocamp France<br>

Savoie Technolac<br>
BP 352<br>
48, avenue du Lac du Bourget<br>
73372 Le Bourget du Lac, Cedex<br>
<a href="http://www.camptocamp.com" target="_blank">www.camptocamp.com</a><br>
</div></div></div>
</div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Raphaël Pinson<div>Infrastructure Developer & Trainer</div><div>+33 479 26 57 93<div>+33 781 90 00 79</div><div><br></div><div>Camptocamp France<br>

Savoie Technolac<br>
BP 352<br>
48, avenue du Lac du Bourget<br>
73372 Le Bourget du Lac, Cedex<br>
<a href="http://www.camptocamp.com" target="_blank">www.camptocamp.com</a><br>
</div></div></div>
</div>