Hi Matthias,<br><br><div class="gmail_quote">On Wed, May 30, 2012 at 1:36 PM, Matthias Hörmann <span dir="ltr">&lt;<a href="mailto:mhoermann@gmail.com" target="_blank">mhoermann@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
parseTest (do; r1 &lt;- anyOf [&quot;Hello&quot;, &quot;Hallo&quot;, &quot;Foo&quot;, &quot;HallofFame&quot;]; r2 &lt;- string &quot;bla&quot;; return (r1, r2)) &quot;Hallofbla&quot;<br>


<br>which prints this:<br><br>parse error at (line 1, column 8):unknown parse error<br><br>And my question about this is made up of two parts<br><br>1. Why doesn&#39;t it print my &quot;unexpected&quot; message but instead says unknown parse error<br>



2. Why is the location in the text off (I would expect it to fail at 
column 6 (first character beyond the result it could return) or 7 (first
 character that makes the string no prefix of any acceptable string)<br></blockquote><div><br></div><div>What version of parsec 3 are you using? In version 3.1.1, I get (using Text.Parsec.String instead of Text.Parsec.Text):</div>
<div><br></div><div><div>parse error at (line 1, column 1):</div><div>unexpected &quot;Hallofb&quot;, expecting one of [&quot;Hello&quot;,&quot;Hallo&quot;,&quot;Foo&quot;,&quot;HallofFame&quot;]</div></div><div><br></div>
<div>which is what I would have expected, bearing in mind that &#39;try p&#39; pretends that it hasn&#39;t consumed input when &#39;p&#39; fails.</div><div><br></div><div>I don&#39;t think you need to use &#39;try&#39; in your &#39;anyOf&#39; function, but you&#39;ll have to change it to handle seeing the end of input if the one-character look-ahead fails.</div>
<div><br></div><div>Kevin</div><div>-- </div></div>Kevin Charter<br><a href="mailto:kevin.charter@acm.org">kevin.charter@acm.org</a><br>