[Yhc] Yhc and Haskell pragmas
Malcolm Wallace
Malcolm.Wallace at cs.york.ac.uk
Mon Feb 11 11:39:58 EST 2008
"Dimitry Golubovsky" <golubovsky at gmail.com> wrote:
> Does Yhc currently recognize any pragmas in GHC format {-# PRAGMA-NAME
> parameters #-} or any other format?
The format {-# PRAGMA-NAME parameters #-} is defined by the Haskell'98
standard. There is a certain amount of basic support already in the
parser: grep for "Pragma" in compiler/Parser/*.hs, and you will see that
the parser knows what they look like, and can store them in a DeclAnnot
constructor of the AST. However, no location in the grammar actually
calls parsePragma at the moment.
One needs to decide exactly where in the tree a pragma is valid (e.g.
anywhere a Decl would be valid?). Then they need to be plumbed right
through to where you need them.
Regards,
Malcolm
More information about the Yhc
mailing list