cvs commit: fptools/ghc/utils/hs2c Main.hs
qrczak@glass.cse.ogi.edu
qrczak@glass.cse.ogi.edu
Wed, 1 Nov 2000 06:26:08 -0800
qrczak 2000/11/01 06:26:07 PST
Modified files: (Branch: before-ghci-branch)
ghc/utils/hs2c Main.hs
Log:
Somebody might want to combine literate programming with hsc
preprocessing. This almost worked, but until now the preprocessor
expected extension .hsc on input and always produced a file with
extension .hs. So I am changing the extension game:
Input file name should end with "c". The output will have the "c"
removed. In particular Foo.hsc is transformed into Foo.hs and
Foo.lhsc into Foo.lhs.
When C wrappers are used inside, additional files are produced, with
the final "c" changed into "c.h" and "c.c". E.g.
Foo.hsc -> Foo.hs, Foo.hsc.h, Foo.hsc.c
(previously they were Foo_hsc.{h,c}).
Better suggestions are welcome. There is currently no -o option
because up to three files may be produced and it is not clear how
their names should be derived from one -o option.
Some another preprocessor is free to use an analogous scheme, as long
as it uses a different suffix than "c". Then it can be combined with
hsc in any order, given appropriate Makefile rules.
Revision Changes Path
1.1.2.2 +9 -9 fptools/ghc/utils/hs2c/Attic/Main.hs