[GHC] #3549: unlit does not follow H98 spec

GHC ghc-devs at haskell.org
Fri Apr 18 08:41:15 UTC 2014


#3549: unlit does not follow H98 spec
-------------------------------------+------------------------------------
        Reporter:  duncan            |            Owner:
            Type:  bug               |           Status:  new
        Priority:  normal            |        Milestone:  ⊥
       Component:  Compiler          |          Version:  6.10.4
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by mgsloan1):

 Figured I'd unearth this ticket to add a few notes, since I was recently
 looking into how ghc's lhs support behaves.  I found some additional
 quirks:

 * It's valid to add trailing whitespace after `\begin{code}` or
 `\end{code}`.  I think that's due to this line:
 https://github.com/ghc/ghc/blob/master/utils/unlit/unlit.c#L224

 * It's valid to indent `\begin{code}`, but not `\end{code}`.
   I think the whitespace before `\begin{code}` is consumed by
 https://github.com/ghc/ghc/blob/master/utils/unlit/unlit.c#L214 .
   `\end{code}`, on the other hand is recognized by strncmp:
 https://github.com/ghc/ghc/blob/master/utils/unlit/unlit.c#L276

 RE igloo's comment, I agree that unlit should not need to know that
 `\end{code}` is inside a string literal.  It's unreasonable to mix up
 tokenization and unlit like that, particularly when you consider writing
 tools external to ghc.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/3549#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list