<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"><<a href="mailto:igloo@earth.li" target="_blank">igloo@earth.li</a>></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>
><br>
> let prTS = lexTokenStream sb lexLoc flg<br>
><br>
</div><div class="im">> This prints:<br>
> ["ITblockComment \" CPP #\"","ITmodule","ITconid<br>
> \"Main\"","ITwhere","ITvocurly","ITvarid \"main\"","ITequal","ITvarid<br>
> \"undefined\""]<br>
><br>
> Why is the first token ITblockComment and not ITlanguage_prag? Do I need to<br>
> 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>