Hello<br><br>Thanks for the quick help with this. I thought about the idea that lookAhead might be the cause of the <br>positioning bug but then discarded that idea because I thought lookAhead should never lead to an error<br>
past wherever the input position is now considering it doesn&#39;t consume any input.<br><br>I am aware of the issue with the error message position and the output, I was still working on improving<br>that when I was puzzled by the fact that the error message I specified wasn&#39;t even returned to me.<br>
<br>As for try, I believe I need it to make sure the input I consume one character at the time, before I know<br>if I will reach another valid match (or any at all) does not stay consumed when my parser fails.<br><br>I am still very much in the experimental phase as far as writing Parsec combinators beyond very simple<br>
stuff is concerned so I am open for suggestions on how to improve it in a way that doesn&#39;t need &quot;try&quot;.<br><br>Thanks again for all the help and especially for the patch. After applying it I do get the error message I<br>
specified.<br><br>I noticed there are still some other problems in the code. In particular it doesn&#39;t work as intended in cases<br>like this one:<br><br>parseTest (do; r1 &lt;- anyOf [&quot;Hello&quot;, &quot;Hallo&quot;, &quot;Foo&quot;, &quot;HallofFame&quot;]; r2 &lt;- string &quot;fbla&quot;; return (r1, r2)) &quot;Hallofbla&quot;<br>
<br>where it should (according to my goal) return no parse error but instead accept &quot;Hallo&quot; and allow the string parser<br>to consume the rejected suffix but I will try to fix that.<br><br>Matthias Hoermann<br><br>