The only pre-processing is what's caused by using the cabal directive "Extensions: CPP". Using "./setup haddock --verbose ...", I get lines like<br><br><div style="margin-left: 40px;"><span style="font-family: courier new,monospace;">
c:\ghc\ghc-6.6\bin\ghc.exe -E -cpp -optP-P -o dist\build\tmp\src\Graphics\UI\TV\Input.hs src\Graphics\UI\TV\Input.hs -Dmingw32_BUILD_OS -Dmingw32_HOST_OS -Di386_BUILD_ARCH -Di386_HOST_ARCH -D__GLASGOW_HASKELL__=606 -D__HADDOCK__
</span><br></div><br>When I try this preprocessing myself, I find that I *do not* get the Haskell line pragma:<br><br><div style="margin-left: 40px;"><span style="font-family: courier new,monospace;">bash-3.2$ ghc -E -cpp -optP-P -o z src/Graphics/UI/TV/Input.hs -Dmingw32_BUILD_OS -Dmingw32_HOST_OS -Di386_BUILD_ARCH -Di386_HOST_ARCH -D__GLASGOW_HASKELL__=606 -D__HADDOCK__; head -3 z
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">{-# OPTIONS -fglasgow-exts -cpp #-}</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">----------------------------------------------------------------------</span><br></div><br>Fiddling with flags, I see that -optP-P is the culprit. Removing it:<br><br><div style="margin-left: 40px;">
<span style="font-family: courier new,monospace;">bash-3.2$ ghc -E -cpp -o z src/Graphics/UI/TV/Input.hs -Dmingw32_BUILD_OS -Dmingw32_HOST_OS -Di386_BUILD_ARCH -Di386_HOST_ARCH -D__GLASGOW_HASKELL__=606 -D__HADDOCK__; head -3 z
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"># 1 "src/Graphics/UI/TV/Input.hs"</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
# 1 "<built-in>"</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"># 1 "<command line>"</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">bash-3.2$ </span><br></div><br>Any ideas? - Conal<br><br><div><span class="gmail_quote">On 1/9/07, <b class="gmail_sendername">Duncan Coutts</b> <<a href="mailto:duncan.coutts@worc.ox.ac.uk">
duncan.coutts@worc.ox.ac.uk</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">(oops, I meant to reply to the list as well as to Conal)
<br><br>On Mon, 2007-01-08 at 22:26 -0800, Conal Elliott wrote:<br>> I pre-process my source code before handing to haddock. The %{FILE}<br>> directive for --source-comments etc uses the actual preprocessed file<br>
> name rather than the the original, which is not what I want. Is this<br>> just an oversight?<br><br>If your pre-processor uses the C or Haskell line pragmas then haddock<br>(as of version 0.8) will know the original file name and the links to
<br>source will work (I've tested it).<br><br>So the question is, what pre-processor are you using, and how can we<br>persuade it to emit C or Haskell line pragmas. cpp can do it, as can<br>cpphs, hsc2hs, c2hs, alex, happy etc.
<br><br>It may be that they don't all do it by default at the moment, or that<br>Cabal doesn't instruct them to do it by default. Previous versions of<br>haddock didn't cope with C style line pragmas iirc so I think they used
<br>to be disabled for cpp/cpphs.<br><br>Duncan<br><br><br>_______________________________________________<br>Libraries mailing list<br><a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/libraries">
http://www.haskell.org/mailman/listinfo/libraries</a><br></blockquote></div><br>