[GHC] #10537: Parser: commas_tup_tail duplicate SrcSpan on "Missing" value (was: Parser: commas_tup_tail returns spurious "Missing" value)

GHC ghc-devs at haskell.org
Wed Jun 17 18:16:56 UTC 2015


#10537: Parser: commas_tup_tail duplicate SrcSpan on "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:
-------------------------------------+-------------------------------------
Description changed by alanz:

Old description:

> Parsing
>
> {{{#!hs
> {-# LANGUAGE TupleSections #-}
>
> baz = (1, "hello", 6.5,,) 'a' (Just ())
> }}}
>
> Results in the following AST fragment
>
> {{{
> (L tests/examples/Tuple.hs:3:7-25
>    (ExplicitTuple
>       [ L tests/examples/Tuple.hs:3:8
>           (Present
>              (L tests/examples/Tuple.hs:3:8
>                 (HsOverLit
>                    (OverLit
>                       (HsIntegral [ '1' ] 1)
>                       PlaceHolder
>                       (HsLit
>                          (HsString
>                             []
>                             {abstract:FastString}))
>                       PlaceHolder))))
>       , L tests/examples/Tuple.hs:3:11-17
>           (Present
>              (L tests/examples/Tuple.hs:3:11-17
>                 (HsLit
>                    (HsString
>                       [ '"'
>                       , 'h'
>                       , 'e'
>                       , 'l'
>                       , 'l'
>                       , 'o'
>                       , '"'
>                       ]
>                       {abstract:FastString}))))
>       , L tests/examples/Tuple.hs:3:20-22
>           (Present
>              (L tests/examples/Tuple.hs:3:20-22
>                 (HsOverLit
>                    (OverLit
>                       (HsFractional
>                          (FL
>                             [ '6' , '.' , '5' ]
>                             (:% 13 2)))
>                       PlaceHolder
>                       (HsLit
>                          (HsString
>                             []
>                             {abstract:FastString}))
>                       PlaceHolder))))
>       , L tests/examples/Tuple.hs:3:24
>           (Missing PlaceHolder)
>       , L tests/examples/Tuple.hs:3:24
>           (Missing PlaceHolder)
>       ]
> }}}
>
> The final `Missing PlaceHolder` is duplicated

New description:

 Parsing

 {{{#!hs
 {-# LANGUAGE TupleSections #-}

 baz = (1, "hello", 6.5,,) 'a' (Just ())
 }}}

 Results in the following AST fragment

 {{{
 (L tests/examples/Tuple.hs:3:7-25
    (ExplicitTuple
       [ L tests/examples/Tuple.hs:3:8
           (Present
              (L tests/examples/Tuple.hs:3:8
                 (HsOverLit
                    (OverLit
                       (HsIntegral [ '1' ] 1)
                       PlaceHolder
                       (HsLit
                          (HsString
                             []
                             {abstract:FastString}))
                       PlaceHolder))))
       , L tests/examples/Tuple.hs:3:11-17
           (Present
              (L tests/examples/Tuple.hs:3:11-17
                 (HsLit
                    (HsString
                       [ '"'
                       , 'h'
                       , 'e'
                       , 'l'
                       , 'l'
                       , 'o'
                       , '"'
                       ]
                       {abstract:FastString}))))
       , L tests/examples/Tuple.hs:3:20-22
           (Present
              (L tests/examples/Tuple.hs:3:20-22
                 (HsOverLit
                    (OverLit
                       (HsFractional
                          (FL
                             [ '6' , '.' , '5' ]
                             (:% 13 2)))
                       PlaceHolder
                       (HsLit
                          (HsString
                             []
                             {abstract:FastString}))
                       PlaceHolder))))
       , L tests/examples/Tuple.hs:3:24
           (Missing PlaceHolder)
       , L tests/examples/Tuple.hs:3:24
           (Missing PlaceHolder)
       ]
 }}}

 The final `Missing PlaceHolder` has a duplicated SrcSpan

--

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


More information about the ghc-tickets mailing list