Ticket #210 (closed bug: fixed)

Opened 5 years ago

Last modified 9 months ago

.lhs Birdtracks are removed instead of replaced

Reported by: pesco Assigned to: nobody
Priority: lowest Milestone: 6.8.1
Component: Compiler (Parser) Version: 6.2
Severity: normal Keywords:
Cc: Difficulty: Unknown
Test Case: Operating System: Unknown/Multiple
Architecture: Unknown/Multiple

Description (Last modified by igloo)

With respect to Bird-style literate programs, the
Report states in section 9.4 (p. 134) that "[t]he
program text is recovered by taking only those lines
beginning with '>', and replacing the leading '>' with
a space."
The following program seems to indicate that GHC strips
the leading '>' instead:

-----mixed.lhs-----
\begin{code}
  -- Notice two leading spaces!
  main = putStrLn "This is LaTeX-literal Haskell."
\end{code}

> main = putStrLn "This is Birdtrack-literal Haskell."
------------------------

GHC says "mixed.lhs:5: parse error on input `main'"
instead of "Multiple declarations of `Main.main'".
Inserting a second space after the '>', however, yields
the latter.

I just stumbled across this because I'm writing a
syntax highlighter and the Report only advises against
but does not forbid mixed-style literate programs.

Change History

09/04/05 06:42:08 changed by isaacdupree

Logged In: YES 
user_id=1208135

It appears that GHC removes the '>'s only after converting
tabs to spaces, though, or at least it correctly accepts this:

>       sevenSpaceCharactersBeforeThis = True
>	oneTabCharaterBeforeThis = True

and correctly rejects this:

>        eightSpaceCharactersBeforeThis = True
>	oneTabCharacterBeforeThis = True

so it does act correctly as long as only one of the styles
is used (contrary to my expectations upon reading the
bug-report, which were why I tested this).

10/13/06 06:20:34 changed by igloo

  • status changed from assigned to closed.
  • description changed.
  • os set to Unknown.
  • difficulty set to Unknown.
  • architecture set to Unknown.
  • milestone set to 6.8.
  • resolution changed from None to fixed.

I've fixed this in the HEAD. Test is read041.

11/05/07 06:57:28 changed by igloo

  • milestone changed from 6.8 branch to 6.8.1.

09/30/08 08:40:50 changed by simonmar

  • architecture changed from Unknown to Unknown/Multiple.

09/30/08 08:52:10 changed by simonmar

  • os changed from Unknown to Unknown/Multiple.