Pragmas in Lexer
JP Moresmau
jpmoresmau at gmail.com
Sat Dec 29 12:26:28 CET 2012
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.
Thank you
JP
On Sat, Dec 29, 2012 at 12:15 PM, Ian Lynagh <igloo at earth.li> wrote:
> On Sat, Dec 29, 2012 at 11:24:23AM +0100, JP Moresmau wrote:
> >
> > let prTS = lexTokenStream sb lexLoc flg
> >
> > This prints:
> > ["ITblockComment \" CPP #\"","ITmodule","ITconid
> > \"Main\"","ITwhere","ITvocurly","ITvarid \"main\"","ITequal","ITvarid
> > \"undefined\""]
> >
> > Why is the first token ITblockComment and not ITlanguage_prag? Do I need
> to
> > enable something special to get pragma tokens?
>
> lexTokenStream uses mkPState, but I think you need to use pragState to
> get the language pragmas. (see Lexer.x).
>
>
> Thanks
> Ian
>
>
--
JP Moresmau
http://jpmoresmau.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20121229/45653ff3/attachment.htm>
More information about the Glasgow-haskell-users
mailing list