<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hi,</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Sorry, that was a careless extraction of code - I should have made sure that it was complete. </div>
<div style="font-family:arial,sans-serif;font-size:13px">Please, have a look again. When downloading and running the gist (<a href="https://gist.github.com/dargosch/5955045">https://gist.github.com/dargosch/5955045</a>) , I still get the error:</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>Main&gt; let testFile = &quot;/Users/frkkan96/Documents/src/ume/umecore/testing/testdata/testdata.TextGrid&quot;</div>
<div class="im"><div>*Main&gt; parseFromFile textgridfile testFile</div><div>Left &quot;/Users/frkkan96/Documents/src/ume/umecore/testing/testdata/testdata.TextGrid&quot; (line 35, column 5):</div><div>unexpected &quot;t&quot;</div>
<div>expecting &quot;intervals [&quot;</div><div><br></div></div><div>on the attached testfile. The &quot;tier&quot; parser works once, but then I get an error that I cant understand, given the input.</div><div>How come the parser finds the &quot;unexpected &quot;t&quot;&quot; when the expected thing is what is in the input at that point?</div>
<div><br></div><div>Thankful for any help I can get on this.</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 9, 2013 at 10:22 PM, Fredrik Karlsson <span dir="ltr">&lt;<a href="mailto:dargosch@gmail.com" target="_blank">dargosch@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"><div dir="ltr">Hi,<div><br></div><div>Sorry, that was a careless extraction of code - I should have made sure that it was complete. </div>
<div>Please, have a look again. When downloading and running the gist, I still get the error:</div>
<div><br></div><div><div>Main&gt; let testFile = &quot;/Users/frkkan96/Documents/src/ume/umecore/testing/testdata/testdata.TextGrid&quot;</div><div class="im"><div>*Main&gt; parseFromFile textgridfile testFile</div><div>
Left &quot;/Users/frkkan96/Documents/src/ume/umecore/testing/testdata/testdata.TextGrid&quot; (line 35, column 5):</div>
<div>unexpected &quot;t&quot;</div><div>expecting &quot;intervals [&quot;</div><div><br></div></div><div>on the attached testfile. The &quot;tier&quot; parser works once, but then I get an error that I cant understand, given the input.</div>

<div>How come the parser finds the &quot;unexpected &quot;t&quot;&quot; when the expected thing is what is in the input at that point?</div><div><br></div><div>Thankful for any help I can get on this.</div><span class="HOEnZb"><font color="#888888">
<div><br></div><div><br></div><div>/Fredrik</div></font></span></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 9, 2013 at 9:37 AM, Roman Cheplyaka <span dir="ltr">&lt;<a href="mailto:roma@ro-che.info" target="_blank">roma@ro-che.info</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Please check your code.<br>
<br>
I had two problems with it: mixed tabs and spaces, and undefined<br>
&#39;quotedChar&#39;. After defining quotedChar = anyChar, I get a different<br>
error message from yours:<br>
<br>
  *Main&gt; parseFromFile textgridfile &quot;testdata.TextGrid&quot;<br>
  Left &quot;testdata.TextGrid&quot; (line 137, column 1):<br>
  unexpected end of input<br>
  expecting quote at end of cell<br>
<br>
Roman<br>
<br>
* Fredrik Karlsson &lt;<a href="mailto:dargosch@gmail.com" target="_blank">dargosch@gmail.com</a>&gt; [2013-07-09 08:07:24+0200]<br>
<div><div>&gt; Hi Roman,<br>
&gt;<br>
&gt; I&#39;m using parsec-3.1.3<br>
&gt;<br>
&gt; I put the code in a gist here - sorry about that.<br>
&gt;<br>
&gt; <a href="https://gist.github.com/dargosch/5955045" target="_blank">https://gist.github.com/dargosch/5955045</a><br>
&gt;<br>
&gt; Fredrik<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Jul 9, 2013 at 12:08 AM, Roman Cheplyaka &lt;<a href="mailto:roma@ro-che.info" target="_blank">roma@ro-che.info</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; Hi Fredrik,<br>
&gt; &gt;<br>
&gt; &gt; First, do you use the latest parsec version (3.1.3)? If not, can you try<br>
&gt; &gt; the same with 3.1.3?<br>
&gt; &gt;<br>
&gt; &gt; Second, please upload your code to <a href="http://hpaste.org" target="_blank">hpaste.org</a> or a similar service and<br>
&gt; &gt; give us the link. It&#39;s not much fun to extract code from an html email.<br>
&gt; &gt;<br>
&gt; &gt; Roman<br>
&gt; &gt;<br>
&gt; &gt; * Fredrik Karlsson &lt;<a href="mailto:dargosch@gmail.com" target="_blank">dargosch@gmail.com</a>&gt; [2013-07-08 23:54:17+0200]<br>
&gt; &gt; &gt; Dear list,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I have a Parsec parser that fails and gives the following error message:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; *Main&gt; parseFromFile textgridfile testFile<br>
&gt; &gt; &gt; Left<br>
&gt; &gt; &gt;<br>
&gt; &gt; &quot;/Users/frkkan96/Documents/src/ume/umecore/testing/testdata/testdata.TextGrid&quot;<br>
&gt; &gt; &gt; (line 35, column 5):<br>
&gt; &gt; &gt; unexpected &quot;t&quot;<br>
&gt; &gt; &gt; expecting &quot;intervals [&quot;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Now, this is perfectly understandable, but line 35, col 5 in the file<br>
&gt; &gt; being<br>
&gt; &gt; &gt; parsed looks like the supplies image - there is no &#39;t&#39; there.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Any ideas on what is going on?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; The parser I am using is:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; data VariableLine = VariableLine String String deriving Show<br>
&gt; &gt; &gt; data TierType = IntervalTier | PointTier deriving Show<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; data Tier = Tier String deriving Show<br>
&gt; &gt; &gt; data LabelFile = LabelFile Double Double deriving Show<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; data Label = Label String TierType Double Double String deriving Show<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; haskelldef = makeTokenParser haskellDef<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; textgridfile :: Parser (LabelFile, [[Label]])<br>
&gt; &gt; &gt; textgridfile = do<br>
&gt; &gt; &gt; h &lt;- header<br>
&gt; &gt; &gt; ll &lt;- many1 tier<br>
&gt; &gt; &gt; return $ (h,ll)<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; header :: Parser LabelFile<br>
&gt; &gt; &gt; header = do<br>
&gt; &gt; &gt; string headTS1<br>
&gt; &gt; &gt; start &lt;- try (float haskelldef)<br>
&gt; &gt; &gt; &lt;|&gt; (fmap fromInteger $ integer haskelldef )<br>
&gt; &gt; &gt; string &quot;xmax = &quot;<br>
&gt; &gt; &gt; end &lt;- try (float haskelldef)<br>
&gt; &gt; &gt; &lt;|&gt; (fmap fromInteger $ integer haskelldef )<br>
&gt; &gt; &gt; string &quot;tiers? &lt;exists&gt; \n&quot;<br>
&gt; &gt; &gt; string &quot;size = &quot;<br>
&gt; &gt; &gt; integer haskelldef<br>
&gt; &gt; &gt; string &quot;item []:&quot;<br>
&gt; &gt; &gt; whiteSpace haskelldef<br>
&gt; &gt; &gt; return $ LabelFile start end<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; tier :: Parser [Label]<br>
&gt; &gt; &gt; tier = do<br>
&gt; &gt; &gt; whiteSpace haskelldef<br>
&gt; &gt; &gt; string &quot;item [&quot;<br>
&gt; &gt; &gt; integer haskelldef<br>
&gt; &gt; &gt; string &quot;]:&quot;<br>
&gt; &gt; &gt; whiteSpace haskelldef<br>
&gt; &gt; &gt; try (string &quot;class = \&quot;IntervalTier\&quot;&quot;)<br>
&gt; &gt; &gt; &lt;|&gt; string &quot;class = \&quot;TextTier\&quot;&quot;<br>
&gt; &gt; &gt; whiteSpace haskelldef<br>
&gt; &gt; &gt; string &quot;name = &quot;<br>
&gt; &gt; &gt; char &#39;&quot;&#39;<br>
&gt; &gt; &gt; name &lt;- many quotedChar<br>
&gt; &gt; &gt; char &#39;&quot;&#39; &lt;?&gt; &quot;quote at end of cell&quot;<br>
&gt; &gt; &gt; whiteSpace haskelldef<br>
&gt; &gt; &gt; string &quot;xmin = &quot;<br>
&gt; &gt; &gt; try (float haskelldef) &lt;|&gt; (fmap fromInteger $ integer haskelldef )<br>
&gt; &gt; &gt; whiteSpace haskelldef<br>
&gt; &gt; &gt; string &quot;xmax = &quot;<br>
&gt; &gt; &gt; try (float haskelldef) &lt;|&gt; (fmap fromInteger $ integer haskelldef )<br>
&gt; &gt; &gt; string &quot;intervals: size = &quot; &lt;|&gt; string &quot;points: size = &quot;<br>
&gt; &gt; &gt; integer haskelldef<br>
&gt; &gt; &gt; whiteSpace haskelldef<br>
&gt; &gt; &gt; labelList &lt;- many1 (interval name)<br>
&gt; &gt; &gt; return $ labelList<br>
&gt; &gt; &gt; interval :: String -&gt; Parser Label<br>
&gt; &gt; &gt; interval tierName = do<br>
&gt; &gt; &gt; whiteSpace haskelldef<br>
&gt; &gt; &gt; string &quot;intervals [&quot;<br>
&gt; &gt; &gt; integer haskelldef<br>
&gt; &gt; &gt; string &quot;]:&quot;<br>
&gt; &gt; &gt; whiteSpace haskelldef<br>
&gt; &gt; &gt; string &quot;xmin = &quot;<br>
&gt; &gt; &gt; start &lt;- try (float haskelldef)<br>
&gt; &gt; &gt; &lt;|&gt; (fmap fromInteger $ integer haskelldef )<br>
&gt; &gt; &gt; whiteSpace haskelldef<br>
&gt; &gt; &gt; string &quot;xmax = &quot;<br>
&gt; &gt; &gt; end &lt;- try (float haskelldef)<br>
&gt; &gt; &gt; &lt;|&gt; (fmap fromInteger $ integer haskelldef )<br>
&gt; &gt; &gt; whiteSpace haskelldef<br>
&gt; &gt; &gt; string &quot;text = &quot;<br>
&gt; &gt; &gt; char &#39;&quot;&#39;<br>
&gt; &gt; &gt; text &lt;- many quotedChar<br>
&gt; &gt; &gt; char &#39;&quot;&#39; &lt;?&gt; &quot;quote at end of cell&quot;<br>
&gt; &gt; &gt; return $ Label tierName IntervalTier start end text<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; which fails on the attached input file.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I can&#39;t see how &#39;t&#39; is found?? What am I doing wrong?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; /Fredrik<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; --<br>
&gt; &gt; &gt; &quot;Life is like a trumpet - if you don&#39;t put anything into it, you don&#39;t<br>
&gt; &gt; get<br>
&gt; &gt; &gt; anything out of it.&quot;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; Haskell-Cafe mailing list<br>
&gt; &gt; &gt; <a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
&gt; &gt; &gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; &quot;Life is like a trumpet - if you don&#39;t put anything into it, you don&#39;t get<br>
&gt; anything out of it.&quot;<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>&quot;Life is like a trumpet - if you don&#39;t put anything into it, you don&#39;t get anything out of it.&quot;
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>&quot;Life is like a trumpet - if you don&#39;t put anything into it, you don&#39;t get anything out of it.&quot;
</div>