[GHC] #10537: Parser: commas_tup_tail returns spurious "Missing" value

Alan & Kim Zimmerman alan.zimm at gmail.com
Wed Jun 17 15:21:53 UTC 2015


So it appears the `Missing` item is correct, but it has been given the
wrong SrcSpan. Originally it was a `noLoc`.

I think I will just advance the column by one, then it is actually correct,
and the annotation lookup will only succeed for the first one, so it will
all just work.

On Wed, Jun 17, 2015 at 5:14 PM, GHC <ghc-devs at haskell.org> wrote:

> #10537: Parser: commas_tup_tail returns spurious "Missing" value
> -------------------------------------+-------------------------------------
>         Reporter:  alanz             |                   Owner:  alanz
>             Type:  bug               |                  Status:  new
>         Priority:  normal            |               Milestone:  7.10.2
>        Component:  Compiler          |                 Version:  7.10.1
>   (Parser)                           |                Keywords:
>       Resolution:                    |            Architecture:
> Operating System:  Unknown/Multiple  |  Unknown/Multiple
>  Type of failure:  None/Unknown      |               Test Case:
>       Blocked By:                    |                Blocking:
>  Related Tickets:                    |  Differential Revisions:
> -------------------------------------+-------------------------------------
>
> Comment (by mpickering):
>
>  I think you're right Simon. There is something wrong with the annotations
>  though, firstly both the Missing elements have the same SrcSpan `L
>  tests/examples/Tuple.hs:3:24`.
>
>  {{{
>   ((tests/examples/Tuple.hs:3:8, AnnComma),
>     [tests/examples/Tuple.hs:3:9]),
>    ((tests/examples/Tuple.hs:3:11-17, AnnComma),
>     [tests/examples/Tuple.hs:3:18]),
>    ((tests/examples/Tuple.hs:3:20-22, AnnComma),
>     [tests/examples/Tuple.hs:3:23]),
>    ((tests/examples/Tuple.hs:3:24, AnnComma),
>     [tests/examples/Tuple.hs:3:24]),
>  }}}
>
>  Here are the relevant annotations. Notice how the first three commas are
>  associated with the preceding item (much like they are for lists) but the
>  last one is associated directly with the `Missing`. As both `Missing`s
>  have the same SrcSpan then this is causing duplicated output in `ghc-
>  exactprint`.
>
> --
> Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10537#comment:2>
> GHC <http://www.haskell.org/ghc/>
> The Glasgow Haskell Compiler
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20150617/b4a6bda8/attachment.html>


More information about the ghc-devs mailing list