[Haskell-cafe] Parsing pragmas in a Haskell-like language

Björn Peemöller bjp at informatik.uni-kiel.de
Thu Aug 16 12:13:20 CEST 2012


Dear cafe,

I'm experimenting with extending the parser for a Haskell-like language
by module pragmas. The parser is written using parser combinators.

Currently, I adapted the lexer to ignore whitespace and comments, but
create lexemes for both the pragma start and end (and the pragma's
content, of course). While these lexemes are necessary for parsing the
pragmas before the module header, they somehow should be ignored
(treated like comments) afterwards.

Could anyone give me a hint me how this behaviour (treat pragmas like
comments) is achieved in GHC or in haskell-src-exts?

Thanks in advance,
Björn



More information about the Haskell-Cafe mailing list