<div dir="ltr">OK, thanks Ian. Using pragState on only the pragma line gives me the proper token types, but on the whole Haskell input it fails, obviously I need to combine the two lexer states to get the full lexing, but I can achieve what I want anyway, I just wanted to understand.<div>
<br></div><div>Thank you</div><div><br></div><div style>JP</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Dec 29, 2012 at 12:15 PM, Ian Lynagh <span dir="ltr">&lt;<a href="mailto:igloo@earth.li" target="_blank">igloo@earth.li</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Sat, Dec 29, 2012 at 11:24:23AM +0100, JP Moresmau wrote:<br>
&gt;<br>
&gt;                 let prTS = lexTokenStream sb lexLoc flg<br>
&gt;<br>
</div><div class="im">&gt; This prints:<br>
&gt; [&quot;ITblockComment \&quot; CPP #\&quot;&quot;,&quot;ITmodule&quot;,&quot;ITconid<br>
&gt; \&quot;Main\&quot;&quot;,&quot;ITwhere&quot;,&quot;ITvocurly&quot;,&quot;ITvarid \&quot;main\&quot;&quot;,&quot;ITequal&quot;,&quot;ITvarid<br>
&gt; \&quot;undefined\&quot;&quot;]<br>
&gt;<br>
&gt; Why is the first token ITblockComment and not ITlanguage_prag? Do I need to<br>
&gt; enable something special to get pragma tokens?<br>
<br>
</div>lexTokenStream uses mkPState, but I think you need to use pragState to<br>
get the language pragmas. (see Lexer.x).<br>
<br>
<br>
Thanks<br>
<span class="HOEnZb"><font color="#888888">Ian<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>JP Moresmau<br><a href="http://jpmoresmau.blogspot.com/">http://jpmoresmau.blogspot.com/</a>
</div>