[Haddock] [haddock] #138: Malformed or missing comments in files with #line directive
haddock
haddock at projects.haskell.org
Sat Apr 14 22:59:55 BST 2012
#138: Malformed or missing comments in files with #line directive
----------------------+-----------------------------------------------------
Reporter: jmillikin | Owner:
Type: defect | Status: new
Priority: major | Milestone: 2.7.0
Version: | Resolution:
Keywords: |
----------------------+-----------------------------------------------------
Changes (by liyang):
* cc: haskell.org at liyang.hu (added)
Comment:
Likely related: I have some {{{.hsc}}} files that get expanded to
something like the following:
{{{
{-# LANGUAGE CPP #-}
module Lines where
#line 100
-- | cow.
cow :: ()
cow = ()
#line 101
-- | moo.
moo :: ()
moo = ()
}}}
Unfortunately haddock attributes both comments to {{{cow}}}. Weirder
still, removing the comment for {{{moo}}} puts it before {{{cow}}} in the
output (because both are now defined on lines 101–102?), while the comment
for {{{cow}}} is now attached to {{{moo}}}.
Wouldn't it be simpler and more predictable for haddock to just ignore any
line directives? If some arbitrary preprocessor severs a comment from its
intended target, it's a losing game to try to infer where it ought to have
gone.
--
Ticket URL: <http://trac.haskell.org/haddock/ticket/138#comment:2>
haddock <http://www.haskell.org/haddock>
Haddock, The Haskell Documentation Tool
More information about the Haddock
mailing list