[Yhc] Yhc and Haskell pragmas

Neil Mitchell ndmitchell at gmail.com
Sun Mar 9 13:43:25 EDT 2008


Hi Dimitry,

>  OK, I see where it is, and even though all calls to parsePragma are
>  commented out, the only one that would be recognized was
>  "YHC_OPTIONS".

Yes, I added support for that a while back - but I'm not sure if I
even used the parsers that are in there or not. The YHC_OPTIONS one
can only be read from the start of the file.

>  The way I am going to use it is to grep the source for specific
>  regexp, and then build the backend's command line accordingly.

If all you want is a small amount of information, why not make it a
flag, then they can write:

{-# OPTIONS_YHC --javascript-backend-commandline=whatever_info_here #-}

At the top of the file, and you won't have to modify anything in the
parser, only in the Flags module.

>  So I think that using pragma names starting with any other prefix than
>  "YHC_" won't cause any conflict in the future, will it?

Yeah, any YHC_ pragma is pretty much ours to play with.

Thanks

Neil


More information about the Yhc mailing list