Ticket #60 (new defect)

Opened 6 years ago

Last modified 5 years ago

Parser fails on same-line documentation

Reported by: ryani Owned by:
Priority: minor Milestone:
Version: Keywords:
Cc: colin@…

Description

data Empty -- ^ This datatype has no elements

gives a Haddock parse error.

These two options fix it, but both seem like they should be unnecessary:

data Empty; -- ^ This datatype has no elements
data Empty
-- ^ This datatype has no elements

Change History

  Changed 6 years ago by waern

Not technically a bug, but something we could support.

  Changed 6 years ago by waern

  • priority changed from major to minor

follow-up: ↓ 5   Changed 6 years ago by gwern

  • cc gwern0@… added

I'd just like to note that it seems that this bug is affecting XMonad; on the Darcs repo for XMonad, an attempt to build Haddock docs leads to:

XMonad/Layout.hs:55:19: parse error on input `!' haddock: Failed to check module: XMonad.Layout

The relevant lines:

data Tall a = Tall !Int -- ^ The default number of windows in the master pane (default: 1) !Rational -- ^ Default proportion of screen occupied by master pane (default: 1/2) !Rational; -- ^ Percent of screen to increment by when resizing panes (default: 3/100)

This is with Haddock 2.3.0 and reportedly 2.4.1. I believe the Haddocks used to build.

  Changed 5 years ago by colin-adams

  • cc colin@… added; gwern0@… removed
  • priority changed from minor to major

in reply to: ↑ 3   Changed 5 years ago by waern

Replying to gwern:

I'd just like to note that it seems that this bug is affecting XMonad; on the Darcs repo for XMonad, an attempt to build Haddock docs leads to: XMonad/Layout.hs:55:19: parse error on input `!' haddock: Failed to check module: XMonad.Layout The relevant lines: data Tall a = Tall !Int -- ^ The default number of windows in the master pane (default: 1) !Rational -- ^ Default proportion of screen occupied by master pane (default: 1/2) !Rational; -- ^ Percent of screen to increment by when resizing panes (default: 3/100) This is with Haddock 2.3.0 and reportedly 2.4.1. I believe the Haddocks used to build.

This is not the same problem as in the ticket description. This ticket is for documenting empty data declarations on the same line.

What you are describing is something that has never been supported by Haddock (I tried your example with Haddock 0.9 and it gave a parse error), but perhaps it could be. For that I've opened ticket #95.

A fair complaint would be that we fail with a parse error instead of giving a warning message that says that this is not supported. This is a more general problem with the parser, and for that I've filed ticket #94.

  Changed 5 years ago by waern

  • priority changed from major to minor

Changing to minor priority since you can just put the comment above or below the declaration to get around this.

Note: See TracTickets for help on using tickets.